jinlin
2024-02-23 1772fc5e211f9e9e0ab4cdc6c29b436aac178c2a
web/src/views/modules/baselineRelease/BaselineRelease-AddOrUpdate.vue
@@ -1,43 +1,91 @@
<template>
  <zt-dialog ref="dialog" column="2" @confirm="formSubmit" :stepMarker="stepMarker" :append-to-body="true">
    <el-form :model="dataForm" :inline="true" ref="dataForm" style="padding-top: 0" :disabled="dataForm.disabled"
             label-width="120px" class="testCheckFormAuto">
             label-width="120px" class="baselineFormAuto">
      <div>
        <el-form-item label-width="60px" label="编号:" style="width:100%;margin-bottom: -5px">
          <span>{{ dataForm.baseline.code || '编号自动生成' }}</span>
        </el-form-item>
      </div>
      <div style="border: 1px solid rgba(0,0,0,.2);width: 99%">
        <div style="border-bottom: 1px solid rgba(0,0,0,.2);" class="testCheckContentWidth">
          <el-form-item class="marginTopAndMarginBottom" label="项目标识" style="width: 49%">
            <el-input v-model="dataForm.project.softwareIdentity" placeholder="项目标识"></el-input>
          </el-form-item>
          <el-form-item class="marginTopAndMarginBottom" label="项目名称" style="width: 49%">
            <el-input v-model="dataForm.project.softwareName" placeholder="项目名称"></el-input>
          </el-form-item>
        <!--        <div style="border-bottom: 1px solid rgba(0,0,0,.2);" class="baselineContentWidth">-->
        <!--          <el-form-item class="marginTopAndMarginBottom" label="项目标识" style="width: 49%">-->
        <!--            <el-input v-model="dataForm.project.softwareIdentity" placeholder="项目标识"></el-input>-->
        <!--          </el-form-item>-->
        <!--          <el-form-item class="marginTopAndMarginBottom" label="项目名称" style="width: 49%">-->
        <!--            <el-input v-model="dataForm.project.softwareName" placeholder="项目名称"></el-input>-->
        <!--          </el-form-item>-->
        <!--        </div>-->
        <div class="el-flexBaselineDialog el-border-bottom">
          <div style="width: 120px;text-align: center;font-weight: 600">
            项目标识
          </div>
          <div class="el-border-left-right acceptDate1" style="width: 38%;height: 40px;">
            <el-form-item style="width: 100%;padding: 0 5px;margin:0;">
              <el-input v-model="dataForm.project.softwareIdentity" placeholder="项目标识"></el-input>
            </el-form-item>
          </div>
          <div style="width: 120px;text-align: center;font-weight: 600">
            项目名称
          </div>
          <div class="el-border-left acceptDate1" style="width: 38%;height: 40px;">
            <el-form-item style="width: 100%;padding: 0 5px;margin:0;">
              <el-input v-model="dataForm.project.softwareName" placeholder="项目名称"></el-input>
            </el-form-item>
          </div>
        </div>
        <div style="border-bottom: 1px solid rgba(0,0,0,.2);">
          <div style="padding-left:5px;padding-right:5px;">
            <div style="width: 112px;text-align: center;font-weight: 600">基线发布描述</div>
            <div class="table-container">
              <el-form-item class="marginTopAndMarginBottom" label="基线类型" style="width: 49%">
                <zt-dict  v-model="dataForm.baseline.baselineType" placeholder="基线类型" dict="baseline_type"
                          :radio="true"></zt-dict>
              </el-form-item>
              <el-form-item class="marginTopAndMarginBottom" label="基线名称" style="width: 49%">
                <el-input v-model="dataForm.baseline.baselineName" placeholder="基线名称"></el-input>
              </el-form-item>
              <el-form-item class="marginTopAndMarginBottom" label="基线版本" style="width: 49%">
                <el-input v-model="dataForm.baseline.baselineVersion" placeholder="基线版本"></el-input>
              </el-form-item>
          <div style="width: 100%;">
            <div class="DHold" style="border-bottom: 1px solid rgba(0,0,0,.2);height: 40px;line-height: 40px">基线发布描述
            </div>
            <div class="el-flexBaselineDialog el-border-bottom">
              <div class="DWidth DAlign DHold">
                基线类型
              </div>
              <div class="el-border-left" style="width: calc(100% - 120px)">
                <el-form-item style="padding-left:5%;margin-bottom:0">
                  <zt-dict :disabled="stepMarker!=='jxfb_first'" v-model="dataForm.baseline.baselineType" placeholder="基线类型" dict="baseline_type"
                           :radio="true"></zt-dict>
                </el-form-item>
              </div>
            </div>
            <!--              <el-form-item class="marginTopAndMarginBottom" label="基线类型" style="width: 49%">-->
            <!--                <zt-dict  v-model="dataForm.baseline.baselineType" placeholder="基线类型" dict="baseline_type"-->
            <!--                          :radio="true"></zt-dict>-->
            <!--              </el-form-item>-->
            <div class="el-flexBaselineDialog el-border-bottom">
              <div class="DWidth DAlign DHold">
                基线名称
              </div>
              <div class="el-border-left acceptDate1" style="width: calc(100% - 120px)">
                <el-form-item style="width: 100%;margin-bottom:0">
                  <span>{{dataForm.baseline.baselineName}}</span>
                </el-form-item>
              </div>
            </div>
            <!--              <el-form-item class="marginTopAndMarginBottom" label="基线名称" style="width: 49%">-->
            <!--                <el-input v-model="dataForm.baseline.baselineName" placeholder="基线名称"></el-input>-->
            <!--              </el-form-item>-->
            <div class="el-flexBaselineDialog">
              <div class="DWidth DAlign DHold">
                基线版本
              </div>
              <div class="el-border-left acceptDate1" style="width: calc(100% - 120px)">
                <el-form-item style="width: 100%;margin-bottom:0">
                  <el-input :disabled="stepMarker!=='jxfb_first'" v-model="dataForm.baseline.baselineVersion" placeholder="基线版本"></el-input>
                </el-form-item>
              </div>
            </div>
            <!--              <el-form-item class="marginTopAndMarginBottom" label="基线版本" style="width: 49%">-->
            <!--                <el-input v-model="dataForm.baseline.baselineVersion" placeholder="基线版本"></el-input>-->
            <!--              </el-form-item>-->
          </div>
        </div>
        <div class="el-flexCirculationDialog el-border-bottom">
          <div style="width: 112px;text-align: center;font-weight: 600">
        <div class="el-flexBaselineDialog el-border-bottom">
          <div style="width: 120px;text-align: center;font-weight: 600">
            备注
          </div>
          <div class="el-border-left acceptDate" style="height: 80px;width: 80%;">
          <div class="el-border-left acceptDate" style="width: calc(100% - 120px);">
            <div class="table-container">
              <el-table ref="tableCirculatOrderList" class="el-software el-margin-top-bot" border
                        :data="dataForm.remarkList"
