Fixiaobai
2023-09-24 e3d6cc8c9ee3a771b92a8706e3cf83dededfaa43
src/components/view/rawInsDetail.vue
@@ -102,7 +102,8 @@
               <template slot-scope="scope">
                  <!-- <el-input v-if="detailId == null" v-model="scope.row.name" placeholder="请输入项目名称"></el-input> -->
                  <el-autocomplete v-if="detailId == null" class="inline-input" v-model="scope.row.name"
                     :fetch-suggestions="querySearch" placeholder="请输入项目名称" @select="handleSelect(scope.row)" @blur="handleSelect(scope.row)"></el-autocomplete>
                     :fetch-suggestions="querySearch" placeholder="请输入项目名称" @select="handleSelect(scope.row)"
                     @blur="handleSelect(scope.row)"></el-autocomplete>
                  <el-input v-else v-model="scope.row.rpName" disabled></el-input>
               </template>
            </el-table-column>
@@ -181,7 +182,7 @@
            </el-table-column>
            <el-table-column v-if="detailId !== null" label="操作" width="120">
               <template>
                  <el-button type="text" size="small" @click.once="submitSave">上报</el-button>
                  <el-button type="text" size="small" @click="submitSave">上报</el-button>
               </template>
            </el-table-column>
         </el-table>
@@ -438,14 +439,39 @@
            this.getDetailInfo(); //重新刷新信息数据
         }
      },
      async submitSave() {
         const res = await this.$axios.post(
       submitSave() {
         let pro = this.projectTable.filter(item => {
            return item.testState === 0;
         })
         if (pro.length > 0) {
            this.$prompt('请输入不合格数量', '不合格数量', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               inputPattern: /^\d+$/,
               inputErrorMessage: '请输入正确数字格式'
            }).then(({ value }) => {
               this.$axios.post(
                  this.$api.url.updateRawInspectsById+`${this.detailId}`, {"number": value }
               ).then(res => {
                  this.$message.success("提交成功");
                  this.getDetailInfo();
                  this.goBack()
               });
            }).catch(() => {
               this.$message({
                  type: 'info',
                  message: '取消输入'
               });
            });
         }else{
          this.$axios.post(
            this.$api.url.updateRawInspectsById + `${this.detailId}`
         ).then(res => {
            this.$message.success("提交成功");
            this.getDetailInfo();
            this.goBack()
         });
         }
      },
      // 获取设备树内容
      getOptions() {