wente
2023-11-15 9376ca2a22b6e279cac4a7de0d4b62adaac17acf
web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue
@@ -105,13 +105,13 @@
                    <el-table class="el-software" height="230" border :data="dataForm.measuredList"
                              @cell-click="handleCellClick"
                              stripe>
                      <el-table-column type="index" align="center" width="80" label="序号"/>
                      <el-table-column type="index" align="center"  width="80" label="序号"/>
                      <el-table-column min-width="300" label="名称">
                        <template slot-scope="scope">
                          <span>{{ (dataForm.project.softwareName||'') + scope.row.name }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column align="center" width="180" label="标识/版本">
                      <el-table-column align="center" prop="identify" width="180" label="标识/版本">
                        <template slot-scope="scope">
                          <span v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property">
                            <el-input ref="editInput" v-model="scope.row.identify" placeholder="标识/版本"></el-input>
@@ -424,7 +424,7 @@
    </el-form>
    <template v-slot:footer>
      <el-button v-if="dataForm.disabled" type="primary">打印</el-button>
      <el-button v-if="dataForm.disabled" type="primary" @click="print()">打印</el-button>
    </template>
  </zt-dialog>
</template>
@@ -526,6 +526,11 @@
          ...this.dataForm,
          ...res.data
        }
        if(this.dataForm.softwareTestOrder){
          this.dataForm.softwareTestOrder.testType1=this.dataForm.softwareTestOrder.testType1.split(',')
          this.dataForm.softwareTestOrder.testType2=this.dataForm.softwareTestOrder.testType2.split(',')
          console.log(this.dataForm.softwareTestOrder.testType1)
        }
        if(this.dataForm.project === null){
          this.dataForm.project={}
        }
@@ -538,15 +543,24 @@
      }
      // console.log(this.dataForm, "this.dataForm")
    },
    async print(){
      let res = await this.$http.get(`/project/SoftwareTestOrder/exportWord/${this.dataForm.id}`)
      console.log(res.data)
    },
    // 表单提交
    async formSubmit() {
      console.log(this.dataForm, ' this.dataForm')
      this.dataForm.softwareTestOrder.testType1=this.dataForm.softwareTestOrder.testType1.join(',')
      this.dataForm.softwareTestOrder.testType2=this.dataForm.softwareTestOrder.testType2.join(',')
      console.log(this.dataForm.softwareTestOrder.testType1)
      let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/project/SoftwareTestOrder/', this.dataForm)
      if (res.success) {
        await this.$tip.success()
        this.$refs.dialog.close()
        this.$emit('refreshDataList')
      }else{
        this.dataForm.softwareTestOrder.testType1=this.dataForm.softwareTestOrder.testType1.split(',')
        this.dataForm.softwareTestOrder.testType2=this.dataForm.softwareTestOrder.testType2.split(',')
      }
    }
  }