loulijun2021
2022-08-27 3cbb9eb9e6f594721239bde5754db6df924472a6
src/views/zlgl/gxjybz.vue
@@ -127,8 +127,8 @@
      :top="isIpad?'5vh':'15vh'"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
      <!--      @close="handleClose"-->
      <div style="margin-bottom: 10px">
        <i class="el-icon-s-comment" style="color:#42b983;" /> 标准信息:
      </div>
@@ -159,7 +159,7 @@
        <i class="el-icon-s-comment" style="color:#42b983;" /> 检验项信息:
      </div>
      <div style="margin-bottom: 10px">
        <el-button v-if="operation==='add'" type="primary" @click="JYadd">新增</el-button>
        <el-button v-if="operation==='add'||operation==='edit'" type="primary" @click="JYadd">新增</el-button>
      </div>
      <div>
        <el-table
@@ -179,33 +179,6 @@
            width="100"
            fixed
          />
          <!--          <el-table-column-->
          <!--            prop="code"-->
          <!--            label="检验标准编码(名称)"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.isVisible===0" style="display: flex;">-->
          <!--                <div>{{ row.code }}</div>-->
          <!--                <div style="margin-left: 10px">{{ row.name }}</div>-->
          <!--              </div>-->
          <!--              <el-select-->
          <!--                v-if="row.isVisible===1"-->
          <!--                v-model="row.code"-->
          <!--                filterable-->
          <!--                :popper-append-to-body="false"-->
          <!--                style="width: 400px;"-->
          <!--                placeholder="请选择"-->
          <!--                @change="val=>changeCode(val,row)"-->
          <!--              >-->
          <!--                <el-option-->
          <!--                  v-for="item in JYSelectArr"-->
          <!--                  :key="item.code"-->
          <!--                  :label="item.code+''+item.name"-->
          <!--                  :value="item.code"-->
          <!--                />-->
          <!--              </el-select>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <el-table-column
            prop="code"
            label="检验标准编码"
@@ -445,6 +418,8 @@
      this.$nextTick(() => {
        this.$refs.JYTableData.doLayout()
      })
      this.JYSelectArr = [...this.JYSelectArr].filter(x => [...this.JYTableData].every(y => y.code !== x.code))
    },
    // 删除按钮
    async del(row) {
@@ -482,6 +457,7 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const tableData = []
          this.JYTableData = this.JYTableData.filter(item => item.code !== '')
          this.JYTableData.forEach((item, index) => {
            tableData.push({
              STEPCHECKITEM_SEQ: (index + 1),
@@ -524,11 +500,6 @@
      const { data: res } = await StepCheckItemSelect()
      this.JYSelectArr = res
    },
    // 检验标准编码值改变
    // changeCode(val, row) {
    //   row.name = this.JYSelectArr.find(it => it.code === val).name
    //   row.descr = this.JYSelectArr.find(it => it.code === val).descr
    // },
    // 检验标准名称值改变
    changeName(val, row) {
      const res = this.JYSelectArr.find(item => {
@@ -551,6 +522,16 @@
      this.JYIsCancel = false
    },
    JYedit(row) {
      let flag = false
      this.JYTableData.forEach((item, index) => {
        if (item.isVisible === 1) {
          flag = true
        }
      })
      if (flag) {
        return this.$message.info('请先确认或取消其它行!')
      }
      this.JYIsCancel = false
      this.JYSelectArr.splice(0, 0, {
        code: row.code,