Browse Source

上传下载边界修改

zishan-an 11 months ago
parent
commit
4796ae11ad

+ 12 - 2
src/api/index.js

@@ -441,6 +441,8 @@ export function fieldEdit(fieldData) {
         id : fieldData.id,
         fieldNo : fieldData.fieldNo,
         nameZh : fieldData.nameZh,
+        name : fieldData.name,
+
         type : fieldData.type,
         fetchLogic : fieldData.fetchLogic,
 
@@ -459,6 +461,14 @@ export function fieldTemplateEdit(templateData) {
         fieldDeriveSelectedOld:templateData.fieldDeriveSelectedOld,
 
 
+    });
+}
+export function fieldTemplateStatus(templateData) {
+    return request.post('/fieldtemplate/status', {
+        id : templateData.templateId,
+        status : templateData.status,
+
+
     });
 }
 
@@ -483,11 +493,11 @@ export function cooperatorAdd(cooperator_name, corpCertificateNum, corp_certific
     });
 }
 
-export function cooperatorEdit(cooperator_id, cooperator_name, cooperatorNum, corp_certificate_type,fieldTemplateId) {
+export function cooperatorEdit(cooperator_id, cooperator_name, corp_certificate_num, corp_certificate_type,fieldTemplateId) {
     return request.post('/cooperator/edit', {
         cooperator_id : cooperator_id, 
         cooperator_name : cooperator_name,
-        cooperatorNum : cooperatorNum,
+        corp_certificate_num : corp_certificate_num,
         corp_certificate_type : corp_certificate_type,
         fieldTemplateId:fieldTemplateId
     });

+ 49 - 37
src/views/system/businessInfo.vue

@@ -222,6 +222,8 @@
               <el-upload ref="upfile"
                          style="display: inline"
                          :auto-upload="false"
+
+                         :limit="1"
                          :on-change="handleChange"
                          :file-list="fileList"
                          action="#">
@@ -284,7 +286,7 @@
         reportFileData1 : [],
         reportFileData2 : [],
         file_model:["解析文件","模型文件"],
-        model_type:"",
+        model_type:"解析文件",
         file_name:"",
         fileNameModel:"",
         fileNameXml:"",
@@ -343,15 +345,17 @@
             for (let item of this.reportFileData){
               if(item.fileNameXml){
                 this.reportFileData1.push(item)
-                if(item.fileNameTxt) {
-                  let litem = {
-                    id:item.id,
-                    fileNameXml:item.fileNameTxt,
-                    updateTime:item.updateTime
-                  }
-                  this.reportFileData1.push(litem)
+
+              }
+              if(item.fileNameTxt) {
+                let litem = {
+                  id:item.id,
+                  fileNameXml:item.fileNameTxt,
+                  updateTime:item.updateTime
                 }
-              }if(item.fileNameModel){
+                this.reportFileData1.push(litem)
+              }
+              if(item.fileNameModel){
                 let aitem = {
                   id:item.id,
                   fileNameXml:item.fileNameModel,
@@ -558,12 +562,19 @@
           fd.append("files",item.raw);
           if(this.model_type == "模型文件"){
             this.fileNameModel = "1"
-          }else if(item.raw.name.toString().endsWith("txt")){
+          }
+          if(item.raw.name.toString().endsWith("txt")){
             this.fileNameTxt = "1"
           }
-          else {
+          else if(item.raw.name.toString().endsWith("xml")){
             this.fileNameXml = "1"
           }
+          else {
+            {
+              this.$alert("请上传正确的文件类型");
+              return;
+            }
+          }
           request.post('/report/fileReportAdd',{
             file_name : item.raw.name,
             fileModel:this.fileNameModel,
@@ -577,33 +588,34 @@
           console.log("模型类")
   
           console.log(this.fileNameModel)
-        })
-        if(this.model_type == "模型文件") {
-          request.post('/up/uploadMod', fd).then(res => {
-          })
-              .catch(err => {
-                this.$message.error(err.message)
-                // console.log(err)
-              })
-        }
-        else {
-          request.post('/up/uploadUi', fd).then(res => {
-          })
-              .catch(err => {
-                this.$message.error(err.message)
-                // console.log(err)
-              })
-        }
-        this.add_file_show=false;
-        setTimeout(() => {
-          this.$message({
-            message: '文件上传成功',
-            type: 'success'
-          });
+          if(this.model_type == "模型文件") {
+            request.post('/up/uploadMod', fd).then(res => {
+            })
+                .catch(err => {
+                  this.$message.error(err.message)
+                  // console.log(err)
+                })
+          }
+          else {
+            request.post('/up/uploadUi', fd).then(res => {
+            })
+                .catch(err => {
+                  this.$message.error(err.message)
+                  // console.log(err)
+                })
+          }
+          this.add_file_show=false;
           setTimeout(() => {
-            location.reload();
-          }, 1000);
-        }, 100);
+            this.$message({
+              message: '文件上传成功',
+              type: 'success'
+            });
+            setTimeout(() => {
+              location.reload();
+            }, 1000);
+          }, 100);
+        })
+
       },
       fileDelete: function (row,type){
         console.log("asssssdfas")

+ 2 - 2
src/views/system/cooperatorEdit.vue

@@ -120,7 +120,7 @@ export default {
         }
       ],
       cooperator_name : this.$route.query.cooperatorName,
-      corp_certificate_num : this.$route.query.cooperatorNum,
+      corp_certificate_num : this.$route.query.corpCertificateNum,
       corp_certificate_type_name : "",
       corp_certificate_type : "",
       fieldTemplateList : "",
@@ -262,7 +262,7 @@ export default {
         this.$alert("请输入合作方名称");
         return;
       }
-      if(this.cooperatorNum=="")
+      if(this.corpCertificateNum=="")
       {
         this.$alert("请输入证件号码");
         return;

+ 1 - 1
src/views/system/cooperatorProductInfoBase.vue

@@ -166,7 +166,7 @@ import { Row } from 'element-ui';
       gotolink2()
       {
         //指定跳转地址
-        this.$router.push('/cooperatorInfo');
+        this.$router.push('/cooperatorProductInfo');
         this.selected1 = false;
         this.selected2 = true;
         this.selected3 = false;

+ 14 - 1
src/views/system/fieldAdd.vue

@@ -34,7 +34,9 @@
                 <el-form-item label="字段名称" width="100px">
                   <el-input v-model="nameZh" style="width:400px"></el-input>
                 </el-form-item>
-
+                <el-form-item label="字段英文名称" width="100px">
+                  <el-input v-model="name" style="width:400px"></el-input>
+                </el-form-item>
                 <el-form-item label="字段类型" width="100px">
                   <el-input v-model="type" style="width:400px"></el-input>
                 </el-form-item>
@@ -99,6 +101,8 @@ export default {
       id:'',
       fieldNo:'',
       nameZh:'',
+      name:'',
+
       type:'',
       fetchLogic:'',
       // createBy:'',
@@ -108,6 +112,8 @@ export default {
             id:'',
             fieldNo:'',
             nameZh:'',
+            name:'',
+
             type:'',
             fetchLogic:'',
             // createBy:'',
@@ -188,6 +194,8 @@ export default {
       this.fieldData.id = this.id;
       this.fieldData.fieldNo = this.fieldNo;
       this.fieldData.nameZh = this.nameZh;
+      this.fieldData.name = this.name;
+
       this.fieldData.type = this.type;
       this.fieldData.fetchLogic = this.fetchLogic;
       // this.fieldData.createBy = this.createBy;
@@ -197,6 +205,11 @@ export default {
         this.$alert("请输入字段名称");
         return;
       }
+      if(this.name=="")
+      {
+        this.$alert("请输入字段英文名称");
+        return;
+      }
       if(this.type=="")
       {
         this.$alert("请输入字段类型");

+ 2 - 0
src/views/system/fieldDerive.vue

@@ -360,6 +360,8 @@ export default {
           'fieldId' : row.id,
           'fieldNo' : row.fieldNo,
           'nameZh' : row.nameZh,
+          'name' : row.name,
+
           'type': row.type,
           'fetchLogic': row.fetchLogic,
 

+ 11 - 0
src/views/system/fieldEdit.vue

@@ -38,6 +38,9 @@
             <el-form-item label="字段名称" width="100px">
               <el-input v-model="nameZh" style="width:400px"></el-input>
             </el-form-item>
+            <el-form-item label="字段英文名称" width="100px">
+              <el-input :disabled = "true" v-model="name" style="width:400px"></el-input>
+            </el-form-item>
             <el-form-item label="字段类型" width="100px">
               <el-input v-model="type" style="width:400px"></el-input>
             </el-form-item>
@@ -106,6 +109,8 @@ export default {
       fieldId:this.$route.query.fieldId,
       fieldNo:this.$route.query.fieldNo,
       nameZh:this.$route.query.nameZh,
+      name:this.$route.query.name,
+
       type:this.$route.query.type,
       fetchLogic:this.$route.query.fetchLogic,
       // createBy:'',
@@ -115,6 +120,8 @@ export default {
             id:this.$route.query.fieldId,
             fieldNo:this.$route.query.fieldNo,
             nameZh:this.$route.query.nameZh,
+            name:this.$route.query.name,
+
             type:this.$route.query.type,
             fetchLogic:this.$route.query.fetchLogic,
             // createBy:'',
@@ -222,6 +229,10 @@ export default {
         this.$alert("提取逻辑为1-直接提取;2-算法实现;3-复杂计算,请输入相应数字");
         return;
       }
+      this.$message({
+        message: '编辑成功',
+        type: 'success'
+      });
       fieldEdit(this.fieldData).then(
           res=>
           {

+ 76 - 3
src/views/system/fieldTemplate.vue

@@ -56,8 +56,19 @@
               <el-table-column align="center" label="字段表状态">
                 <template v-slot="{row}">
 
-                  <span>{{ row.state ? '已启用' : '已停用' }}</span>
+                <el-switch
+                    v-model="row.status"
+                    class="isShow"
+                    :active-value="'1'"
+                    :inactive-value="'0'"
+                    active-text="启用"
+                    inactive-text="停用"
+                    active-color="#13ce66"
+                    inactive-color="#ff4949"
+                    @change="changeSwitch(row)">
+                </el-switch>
                 </template>
+
               </el-table-column>
 
                   <el-table-column align="center" label="创建者" >
@@ -107,7 +118,7 @@
 
 import {
   getList,
-  userInfo, partnerList, templateDel,selectTemplate
+  userInfo, partnerList, templateDel, selectTemplate, fieldTemplateEdit,fieldTemplateStatus
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -150,7 +161,16 @@ export default {
       isRouterAlive:true,
       totalSize:'',
       showSize:'',
+      templateStatus:
+          {
+            templateId:"",
+            status:"",
 
+
+            // status:this.$route.query.status,
+            // createBy:'',
+            // createTime:'',
+          },
     }
   },
   watch: {},
@@ -165,13 +185,15 @@ export default {
     fieldTemplateList(this.currentPage1,this.pagesize1).then(
         res=>
         {
-          console.log(this.currentPage1)
 
           this.templateData=res.data.field_template_list.list;
           this.templateDataShow = this.templateData
           var j = parseInt(res.data.field_template_list.total)
           this.totalSize = j
           this.showSize = this.totalSize
+          console.log("啊各位")
+
+          console.log(this.templateDataShow)
 
         }
     )
@@ -255,6 +277,33 @@ export default {
       this.selected5 = true;
       this.selected6 = true;
     },
+    changeSwitch (row) {
+      this.templateStatus.templateId = row.id;
+      this.templateStatus.status = row.status;
+
+      fieldTemplateStatus(this.templateStatus).then(
+          res=>
+          {
+            this.$message({
+              message: '修改成功',
+              type: 'success'
+            });
+            this.$router.push({
+              path: '/fieldTemplate',
+              query: {
+              }
+            })
+          },
+      ),
+      axios.post(this.$api.customerQaUpdate,data).then(res=>{
+        if(res.code=='200'){
+          this.successMessage('操作成功');
+        }else{
+          this.errorMessage(res.message);
+        }
+      }).catch(err=>{})
+      console.log(data)
+    },
 
     fieldTemplateEdit(row) {
       this.$router.push({
@@ -467,5 +516,29 @@ export default {
   height: 47em;
   margin-left: 20px;
 }
+.isShow .el-switch__label {
+  position: absolute;
+  display: none;
+  color: #fff;
+}
+/*打开时文字位置设置*/
+.isShow .el-switch__label--right {
+  z-index: 1;
+  right: 8px;
+}
+/*关闭时文字位置设置*/
+.isShow .el-switch__label--left {
+  z-index: 1;
+  left: 8px;
+}
+/*显示文字*/
+.isShow .el-switch__label.is-active {
+  display: block;
+}
+.isShow.el-switch .el-switch__core,
+.el-switch .el-switch__label {
+  width: 50px !important;
+}
+
 .container {  }
 </style>

+ 1 - 0
src/views/system/fieldTemplateEdit.vue

@@ -37,6 +37,7 @@
             <el-form-item label="模板名称" width="100px">
               <el-input v-model="templateName" style="width:400px"></el-input>
             </el-form-item>
+
 <!--            <el-form-item label="模板类型" width="100px">-->
 <!--              <el-input v-model="status" style="width:400px"></el-input>-->
 <!--            </el-form-item>-->