loulijun2021
2022-08-05 d33eacc1f85ac3a736b33ba4713a19aae466d711
src/views/zzmx/gxdy.vue
@@ -17,7 +17,13 @@
              <el-input v-model="form.stepname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="启用状态" style=" display: flex;">
              <el-select v-model="form.enable" filterable :popper-append-to-body="false" style="width: 200px" placeholder="请选择">
              <el-select
                v-model="form.enable"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in enableArr"
                  :key="item.code"
@@ -78,19 +84,23 @@
            prop="RowNum"
            width="50"
            label="序号"
            fixed
          />
          <el-table-column
            prop="stepcode"
            label="工序编码"
            min-width="150"
            sortable="custom"
          />
          <el-table-column
            prop="stepname"
            min-width="150"
            label="工序名称"
            sortable="custom"
          />
          <el-table-column
            prop="flwtype"
            min-width="150"
            label="工序类型"
            sortable="custom"
          >
@@ -103,12 +113,14 @@
          <el-table-column
            prop="descr"
            label="工序描述"
            min-width="180"
            sortable="custom"
          />
          <el-table-column
            prop="enable"
            label="启用状态"
            sortable="custom"
            width="110"
          >
            <template slot-scope="{row}">
              <div v-if="row.enable==='Y'">是</div>
@@ -118,6 +130,7 @@
          <el-table-column
            prop="lm_user"
            label="创建人员"
            width="110"
            sortable="custom"
          />
          <el-table-column
@@ -129,27 +142,41 @@
          <el-table-column
            label="关联工作站"
            prop="is_eqp"
            width="110"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <i v-if="row.is_eqp==='Y'" class="el-icon-share" @click="workClick(row)" />
                <i v-if="row.is_eqp==='N'" class="el-icon-share" style="color: #E4E7ED" @click="workClick(row)" />
                <i
                  v-if="row.is_eqp==='N'"
                  class="el-icon-share"
                  style="color: rgb(180 ,181, 185)"
                  @click="workClick(row)"
                />
              </div>
            </template>
          </el-table-column>
          <el-table-column
            label="关联缺陷"
            prop="is_defect"
            width="110"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <i v-if="row.is_defect==='Y'" class="el-icon-share" @click="defectClick(row)" />
                <i v-if="row.is_defect==='N'" class="el-icon-share" style="color: #E4E7ED;" @click="defectClick(row)" />
                <i
                  v-if="row.is_defect==='N'"
                  class="el-icon-share"
                  style="color:rgb(180 ,181, 185);"
                  @click="defectClick(row)"
                />
              </div>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            fixed="right"
            width="120"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
@@ -190,21 +217,33 @@
        <el-form-item label="工序名称" prop="stepname">
          <el-input v-model="dialogForm.stepname" style="width: 200px" />
        </el-form-item>
        <el-form-item prop="steptypecode" label="工序类型">
          <el-select
          <el-radio-group
            v-model="dialogForm.steptypecode"
            filterable
            style="width: 200px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
            <el-radio
              v-for="item in steptypeArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
              :label="item.name"
            />
          </el-select>
          </el-radio-group>
          <!--          <el-select-->
          <!--            v-model="dialogForm.steptypecode"-->
          <!--            filterable-->
          <!--            style="width: 200px"-->
          <!--            placeholder="请选择"-->
          <!--            :popper-append-to-body="false"-->
          <!--          >-->
          <!--            <el-option-->
          <!--              v-for="item in steptypeArr"-->
          <!--              :key="item.code"-->
          <!--              :label="item.name"-->
          <!--              :value="item.code"-->
          <!--            />-->
          <!--          </el-select>-->
        </el-form-item>
        <el-form-item prop="enable" label="启用状态">
          <el-select
@@ -239,8 +278,7 @@
      title="关联工作站"
      :visible.sync="workDialogVisible"
      width="50%"
      top="15vh"
      :fullscreen="isFullscreen"
      :top="isIpad?'5vh': '15vh'"
      :close-on-click-modal="false"
      class="workDialogVisible"
      @closed="workHandleClose"
@@ -287,7 +325,7 @@
          :data="workDialogForm.workTreeArr"
          show-checkbox
          node-key="code"
          style="height: 300px;"
          style="height: 280px;"
          default-expand-all
          :props="workTreeDefaultProps"
          @check="checkBoxClick"
@@ -308,8 +346,7 @@
      title="工序关联缺陷"
      :visible.sync="defectDialogVisible"
      width="50%"
      top="15vh"
      :fullscreen="isFullscreen"
      :top="isIpad?'5vh':'15vh'"
      :close-on-click-modal="false"
      class="defectDialogVisible"
      @closed="defectHandleClose"
@@ -330,7 +367,7 @@
          :data="defectTree"
          show-checkbox
          node-key="code"
          style="height: 500px;"
          style="height: 400px;"
          default-expand-all
          :props="workTreeDefaultProps"
        />
@@ -351,8 +388,6 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import {
  AddUpdateStep,
  DeleteStep, SaveStepAssociationDefect,
@@ -382,7 +417,7 @@
      }
    }
    return {
      isFullscreen: false,
      isIpad: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
@@ -412,7 +447,7 @@
        'id': '',
        'stepcode': '',
        'stepname': '',
        'steptypecode': '',
        'steptypecode': '自制',
        'enable': 'Y',
        'description': '',
        'OperType': ''
@@ -511,7 +546,7 @@
        this.dialogForm.id = row.id
        this.dialogForm.stepcode = row.stepcode
        this.dialogForm.stepname = row.stepname
        this.dialogForm.steptypecode = row.flwtype
        this.dialogForm.steptypecode = this.steptypeArr.find(item => item.code === row.flwtype).name
        this.dialogForm.description = row.descr
        this.dialogForm.enable = row.enable
      })
@@ -537,7 +572,7 @@
    handleClose() {
      this.dialogForm.stepcode = ''
      this.dialogForm.stepname = ''
      this.dialogForm.steptypecode = ''
      this.dialogForm.steptypecode = '自制'
      this.dialogForm.enable = 'Y'
      this.dialogForm.description = ''
      this.$refs.dialogForm.clearValidate()
@@ -554,7 +589,7 @@
            id: this.dialogForm.id,
            stepcode: this.dialogForm.stepcode,
            stepname: this.dialogForm.stepname,
            steptypecode: this.dialogForm.steptypecode,
            steptypecode: this.steptypeArr.find(item => item.name === this.dialogForm.steptypecode).code,
            enable: this.dialogForm.enable,
            description: this.dialogForm.description,
            OperType: this.operation === 'add' ? 'Add' : 'Update'
@@ -575,11 +610,11 @@
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
        // this.isFullscreen = window.innerHeight < 800
        if (window.innerHeight < 800) {
        this.tableHeight = this.mainHeight - 50
        if (window.innerHeight < 769) {
          this.tableHeight = this.tableHeight - 50
        }
        this.isIpad = window.innerHeight < 769
      })
    },
    /* 关联工作站模块*/
@@ -902,7 +937,7 @@
      this.defectDialogVisible = false
    },
    // 确认
    async  defectDialogVisibleConfirm() {
    async defectDialogVisibleConfirm() {
      const nodeKey = this.$refs.defectTree.getCheckedKeys()
      const data = []
      this.defectTree[0].children.forEach(item => {