@@ -49,54 +97,65 @@
                </el-table-column>
                <el-table-column prop="itemName" min-width="180" label="配置项名称">
                </el-table-column>
                <el-table-column v-if="stepMarker=='jxfb_bmsp'" label="操作" width="120" align="center">
                  <template v-slot="{ row }">
                    <zt-table-button size="small" v-show="isPreview(row)" type="primary"
                                     @click="preview(row)">预览
                    </zt-table-button>
                    <zt-table-button size="small" v-show="isDownload(row)" type="primary"
                                     @click="download(row)">下载
                    </zt-table-button>
                  </template>
                </el-table-column>
              </el-table>
              <div v-if="!dataForm.disabled"  class="icon-container" @click="handleCommand">
              <div :disabled="stepMarker!=='jxfb_first'" v-if="!dataForm.disabled" class="icon-container"
                   @click="handleCommand">
                <!-- 放置固定的图标 -->
                <i class="el-icon-plus"></i>
              </div>
            </div>
          </div>
        </div>
        <div class="el-flexCirculationDialog">
          <div style="width: 112px;text-align: center;font-weight: 600">
        <div class="el-flexBaselineDialog el-border-bottom">
          <div style="width: 120px;text-align: center;font-weight: 600">
            发布人
          </div>
          <div class="el-border-left-right acceptDate1" style="width: 40%;height: 40px;">
          <div class="el-border-left-right acceptDate1" style="width: 38%;height: 40px;">
            <el-form-item style="width: 100%;padding-left:20px;margin:0;">
              <span>{{ dataForm.baseline.publisher}}</span>
            </el-form-item>
          </div>
          <div style="width: 112px;text-align: center;font-weight: 600">
          <div style="width: 120px;text-align: center;font-weight: 600">
            发布时间
          </div>
          <div class="el-border-left-right acceptDate1" style="width: 40%;height: 40px;">
          <div class="el-border-left acceptDate1" style="width: 38%;height: 40px;">
            <el-form-item style="width: 100%;padding-left:20px;margin:0;">
              <span>{{ dataForm.baseline.publishDate}}</span>
            </el-form-item>
          </div>
          <div style="width: 84px;text-align: center;font-weight: 600">
           基线批准
        </div>
        <div class="DHold" style="border-bottom: 1px solid rgba(0,0,0,.2);height: 40px;line-height: 40px">基线批准</div>
        <div class="el-flexBaselineDialog el-border-bottom">
          <div class="DWidth DAlign DHold">
            部门意见
          </div>
          <div class="el-configChangeDialog el-border-bottom">
            <div class="DFormWidth DAlign DHold">
              部门意见
            </div>
            <div style="width: calc(100% - 120px)" class="el-border-left">
              <el-form-item class="el-wt-form-item-margin" label-width="20px" style="width: 85%">
                <el-input :disabled="stepMarker!=='pzxbg_bmsh'" v-model="dataForm.baseline.departOpinion"></el-input>
              </el-form-item>
              <el-form-item label-width="80%" label="签字:" style="width: 65%">
                <span>{{dataForm.baseline.departSign}}</span>
              </el-form-item>
              <el-form-item label="日期:" style="width: 20%">
                <span>{{dataForm.baseline.signDate}}</span>
              </el-form-item>
            </div>
          <div style="width: calc(100% - 120px)" class="el-border-left">
            <el-form-item class="wt-form-item" label-width="20px" style="width: 100%;padding: 5px">
              <el-input type="textarea" :rows="2" :disabled="stepMarker!=='jxfb_bmsp'"
                        v-model="dataForm.baseline.departOpinion"></el-input>
            </el-form-item>
            <el-form-item label-width="275px" label="签字:" style="width: 45%">
              <span>{{dataForm.baseline.departSign}}</span>
            </el-form-item>
            <el-form-item label-width="240px" label="日期:" style="width: 45%">
              <span>{{dataForm.baseline.signDate}}</span>
            </el-form-item>
          </div>
        </div>
      </div>
    </el-form>
    <ConfigItemList ref="configItemList" @getChangeItemList="getChangeItemList"></ConfigItemList>
    <Preview ref="view" :pageMarkerfun="BaselineRelease"></Preview>
    <template v-slot:footer>
      <el-button v-if="dataForm.disabled" type="primary" @click="print()">打印</el-button>
    </template>
