loulijun2021
2022-07-14 bd3410da8a13682ec0bc888539dc35209a2196ba
src/views/zzmx/jpgj.vue
@@ -13,11 +13,14 @@
            <el-form-item label="产品名称" style=" display: flex;">
              <el-select
                v-model="form.partcode"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
                @change="partChange"
              >
                <!--                @focus="getPartSelect"-->
                <el-option
                  v-for="item in partArr"
                  :key="item.partcode"
@@ -29,6 +32,7 @@
            <el-form-item label="工艺路线" style=" display: flex;">
              <el-select
                v-model="form.routecode"
                filterable
                :disabled="form.partcode===''"
                :popper-append-to-body="false"
                style="width: 200px"
@@ -63,6 +67,7 @@
            <el-form-item label="关联设备" style=" display: flex;">
              <el-select
                v-model="form.eqpcode"
                filterable
                :disabled="form.stepcode===''"
                :popper-append-to-body="false"
                style="width: 200px"
@@ -176,7 +181,7 @@
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="edit('edit',row)">修改</el-button>
                <el-button type="text" @click="edit('edit',row)">编辑</el-button>
                <el-button type="text" @click="del(row)">删除</el-button>
              </div>
            </template>
@@ -197,10 +202,11 @@
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'修改'"
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="70%"
      width="1200px"
      top="15vh"
      :fullscreen="isFullscreen"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
@@ -212,13 +218,16 @@
            <el-select
              v-show="operation==='add'"
              v-model="dialogForm.partcode"
              filterable
              style="width: 220px"
              placeholder="请选择"
              :popper-append-to-body="false"
              @change="partDialogChange"
            >
              <!--              @focus="getPartSelect2"-->
              <el-option
                v-for="item in partArr"
                v-for="item in partArr2"
                :key="item.partcode"
                :label="item.partname"
                :value="item.partcode"
@@ -236,6 +245,7 @@
              v-show="operation==='add'"
              v-model="dialogForm.routecode"
              style="width: 220px"
              filterable
              :disabled="dialogForm.partcode===''"
              placeholder="请选择"
              :popper-append-to-body="false"
@@ -426,7 +436,7 @@
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Zzjg',
  name: 'JPGJ',
  components: {
    Pagination
  },
@@ -450,6 +460,7 @@
      }
    }
    return {
      isFullscreen: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
@@ -463,6 +474,7 @@
        rows: 20 // 每页多少条
      },
      partArr: [], // 产品集合
      partArr2: [], // 产品集合对话框
      routeArr: [], // 产品集合
      stepArr: [], // 产品集合
      eqpArr: [], // 产品集合
@@ -549,6 +561,10 @@
    async getPartSelect() {
      const { data: res } = await PartSelect()
      this.partArr = res
    },
    async getPartSelect2() {
      const { data: res } = await PartSelect()
      this.partArr2 = res
    },
    async partChange(val) {
      const { data: res } = await PartSelectRpute({ partcode: val })
@@ -724,6 +740,7 @@
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
      this.getPartSelect2()
    },
    // 修改按钮
    async  edit(operation, row) {
@@ -752,12 +769,11 @@
        type: 'warning'
      }).then(() => {
        const data = {
          partcode: this.eqpTable.partcode,
          routecode: this.eqpTable.routecode,
          stepcode: this.eqpTable.stepcode,
          partcode: row.partcode,
          routecode: row.route_code,
          stepcode: row.stepcode,
          eqpcode: row.eqp_code
        }
        console.log(data)
        DeleteBeatRate(data).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
@@ -783,6 +799,7 @@
      this.stepDialogArr = []
      this.eqpDialogArr = []
      this.$refs.dialogForm.clearValidate()
      this.getBeatRateSearch()
    },
    // 对话框取消
    dialogVisibleCancel() {
@@ -815,6 +832,7 @@
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
        // this.isFullscreen = window.innerHeight < 800
      })
    }
  }