jinlin
2023-11-15 43094c8793de5af81904eb49eebacfb76e209fe3
web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue
@@ -102,15 +102,19 @@
                    被测件及其他相关物品清单
                  </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 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>
@@ -184,15 +188,7 @@
                  </div>
                  <div class="el-border-left" style="width: 98%">
                    <el-form-item style="width: 20%;padding-left:5%;margin-bottom: 0">
                      <zt-dict v-model="dataForm.softwareTestOrder.testStandard" :radio="true"
                               dict="test_standard"></zt-dict>
                      <!--                      <el-checkbox-group v-model="dataForm.checkList">-->
                      <!--                        <el-checkbox :label="0">GJB 438B-2009《军用软件开发文档通用要求》</el-checkbox>-->
                      <!--                        <el-checkbox :label="1">HJB 754-2017 《海军军用软件定型测评大纲编制要求》</el-checkbox>-->
                      <!--                        <el-checkbox :label="2">HJB 753-2017 《海军军用软件定型测评报告编制要求》</el-checkbox>-->
                      <!--                        <el-checkbox :label="3">《海军装备软件测试细则》</el-checkbox>-->
                      <!--                        <el-checkbox :label="4">其他:{{dataForm.other}}</el-checkbox>-->
                      <!--                      </el-checkbox-group>-->
                      <zt-dict v-model="dataForm.softwareTestOrder.testStandard" :radio="true" dict="test_standard"></zt-dict>
                    </el-form-item>
                  </div>
                </div>
@@ -203,10 +199,6 @@
                  <div class="el-border-left" style="width: 98%">
                    <el-form-item style="padding-left:5%;margin-bottom:0">
                      <zt-dict v-model="dataForm.project.testLevel" :radio="true" dict="test_level"></zt-dict>
                      <!--                      <el-checkbox-group v-model="dataForm.checkList">-->
                      <!--                        <el-checkbox :label="0">配置项测试</el-checkbox>-->
                      <!--                        <el-checkbox :label="1">系统测试</el-checkbox>-->
                      <!--                      </el-checkbox-group>-->
                    </el-form-item>
                  </div>
                </div>
@@ -277,7 +269,6 @@
                测试信息
              </div>
              <div class="DOldForm el-border-left">
                <!-- 单位名称 -->
                <el-form-item class="marginTopAndMarginBottom" label="测试日期" style="width: 49%">
                  <el-date-picker
                      v-model="dataForm.softwareTestOrder.testDate"
@@ -285,7 +276,6 @@
                      placeholder="测试日期">
                  </el-date-picker>
                </el-form-item>
                <!-- 联系人 -->
                <el-form-item class="marginTopAndMarginBottom" label="交付日期" style="width: 49%">
                  <el-date-picker
                      v-model="dataForm.softwareTestOrder.deliveryDate"
@@ -293,22 +283,12 @@
                      placeholder="交付日期">
                  </el-date-picker>
                </el-form-item>
                <!-- 详细地址 -->
                <el-form-item label="检测费用" style="width: 98%">
                  <el-input v-model="dataForm.softwareTestOrder.testCost" placeholder="请输入检测费用"></el-input>
                </el-form-item>
                <!--          <zt-form-item label="保密级别" prop="secretClass"  style="width: 25%">-->
                <!--            <zt-dict v-model="datadataForm.secretClass" dict="secret_class" placeholder="保密级别" style="width:200px"></zt-dict>-->
                <!--          </zt-form-item>-->
                <!-- 联系方式 -->
                <el-form-item class="el-border-bottom marginTopAndMarginBottom2" label="物品性质" style="width: 100%">
                  <zt-dict v-model="dataForm.softwareTestOrder.articleNature" :radio="true"
                           dict="article_nature"></zt-dict>
                  <!--                  <el-radio-group v-model="dataForm.criticalLevel">-->
                  <!--                    <el-radio :label="0">现场检测</el-radio>-->
                  <!--                    <el-radio :label="1">客户送样</el-radio>-->
                  <!--                    <el-radio :label="2">其他:{{dataForm.other}}</el-radio>-->
                  <!--                  </el-radio-group>-->
                </el-form-item>
                <div class="el-flex el-border-bottom" style="margin-top: -10px;">
                  <div class="DWidth DAlign DHold">
@@ -318,10 +298,6 @@
                    <el-form-item label="是否满足测试要求:" label-width="160px" style="margin-bottom: 0">
                      <zt-dict v-model="dataForm.softwareTestOrder.sampleStatus" :radio="true"
                               dict="is_satisfy"></zt-dict>
                      <!--                      <el-radio-group v-model="dataForm.checkList">-->
                      <!--                        <el-radio :label="0">是</el-radio>-->
                      <!--                        <el-radio :label="1">否</el-radio>-->
                      <!--                      </el-radio-group>-->
                    </el-form-item>
                  </div>
                </div>
@@ -330,10 +306,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="100" 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>
@@ -350,7 +326,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,14 +396,14 @@
    </el-form>
    <template v-slot:footer>
      <el-button perm="project:view" type="primary">打印</el-button>
      <el-button v-if="dataForm.disabled" type="primary" @click="print()">打印</el-button>
    </template>
  </zt-dialog>
</template>
<script>
import {getYearMonDay} from '@/commonJS/common'
  import Cookies from 'js-cookie'
  import qs from 'qs'
export default {
  data() {
    return {
@@ -435,8 +411,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: '',
@@ -461,25 +453,22 @@
          testLevel: '',
        },
        softwareTestOrder: {},
        softwareTestOrderDeliverableList: [],
        softwareTestOrderMeasuredList: [],
        testAgencyInfo: {
          agencyName:'',
          site:'',
          businContact:'',
          businComplaint:'',
          laborContact:'',
          labContactNum:'',
          postalCode:'',
          fax:''
        },
        deliverableList: [],
        measuredList: [],
      }
    }
  },
  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 +479,12 @@
      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.dataForm.disabled
      this.getInfo()
      console.log(this.dataForm.id,this.dataForm.projectId,'params params')
    },
    // 获取信息
    async getInfo() {
@@ -501,23 +492,52 @@
        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(){
      var params = qs.stringify({
        token: Cookies.get('token'),
        id:this.dataForm.id
      })
      let apiURL = `/project/SoftwareTestOrder/exportWord/`
      window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
    },
    // 表单提交
    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(',')
      }
    }
  }
@@ -531,6 +551,7 @@
.weiTuoDanAuto .el-radio {
  padding: 5px;
  margin-right: 10px;
}
.zt .weiTuoDanAuto .el-form-item.el-form-item--default {
@@ -612,7 +633,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);
}