wente
2023-11-15 9376ca2a22b6e279cac4a7de0d4b62adaac17acf
web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue
@@ -105,12 +105,16 @@
                    <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 prop="name" min-width="300" label="名称"></el-table-column>
                      <el-table-column align="center" width="180" 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" 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" @change="changeExpireSituation(scope.row)" v-model="scope.row.identify" placeholder="标识/版本"></el-input>
                            <el-input ref="editInput" v-model="scope.row.identify" placeholder="标识/版本"></el-input>
                          </span>
                          <span v-else>{{ scope.row.identify }}</span>
                        </template>
@@ -168,11 +172,11 @@
                    测试类型
                  </div>
                  <div class="el-border-left" style="width: 98%">
                    <el-form-item style="width: 40%;padding-left:5%;">
                    <el-form-item  style="width: 40%;padding-left:5%;margin-bottom: 0">
                      <zt-dict-checkbox v-model="dataForm.softwareTestOrder.testType1" column="2" dict="test_type1"
                                        clearable></zt-dict-checkbox>
                    </el-form-item>
                    <el-form-item style="width: 60%;padding-left: 15%;border-left: 1px solid rgba(0,0,0,.2);">
                    <el-form-item style="width: 60%;padding-left: 15%;border-left: 1px solid rgba(0,0,0,.2);margin-bottom: 0">
                      <zt-dict-checkbox v-model="dataForm.softwareTestOrder.testType2" dict="test_type2"
                                        clearable></zt-dict-checkbox>
                    </el-form-item>
@@ -350,7 +354,7 @@
                  <el-input v-model="dataForm.testAgencyInfo.agencyName" placeholder="请输入单位名称"></el-input>
                </el-form-item>
                <!-- 联系人 -->
                <el-form-item class="marginTopAndMarginBottom2" label-width="130px" label="地址" style="width: 98%">
                <el-form-item class="marginTopAndMarginBottom3" label-width="130px" label="地址" style="width: 98%">
                  <el-input v-model="dataForm.testAgencyInfo.site" placeholder="请输入联系人"></el-input>
                </el-form-item>
                <!-- 详细地址 -->
@@ -420,7 +424,7 @@
    </el-form>
    <template v-slot:footer>
      <zt-button v-if="dataForm.disabled" type="primary">打印</zt-button>
      <el-button v-if="dataForm.disabled" type="primary" @click="print()">打印</el-button>
    </template>
  </zt-dialog>
</template>
@@ -473,11 +477,21 @@
          softwareName: '',
          softwareType: '',
          tenantId: '',
          testLevel: ''
          testLevel: '',
        },
        testAgencyInfo: {
          agencyName:'',
          site:'',
          businContact:'',
          businComplaint:'',
          laborContact:'',
          labContactNum:'',
          postalCode:'',
          fax:''
        },
        deliverableList: [],
        measuredList: [],
        testAgencyInfo: {}
      }
    }
  },
@@ -495,6 +509,7 @@
    init(id,row){
      this.dataForm.id = row.id
      this.dataForm.projectId = row.projectId
      // this.dataForm.disabled
      this.getInfo()
      console.log(this.dataForm.id,this.dataForm.projectId,'params params')
    },
@@ -504,27 +519,48 @@
        orderId: this.dataForm.id,
        projectId: this.dataForm.projectId
      }
      console.log(this.dataForm, "this.dataForm")
      let res = await this.$http.get(`/project/SoftwareTestOrder/getDto`, {params: params})
      if (res.data) {
        this.dataForm = {
          ...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={}
        }
        if(this.dataForm.softwareTestOrder === null){
          this.dataForm.softwareTestOrder={}
        }
        if(this.dataForm.testAgencyInfo === null){
          this.dataForm.testAgencyInfo={}
        }
      }
      console.log(this.dataForm, "this.dataForm")
      // 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(',')
      }
    }
  }
@@ -538,6 +574,7 @@
.weiTuoDanAuto .el-radio {
  padding: 5px;
  margin-right: 10px;
}
.zt .weiTuoDanAuto .el-form-item.el-form-item--default {
@@ -619,7 +656,10 @@
  margin-top: -10px !important;
  margin-bottom: 10px !important;
}
.weiTuoDanAuto .marginTopAndMarginBottom3 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}
.csjgxx > .el-form-item > .el-form-item__content {
  width: calc(100% - 130px);
}