jinlin
2024-02-23 1772fc5e211f9e9e0ab4cdc6c29b436aac178c2a
web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue
@@ -92,6 +92,11 @@
                                    v-model="row.files"/>
                  </template>
                </el-table-column>
                <el-table-column v-if="stepMarker=='pzxrk_first'" fixed="right" label="操作" align="center">
                  <template slot-scope="scope">
                    <zt-table-button @click="deleteRow(scope.$index,scope.row.id)">删除</zt-table-button>
                  </template>
                </el-table-column>
              </el-table>
              <div v-if="showAddAndEdit && !dataForm.disabled" class="icon-container">
                <el-dropdown @command="handleCommand">
@@ -248,6 +253,7 @@
  import AddOrUpdateCheck from '../testCheckOrder/TestCheckOrder-AddOrUpdate'
  import qs from "qs";
  import Cookies from "js-cookie";
  import cloneDeep from "lodash/cloneDeep";
  export default {
    data() {
@@ -329,7 +335,7 @@
          console.log(row.libraryType,"row.libraryType")
          this.dataForm.configItemWarehouse.libraryType = row.libraryType
        }
        this.getInfo()
        this.getInfo2()
        if (!this.dataForm.disabled) {
          if (!row.stepMarker) {
            this.stepMarker = 'pzxrk_first'
@@ -372,17 +378,13 @@
        this.$set(row, 'checkId', checkId)
      },
      // 获取信息
      async getInfo() {
      async getInfo2() {
        let params = {
          warehouseId: this.dataForm.id,
          projectId: this.dataForm.projectId,
          libraryType:this.dataForm.configItemWarehouse.libraryType
        }
        let res = await this.$http.get(`/configItemWarehouse/ConfigItemWarehouse/getDto`, {params: params})
        this.dataForm = {
          ...this.dataForm,
          ...res.data
        }
        if (this.dataForm.project === null) {
          this.dataForm.project = {}
        }
@@ -392,7 +394,21 @@
        if (this.dataForm.flowInfoDto === null) {
          this.dataForm.flowInfoDto = {}
        }
        setTimeout(()=>{
          this.dataForm = {
            ...this.dataForm,
            ...res.data
          }
        },100)
        console.log(this.dataForm, "getInfo this.dataForm")
      },
      async deleteRow(index, id){
          if (await this.$tip.confirm(this.$t('prompt.info', {'handle': this.$t('delete')}))) {
            if (id != null) {
            let res = await this.$http.delete('/configItemWarehouse/WarehouseConfigItem/', {data: [id]})
          }
            this.dataForm.configItemList.splice(index, 1)
        }
      },
      async print(){
        var params = qs.stringify({
@@ -404,7 +420,19 @@
      },
      // 表单提交
      async formSubmit(submitType) {
        if (this.showColumn && submitType == 'bl') {
        let isFiles = true;
        let flag = true;
        console.log(this.dataForm, "this.dataForm11111")
        this.dataForm.configItemList.forEach(item => {
          if (parseInt(item.secretClass) > localStorage.getItem('userSecretClass')) {
            this.$alert("当前项目设置的密级高于当前用户的密级,请重新设置")
            flag =false
          }
        })
        if (!flag){
          return
        }
        if (this.showColumn && submitType === 'bl') {
          for (let item of this.dataForm.configItemList) {
            if (item) {
              if (this.pageNameCode[item.itemName] && !item.checkId) {
@@ -414,7 +442,22 @@
            }
          }
        }
        if (submitType == 'tj' || submitType == 'bl') {
        if (submitType === 'tj' || submitType === 'bl') {
          this.dataForm.configItemList.forEach(item => {
            console.log(item, "his.dataForm.technicalList.forEach")
            item.files.groups.forEach(groups => {
              groups.fields.forEach(files => {
                if (files.files.length === 0) {
                  this.$alert("当前存在未上传附件的配置项,请重新上传")
                  isFiles = false
                  return isFiles
                }
              })
            })
          })
          if (!isFiles){
            return
          }
          let flowInfo = {
            flowCode: 'pzxrk',
            stepIdMark: this.stepMarker,