loulijun2021
2022-08-05 d33eacc1f85ac3a736b33ba4713a19aae466d711
src/views/zzmx/gylx.vue
@@ -5,12 +5,12 @@
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          label-width="100px"
          inline
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label="工艺编码" style=" display: flex;">
            <el-form-item label="工艺路线编码" style=" display: flex;">
              <el-input v-model="form.routecode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="工艺名称" style=" display: flex;">
@@ -32,7 +32,7 @@
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
      </div>
      <el-divider />
      <div class="elTableDiv">
@@ -90,9 +90,11 @@
            prop="lm_date"
            label="创建时间"
            sortable="custom"
            width="160"
          />
          <el-table-column
            label="操作"
            width="120"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
@@ -120,16 +122,15 @@
    <el-dialog
      :title="operation==='add'?'新增':'预览'"
      :visible.sync="dialogVisible"
      width="1200px"
      width="1000px"
      :close-on-click-modal="false"
      top="15vh"
      :fullscreen="isFullscreen"
      :top="isIpad?'5vh':'15vh'"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" style="height: 500px" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
      <el-form ref="dialogForm" style="height: 500px" :rules="dialogFormRules" :model="dialogForm" label-width="110px">
        <div style="display: flex">
          <el-form-item label="工艺编码" prop="code" style="margin-right: 20px">
          <el-form-item label="工艺路线编码" prop="code" style="margin-right: 20px">
            <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 220px" />
          </el-form-item>
          <el-form-item label="工艺名称" prop="name">
@@ -140,6 +141,7 @@
          <el-form-item prop="enable" label="使用状态" style="margin-right: 20px">
            <el-select
              v-model="dialogForm.enable"
              filterable
              :disabled="operation==='edit'"
              :popper-append-to-body="false"
              style="width: 220px"
@@ -257,11 +259,11 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateRoute, DeleteRoute, RouteSearch, RouteSelect, StepSelect, ViewRoute } from '@/api/zzmx'
import { AddUpdateRoute, DeleteRoute, RouteSearch, StepSelect, ViewRoute } from '@/api/zzmx'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Zzjg',
  name: 'GYLX',
  components: {
    Pagination
  },
@@ -278,7 +280,7 @@
      }
    }
    return {
      isFullscreen: false,
      isIpad: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
@@ -302,7 +304,7 @@
        id: '',
        code: '',
        name: '',
        enable: '',
        enable: 'Y',
        description: '',
        Data: []
      },
@@ -315,7 +317,7 @@
      selectedName: '', // 选中的名称
      autocompleteValue: '', // 可搜索输入框中的值
      routeArr: [], // 工艺设置下拉所有值
      addDisabled: false, // 添加按钮是否可点击
      addDisabled: true, // 添加按钮是否可点击
      editDisabled: true, // 修改按钮是否可点击
      mouseFocusPosition: 0, // 鼠标聚焦的位置
      operation: '',
@@ -389,6 +391,20 @@
      })
      if (!flag) {
        return this.$message.info('输入框内容与下拉选项内容不匹配!')
      }
      // 3.输入框内容与已选内容相同时不能保存
      let flag2 = false
      this.dynamicTags.forEach(item => {
        if (item.stepname === this.autocompleteValue.trim()) {
          flag2 = true
        }
      })
      if (tag.stepname === this.autocompleteValue.trim()) {
        flag2 = false
      }
      if (flag2) {
        return this.$message.info('此工序已选,请选择其它工序!')
      }
      // 将值替换到原tag位置上
@@ -585,12 +601,13 @@
    handleClose() {
      this.dialogForm.code = ''
      this.dialogForm.name = ''
      this.dialogForm.enable = ''
      this.dialogForm.enable = 'Y'
      this.dialogForm.description = ''
      this.dialogForm.Data = []
      this.dynamicTags = [
        { editDisabled: true, stepcode: 'Step01', seq: 1, stepname: ' ', effect: 'light' }
      ]
      this.addDisabled = true
      this.$refs.dialogForm.clearValidate()
    },
    // 对话框取消
@@ -607,6 +624,13 @@
      this.dynamicTags.forEach(item => {
        Data.push({ seq: item.seq, stepcode: item.stepcode, stepname: item.stepname })
      })
      Data.forEach(item => {
        if (item.stepname === this.routeArr.find(it => it.stepname === item.stepname).stepname) {
          item.stepcode = this.routeArr.find(it => it.stepname === item.stepname).stepcode
        }
      })
      console.log(Data, 32)
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
@@ -633,8 +657,11 @@
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
        this.isFullscreen = window.innerHeight < 800
        this.tableHeight = this.mainHeight - 50
        if (window.innerHeight < 769) {
          this.tableHeight = this.tableHeight - 50
        }
        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
      })
    }
  }
@@ -685,8 +712,11 @@
  color: #606266;
}
//::v-deep .el-dialog__body {
//  padding: 20px 100px !important;
//}
::v-deep .el-dialog__body {
  padding: 20px 100px !important;
  padding: 20px 60px !important;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
@@ -809,8 +839,8 @@
  position: absolute;
  margin-left: -7px;
  z-index: 2;
  width: 15px;
  height: 15px !important;
  width: 16px;
  height: 16px !important;
  font-size: 12px;
  text-align: center;
  line-height: 15px;