jinlin
2023-11-15 0339de1ea2ddfb101510ddc7b347ee0552cd6a2b
web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue
@@ -102,11 +102,11 @@
                    被测件及其他相关物品清单
                  </div>
                  <div style="width: calc(100% - 120px);padding: 5px">
                    <el-table class="el-software" height="230" border :data="dataForm.softwareTestOrderMeasuredList"
                    <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="dictLabel" min-width="300" label="名称"></el-table-column>
                      <el-table-column prop="name" min-width="300" label="名称"></el-table-column>
                      <el-table-column align="center" width="180" label="标识/版本">
                        <template slot-scope="scope">
                          <span v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property">
@@ -330,10 +330,10 @@
                    交付物清单
                  </div>
                  <div style="width: calc(100% - 120px);padding: 5px">
                    <el-table class="el-software" height="230" border :data="dataForm.softwareTestOrderDeliverableList"
                    <el-table class="el-software" height="230" border :data="dataForm.deliverableList"
                              stripe>
                      <el-table-column type="index" align="center" width="80" label="序号"/>
                      <el-table-column prop="dictLabel" min-width="300" label="名称"></el-table-column>
                      <el-table-column prop="name" min-width="300" label="名称"></el-table-column>
                      <el-table-column prop="identify" align="center" width="380" label="标识/版本"></el-table-column>
                    </el-table>
                  </div>
@@ -420,13 +420,12 @@
    </el-form>
    <template v-slot:footer>
      <el-button perm="project:view" type="primary">打印</el-button>
      <zt-button v-if="dataForm.disabled" type="primary">打印</zt-button>
    </template>
  </zt-dialog>
</template>
<script>
import {getYearMonDay} from '@/commonJS/common'
export default {
  data() {
@@ -435,8 +434,24 @@
      editingCell:null,
      dataForm: {
        id: null,
        testAgencyInfo: {},
        projectId: null,
        softwareTestOrder: {
          optEnviron:'',
          programLang:'',
          testBasis:'',
          testType1:'',
          testType2:'',
          testStandard:'',
          startDate:'',
          endDate:'',
          testVenue:'',
          otherRequire:'',
          testDate:'',
          deliveryDate:'',
          testCost:'',
          articleNature:'',
          sampleStatus:'',
        },
        project: {
          code: '',
          creator: '',
@@ -458,28 +473,15 @@
          softwareName: '',
          softwareType: '',
          tenantId: '',
          testLevel: '',
          testLevel: ''
        },
        softwareTestOrder: {},
        softwareTestOrderDeliverableList: [],
        softwareTestOrderMeasuredList: [],
        deliverableList: [],
        measuredList: [],
        testAgencyInfo: {}
      }
    }
  },
  computed: {
    getYear() {
      return getYearMonDay(this.dataForm.softwareTestOrder.startDate).year
    },
    getMon() {
      return getYearMonDay(this.dataForm.softwareTestOrder.startDate).month
    },
    getDay() {
      return getYearMonDay(this.dataForm.softwareTestOrder.startDate).day
    },
  },
  methods: {
    getYearMonDay,
    handleCellClick(row, column) {
      this.editingCell = {row, column}
      this.$nextTick(() => {
@@ -490,10 +492,11 @@
      console.log(this.editingCell, 'this.editingCell')
    },
    init(data){
      this.dataForm.id = null
      this.dataForm.projectId = data.id
    init(id,row){
      this.dataForm.id = row.id
      this.dataForm.projectId = row.projectId
      this.getInfo()
      console.log(this.dataForm.id,this.dataForm.projectId,'params params')
    },
    // 获取信息
    async getInfo() {
@@ -501,11 +504,15 @@
        orderId: this.dataForm.id,
        projectId: this.dataForm.projectId
      }
      let res = await this.$http.get(`/project/SoftwareTestOrder/getDto`, {params: params})
      if (res.data) {
        this.dataForm = {
          ...res.data
        }
        if(this.dataForm.softwareTestOrder === null){
          this.dataForm.softwareTestOrder={}
        }
      }
      console.log(this.dataForm, "this.dataForm")
    },