@@ -110,17 +169,22 @@
  import Cookies from "js-cookie";
  import ConfigItemList from '../configItemChange/configItemList.vue'
  import AddOrUpdateCheck from "../testCheckOrder/TestCheckOrder-AddOrUpdate";
  import Preview from "@/views/pages/view.vue";
  export default {
    data() {
      return {
        BaselineRelease: 'BaselineRelease',
        ids: '',
        stepMarker: '',
        pageName: {
          demand: '需求基线', product: '产品基线'
        },
        pageCode: '',
        dataForm: {
          id: '',
          pageCode: '',
          stepMarker: '',
          pageName: {
            demand: '需求基线', product:'产品基线'
          },
          projectId: '',
          remarkList: [],
          baseline: {
            code: '',
            baselineType: '',
@@ -136,17 +200,17 @@
          project: {
            softwareIdentity: '',
            softwareName: ''
          },
          remarkList: []
          }
        }
      }
    },
    components: {
      Preview,
      ConfigItemList
    },
    methods: {
      init(id, row) {
         if (id) {
        if (id) {
          this.dataForm.id = id
        } else {
          this.dataForm.id = row.id
@@ -155,16 +219,15 @@
        if (row.projectId) {
          this.dataForm.projectId = row.projectId
        }
    /*    if (this.configDetailRow) {
        if (!this.dataForm.disabled) {
          if (!row.stepMarker) {
            this.stepMarker = 'csjcd_first'
            this.title = '发起测试检查单'
            this.stepMarker = 'jxfb_first'
            this.title = '基线发布申请'
          } else {
            this.title = row.stepName
            this.stepMarker = row.stepMarker
          }
        }*/
        //this.dataForm.disabled
        }
        this.getInfo()
        //console.log(this.dataForm.id, this.dataForm.projectId, this.stepMarker, 'this.dataForm.id, this.dataForm.projectId,this.stepMarker')
@@ -172,11 +235,51 @@
      indexFormat(index) {
        return index += 1
      },
      isPreview(row) {
        if (row.files!=null) {
          if (row.files.groups[0].fields[0].files[0]) {
            let fileName = row.files.groups[0].fields[0].files[0].name
            let suffixName = ''
            if (fileName != null) {
              let arr = fileName.split('.')
              suffixName = arr[arr.length - 1].toLowerCase()
            }
            if (suffixName == 'pdf' || suffixName == 'doc' || suffixName == 'docx' || suffixName == 'jpg' || suffixName == 'jpeg' || suffixName == 'png' || suffixName == 'xls' || suffixName == 'xlsx') {
              return true
            } else {
              return false
            }
          } else {
            return false
          }
        }
      },
      isDownload(row) {
        if (row.files!=null) {
          if (row.files.groups[0].fields[0].files[0]) {
            return true
          } else {
            return false
          }
        }
      },
      preview(row) {
        this.$refs.view.openAccessoryFormatByForm(row)
      },
      download(row) {
        if (row.files!=null) {
          if (row.files.groups[0].fields[0].files[0]) {
            let url = row.files.groups[0].fields[0].files[0].url;
            window.location.href = `${url}`
          }
        }
      },
      handleCommand() {
        this.$nextTick(()=>{
          console.log(this.dataForm.projectId,'this.dataForm.projectId')
          this.ids = this.dataForm.configChangeList.map(item=>item.selectId).join(',')
          this.$refs.configItemList.$refs.dialog.init(this.dataForm.projectId,this.ids)
        this.$nextTick(() => {
          this.ids = this.dataForm.remarkList.map(item => item.selectId).join(',')
          console.log(this.ids, 'handleCommand ids')
          console.log(this.pageCode, 'handleCommand this.pageCode')
          this.$refs.configItemList.$refs.dialog.init(this.dataForm.projectId,{ids:this.ids,pageCode:this.pageCode})
        })
      },
      // 获取信息
@@ -192,14 +295,15 @@
          ...this.dataForm,
          ...res.data
        }
        this.dataForm.baseline.baselineName = this.pageName[this.pageCode]
        console.log(this.dataForm, 'this.dataForm this.dataForm')
      },
      getChangeItemList(data){
        console.log(data.configChangeList,'getChangeItemList(data)')
        if(data.configChangeList){
          this.dataForm.configChangeList=this.dataForm.configChangeList.concat(data.configChangeList)
      getChangeItemList(data) {
        console.log(data.remarkList, 'getChangeItemList(data)')
        if (data.remarkList) {
          this.dataForm.remarkList = this.dataForm.remarkList.concat(data.remarkList)
        }
        console.log(this.dataForm.configChangeList,ids,'this.dataForm.configChangeList')
        console.log(this.dataForm.remarkList, 'this.dataForm.configChangeList')
      },
      async print() {
        var params = qs.stringify({
@@ -207,12 +311,12 @@
          id: this.dataForm.id,
          pageCode: this.pageCode
        })
        let apiURL = `/baselineRelease/BaselineRelease/exportbaseline`
        let apiURL = `/baselineRelease/BaselineRelease/exportBaseline`
        window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
      },
      // 表单提交
      async formSubmit(submitType) {
        if (submitType == 'tj' || submitType == 'bl' ) {
        if (submitType == 'tj' || submitType == 'bl') {
          let flowInfo = {
            flowCode: 'jxfb',
            stepIdMark: this.stepMarker,
@@ -231,3 +335,56 @@
    }
  }
</script>
<style>
  .el-flexBaselineDialog {
    display: flex;
    align-items: center
  }
  .DWidth {
    width: 120px;
  }
  .baselineFormAuto .acceptDate > .el-form-item > .el-form-item__content {
    width: 100%;
  }
  .baselineFormAuto .acceptDate1 > .el-form-item > .el-form-item__content {
    width: 100%;
  }
  .baselineFormAuto .marginTopAndMarginBottom {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
  }
  .baselineFormAuto .marginTopAndMarginBottom2 {
    margin-top: -10px !important;
    margin-bottom: 10px !important;
  }
  .baselineFormAuto .marginTopAndMarginBottom3 {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
  }
  .baselineFormAuto .acceptDate > .el-form-item > .el-form-item__content {
    line-height: 78px;
  }
  .baselineContentWidth > .el-form-item > .el-form-item__content {
    width: calc(100% - 120px);
  }
  .baselineFormAuto .el-radio {
    margin-right: 10px;
  }
  .wt-form-item .el-form-item__content {
    width: 100%;
  }
  .DHold {
    font-weight: 600;
  }
</style>