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/ensureResults/qualityControlPlan/components/processingSheet.vue |  493 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 493 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
new file mode 100644
index 0000000..bf7c63f
--- /dev/null
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
@@ -0,0 +1,493 @@
+<template>
+  <div>
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="formDia" title="涓嶇鍚堝伐浣滄帶鍒跺崟"
+      width="60%" @close="closeProcessingDia">
+      <el-steps :active="currentStep" align-center finish-status="success">
+        <el-step title="涓嶇鍚堝伐浣滄儏鍐佃褰�" @click.native="setStep(0)"></el-step>
+        <el-step title="澶勭悊鎺柦" @click.native="setStep(1)"></el-step>
+        <el-step title="绾犳鎺柦" @click.native="setStep(2)"></el-step>
+        <el-step title="鏄惁閫氱煡瀹㈡埛鍙婂彲鎭㈠宸ヤ綔" @click.native="setStep(3)"></el-step>
+      </el-steps>
+      <div>
+        <table border="1" cellspacing="10" class="tables">
+          <tr v-if="showStep === 0">
+            <td class="td-title">
+              <p>鍙戠敓閮ㄩ棬锛�</p>
+            </td>
+            <td class="td-info">
+              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.occurrenceDepartment"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small">
+              </el-input>
+              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.occurrenceDepartment }}</span>
+            </td>
+            <td class="td-title">
+              <p>閮ㄩ棬璐熻矗浜猴細</p>
+            </td>
+            <td class="td-info">
+              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.headDepartment" placeholder="璇疯緭鍏ュ唴瀹�"
+                size="small">
+              </el-input>
+              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.headDepartment }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 0">
+            <td class="td-title">
+              <p><span class="required-span">* </span>涓嶇鍚堝伐浣滃彂鐜伴�斿緞锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-radio-group v-model="form.findWay" v-removeAriaHidden :disabled="showStep === 0 && currentStep !== 0">
+                <el-radio :label="0">绠$悊璇勫</el-radio>
+                <el-radio :label="1">鍐呴儴瀹℃牳</el-radio>
+                <el-radio :label="2">妫�娴嬭繃绋嬫帶鍒�</el-radio>
+                <el-radio :label="3">鍐呴儴璐ㄩ噺鎺у埗</el-radio>
+                <el-radio :label="4">鍐呴儴鐩戠潱</el-radio>
+                <el-radio :label="5">澶栭儴璇勫</el-radio>
+                <el-radio :label="6">澶栭儴鎶曡瘔</el-radio>
+                <el-radio :label="7">鍏朵粬</el-radio>
+              </el-radio-group>
+            </td>
+          </tr>
+          <tr v-if="showStep === 0">
+            <td class="td-title">
+              <p>涓嶇鍚堝伐浣滅殑璇︾粏璁板綍锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.recordDetail" :rows="4"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.recordDetail }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 0">
+            <td class="td-title">
+              <p>涓嶇鍚堝伐浣滅殑浠ュ強鍙婃潯娆惧彿锛�</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.recordAccording" :rows="4"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.recordAccording }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 0">
+            <td class="td-title">
+              <p><span class="required-span">* </span>琚洃鐫d汉锛�</p>
+            </td>
+            <td class="td-info">
+              <el-select v-if="showStep === 0 && currentStep === 0" v-model="form.supervisedUserId" clearable filterable
+                placeholder="璇烽�夋嫨" size="small">
+                <el-option v-for="(item, i) in supervisedUserList" :key="i" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.supervisedUserName }}</span>
+            </td>
+            <td class="td-title">
+              <p><span class="required-span">* </span>琚洃鐫f椂闂达細</p>
+            </td>
+            <td class="td-info">
+              <el-date-picker v-if="showStep === 0 && currentStep === 0" v-model="form.supervisedTime"
+                format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small" style="width: 80%" type="date"
+                value-format="yyyy-MM-dd">
+              </el-date-picker>
+              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.supervisedTime }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 0">
+            <td v-if="currentStep === 0" class="td-title">
+              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</p>
+            </td>
+            <td v-if="currentStep === 0" class="td-info">
+              <el-select v-model="form.actionsUserId" clearable filterable placeholder="璇烽�夋嫨" size="small">
+                <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </td>
+          </tr>
+          <tr v-if="showStep === 0 && currentStep !== 0">
+            <td class="td-title">
+              <p>鍙戠幇閮ㄩ棬锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.foundDepartment }}
+            </td>
+            <td class="td-title">
+              <p>鏃堕棿锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.recordTime }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 0 && currentStep !== 0">
+            <td class="td-title">
+              <p>璁板綍浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.recordUserName }}
+            </td>
+            <td class="td-title">
+              <p>璁板綍鏃堕棿锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.recordTime }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 1">
+            <td class="td-title">
+              <p><span class="required-span">* </span>娑堥櫎涓嶇鍚堝伐浣滄墍閲囧彇鐨勬帾鏂斤細</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 1 && currentStep === 1" v-model="form.eliminateMeasure" :rows="5"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 1 && currentStep !== 1" class="td-info1"> {{ form.eliminateMeasure }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 1">
+            <td class="td-title">
+              <p>褰撳墠璐熻矗浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.actionsUserName }}
+            </td>
+            <td class="td-title">
+              <p>澶勭悊鏃堕棿锛�</p>
+            </td>
+            <td class="td-info">
+              {{ form.actionsTime }}
+            </td>
+          </tr>
+          <tr v-if="showStep === 1">
+            <td v-if="currentStep === 1" class="td-title">
+              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</p>
+            </td>
+            <td v-if="currentStep === 1" class="td-info" colspan="3">
+              <el-select v-model="form.correctUserId" clearable filterable placeholder="璇烽�夋嫨" size="small">
+                <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </td>
+          </tr>
+          <tr v-if="showStep === 2">
+            <td class="td-title">
+              <p><span class="required-span">* </span>鏄惁闇�瑕侀噰鍙栫籂姝f帾鏂斤細</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-radio-group v-model="form.isCorrect" v-removeAriaHidden
+                :disabled="showStep === 2 && currentStep !== 2">
+                <el-radio :label="0">鍚�</el-radio>
+                <el-radio :label="1">鏄�</el-radio>
+              </el-radio-group>
+            </td>
+          </tr>
+          <tr v-if="showStep === 2">
+            <td class="td-title">
+              <p>绾犳鎺柦澶勭悊鍗曡窡韪細</p>
+            </td>
+            <td class="td-info" colspan="3">
+              <el-input v-if="showStep === 2 && currentStep === 2" v-model="form.correctContent" :rows="5"
+                placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea">
+              </el-input>
+              <span v-if="showStep === 2 && currentStep !== 2" class="td-info1"> {{ form.correctContent }}</span>
+            </td>
+          </tr>
+          <tr v-if="showStep === 2">
+            <td class="td-title">
+              <p>褰撳墠璐熻矗浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.correctUserName }}
+            </td>
+            <td v-if="showStep === 2 && currentStep !== 2" class="td-title">
+              <p>澶勭悊鏃堕棿锛�</p>
+            </td>
+            <td v-if="showStep === 2 && currentStep !== 2" class="td-info">
+              {{ form.correctTime }}
+            </td>
+            <td v-if="currentStep === 2" class="td-title">
+              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</p>
+            </td>
+            <td v-if="currentStep === 2" class="td-info">
+              <el-select v-model="form.qualityManagerUserId" clearable filterable placeholder="璇烽�夋嫨" size="small">
+                <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </td>
+          </tr>
+          <tr v-if="showStep === 3">
+            <td rowspan="3">
+              <p>鏄惁閫氱煡瀹㈡埛鍙婂彲鎭㈠宸ヤ綔</p>
+            </td>
+          </tr>
+          <tr v-if="showStep === 3">
+            <td class="td-title">
+              <p><span class="required-span">* </span>閫氱煡瀹㈡埛锛�</p>
+            </td>
+            <td class="td-info" colspan="2">
+              <el-radio-group v-model="form.notifyCustomer" v-removeAriaHidden
+                :disabled="showStep === 3 && currentStep !== 3">
+                <el-radio :label="0">鍚�</el-radio>
+                <el-radio :label="1">鏄�</el-radio>
+              </el-radio-group>
+            </td>
+          </tr>
+          <tr v-if="showStep === 3">
+            <td class="td-title">
+              <p><span class="required-span">* </span>鎭㈠宸ヤ綔锛�</p>
+            </td>
+            <td class="td-info" colspan="2">
+              <el-radio-group v-model="form.backToWork" v-removeAriaHidden
+                :disabled="showStep === 3 && currentStep !== 3">
+                <el-radio :label="0">鍚�</el-radio>
+                <el-radio :label="1">鏄�</el-radio>
+              </el-radio-group>
+            </td>
+          </tr>
+          <tr v-if="showStep === 3">
+            <td class="td-title">
+              <p>褰撳墠璐熻矗浜猴細</p>
+            </td>
+            <td class="td-info">
+              {{ form.qualityManagerUserName }}
+            </td>
+            <td v-if="showStep === 3 && currentStep !== 3" class="td-title">
+              <p>澶勭悊鏃堕棿锛�</p>
+            </td>
+            <td v-if="showStep === 3 && currentStep !== 2" class="td-info">
+              {{ form.qualityManagerTime }}
+            </td>
+          </tr>
+        </table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeProcessingDia">鍙� 娑�</el-button>
+        <el-button v-if="currentStep !== 4" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getSuperviseDetailAccording,
+  addSuperviseDetailAccording,
+} from '@/api/cnas/process/ensureResults/qualityControlPlan.js'
+import { selectUserCondition } from "@/api/system/user";
+export default {
+  name: 'processingSheet',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      formDia: false,
+      currentStep: 0,
+      showStep: 0,
+      form: {
+        occurrenceDepartment: '',
+        headDepartment: '',
+        findWay: '',
+        recordDetail: '',
+        recordAccording: '',
+        supervisedUserId: '',
+        supervisedUserName: '',
+        supervisedTime: '',
+        actionsUserId: '',
+        actionsUserName: '',
+        eliminateMeasure: '',
+        correctUserId: '',
+        correctUserName: '',
+        isCorrect: '',
+        qualityManagerUserId: '',
+        correctContent: '',
+        superviseDetailsId: '',
+        superviseDetailsAccordingId: '',
+        flowType: '',
+        recordUserName: '',
+        recordTime: '',
+        foundDepartment: '',
+        actionsTime: '',
+        correctTime: '',
+        notifyCustomer: '',
+        backToWork: '',
+        qualityManagerUserName: '',
+        qualityManagerTime: '',
+      },
+      editLoad: false,
+      personList: [],
+      supervisedUserList: [],
+    };
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    openDia(row) {
+      this.formDia = true
+      this.searchInfo(row)
+      this.form.superviseDetailsId = row.superviseDetailsId
+      this.getAuthorizedPerson() // 鑾峰彇浜哄憳鍒楄〃
+      this.getSupervisedUserList() // 鑾峰彇褰撳墠閮ㄩ棬浜哄憳
+    },
+    // 鏌ヨ鐩戞帶璁″垝璇︽儏瀹炴柦淇℃伅
+    searchInfo(row) {
+      this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
+      getSuperviseDetailAccording({ superviseDetailsId: row.superviseDetailsId }).then(res => {
+        if (res.code === 201) return
+        if (res.data.superviseDetailsAccordingId === null) {
+          this.showStep = 0
+          this.currentStep = 0
+        } else {
+          this.form = res.data
+          if (res.data.isFinish === 0) {
+            if (res.data.actionsUserId) {
+              this.showStep = 1
+              this.currentStep = 1
+            }
+            if (res.data.correctUserId) {
+              this.showStep = 2
+              this.currentStep = 2
+            }
+            if (res.data.qualityManagerUserId) {
+              this.showStep = 3
+              this.currentStep = 3
+            }
+          } else {
+            this.currentStep = 4
+            this.showStep = 3
+          }
+        }
+      }).catch(err => {
+        console.log('err---', err);
+      })
+    },
+    // 鎻愪氦
+    handleEdit() {
+      if (this.currentStep === 0) {
+        if (this.form.findWay === null) {
+          this.$message.warning('璇烽�夋嫨涓嶇鍚堝伐浣滃彂鐜伴�斿緞')
+          return
+        }
+        if (!this.form.supervisedUserId) {
+          this.$message.warning('璇烽�夋嫨琚洃鐫d汉')
+          return
+        }
+        if (!this.form.supervisedTime) {
+          this.$message.warning('璇烽�夋嫨琚洃鐫f椂闂�')
+          return
+        }
+        if (!this.form.actionsUserId) {
+          this.$message.warning('璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉')
+          return
+        }
+      } else if (this.currentStep === 1) {
+        if (!this.form.supervisedUserId) {
+          this.$message.warning('璇峰~鍐欐秷闄や笉绗﹀悎宸ヤ綔鎵�閲囧彇鐨勬帾鏂�')
+          return
+        }
+        if (!this.form.correctUserId) {
+          this.$message.warning('璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉')
+          return
+        }
+      } else if (this.currentStep === 2) {
+        if (this.form.isCorrect === null) {
+          this.$message.warning('璇烽�夋嫨鏄惁闇�瑕侀噰鍙栫籂姝f帾鏂�')
+          return
+        }
+        if (!this.form.qualityManagerUserId) {
+          this.$message.warning('璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉')
+          return
+        }
+      } else if (this.currentStep === 3) {
+        if (this.form.notifyCustomer === null) {
+          this.$message.warning('璇烽�夋嫨鏄惁閫氱煡瀹㈡埛')
+          return
+        }
+        if (this.form.backToWork === null) {
+          this.$message.warning('璇烽�夋嫨鏄惁鎭㈠宸ヤ綔')
+          return
+        }
+      }
+      this.editLoad = true
+      this.form.supervisedTime = ''
+      this.form.flowType = this.currentStep
+      delete this.form.recordTime
+      delete this.form.actionsTime
+      delete this.form.correctTime
+      addSuperviseDetailAccording(this.form).then(res => {
+        this.editLoad = false
+        if (res.code === 201) return
+        this.$message.success('鎻愪氦鎴愬姛')
+        this.closeProcessingDia()
+      }).catch(err => {
+        console.log('err---', err);
+        this.editLoad = false
+      })
+    },
+    // 鍏抽棴寮规
+    closeProcessingDia() {
+      this.formDia = false
+      this.$emit('closeProcessingDia')
+    },
+    setStep(step) {
+      this.showStep = step
+    },
+    getAuthorizedPerson() {
+      selectUserCondition().then(res => {
+        let data = []
+        res.data.forEach(a => {
+          data.push({
+            label: a.name,
+            value: a.id
+          })
+        })
+        this.personList = data
+      })
+    },
+    getSupervisedUserList() {
+      selectUserCondition().then(res => {
+        let data = []
+        res.data.forEach(a => {
+          data.push({
+            label: a.name,
+            value: a.id
+          })
+        })
+        this.supervisedUserList = data
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+>>>.el-dialog {
+  margin: 10vh auto 50px !important;
+}
+
+.tables {
+  table-layout: fixed;
+  width: 100%;
+  margin-top: 10px;
+}
+
+.td-title {
+  height: 40px;
+  width: 170px;
+  text-align: center;
+  font-size: 14px;
+  word-wrap: break-word;
+  white-space: normal;
+  padding: 6px;
+}
+
+.td-info {
+  padding: 6px;
+}
+
+.td-info1 {
+  display: inline-block;
+  width: 100%;
+  text-align: left;
+  font-size: 14px;
+  word-wrap: break-word;
+  white-space: normal;
+}
+</style>

--
Gitblit v1.9.3