Bläddra i källkod

Merge branch 'master' of http://219.151.181.73:3000/web/saber

duy 1 vecka sedan
förälder
incheckning
04cc800c9f
1 ändrade filer med 13 tillägg och 127 borttagningar
  1. 13 127
      src/views/certificate/lists/addList.vue

+ 13 - 127
src/views/certificate/lists/addList.vue

@@ -255,13 +255,6 @@
         v-throttle='2000'
         @click="savess()"
       >保存</el-button>
-      <el-button
-        class="marleft30"
-        type="warning"
-        v-if="fromId!=0"
-      
-        @click="nextClick()"
-      >下一个</el-button>
     </div>
   </basic-container>
 </template>
@@ -269,11 +262,6 @@
 <script>
 import { save, getById, findUserByName, queryRole, queryProjectAndContract, addFileInfo, update, findPfxType, picPresave, prePicture, compressAndUpload } from "@/api/certificate/list";
 import {getDictionary as getDictbiz} from "@/api/system/dictbiz";
-import {
-
-  listpage,
-
-} from "@/api/certificate/list";
 export default {
   data () {
     return {
@@ -317,12 +305,6 @@ export default {
       pfxType: [],//
       options:[],
       signatureId: '',
-      fromId: '',
-      tableData:[],
-      pageindex: 1,
-      total: 0,
-      currentPage:1
-
     }
   },
   methods: {
@@ -370,27 +352,17 @@ export default {
       this.updateDependentFieldValidation()
     },
     async init () {
-      this.fromId = this.$route.query.id;
+
       if (this.$route.query.id != 0) {
-        await this.getById(this.fromId)
+        await this.getById()
       }
       this.queryProjectAndContract()//获取项目和合同段
 
     },
     //#region
-   cancel() {
-    const { value, certificateTypeValue, searchinput, pageindex, pagesize } = this.$route.query;
-    this.$router.push({
-      path: '/certificate/list',
-      query: {
-        value,
-        certificateTypeValue,
-        searchinput,
-        pageindex,
-        pagesize
-      }
-    });
-  },
+    cancel () {//取消按钮
+      this.$router.push('/certificate/list')
+    },
     savess () {//保存按钮
       this.$refs.form.validate(async valid => {
         if (valid) {
@@ -538,8 +510,8 @@ export default {
     //#endregion
 
     //#region //接口
-    async getById (id) {//获取详细信息
-      const { data: res } = await getById({ id: id })
+    async getById () {//获取详细信息
+      const { data: res } = await getById({ id: this.$route.query.id })
       console.log(res);
       if (res.code == 200) {
         this.form = res.data
@@ -572,16 +544,12 @@ export default {
           message: '新增电签成功!'
         })
         // this.$router.push('/certificate/list')
-       this.$router.push({
+        this.$router.push({
           path: '/certificate/list',
           query: {
-            value: this.$route.query.value,
-            certificateTypeValue: this.$route.query.certificateTypeValue,
-            searchinput: this.$route.query.searchinput,
-            pageindex: this.$route.query.pageindex,
-            pagesize: this.$route.query.pagesize
+            value:this.$route.query.value
           }
-        });
+        })
       }
     },
     async findUserByName () { //关联用户
@@ -638,16 +606,12 @@ export default {
           message: '修改电签成功!'
         })
         // this.$router.push('/certificate/list')
-         this.$router.push({
+        this.$router.push({
           path: '/certificate/list',
           query: {
-            value: this.$route.query.value,
-            certificateTypeValue: this.$route.query.certificateTypeValue,
-            searchinput: this.$route.query.searchinput,
-            pageindex: this.$route.query.pageindex,
-            pagesize: this.$route.query.pagesize
+            value:this.$route.query.value
           }
-        });
+        })
       }
     },
     //#endregion
@@ -726,83 +690,6 @@ export default {
       return data.preUrl
     },
     stopClick() {},
-   async nextClick() {
-        let nextId = this.$route.query.nextId;
-        
-        // 处理需要加载下一页的情况
-        if (nextId === 'nextPage') {
-          nextId = await this.getNextPageData();
-        }
-        
-        if (nextId) {
-          // 获取下一条记录的详细信息
-          await this.getById(nextId);
-          
-          // 更新当前ID和下一条ID参数
-          const currentIndex = this.tableData.findIndex(row => row.id === nextId);
-          let newNextId = null;
-          
-          if (currentIndex === this.tableData.length - 1) {
-            newNextId = 'nextPage';
-          } else {
-            const nextRow = this.tableData[currentIndex + 1];
-            newNextId = nextRow ? nextRow.id : null;
-          }
-          
-          // 更新URL中的参数,保持浏览器历史正确
-        
-      this.$router.replace({
-        query: {
-          ...this.$route.query,
-          id: nextId,
-          nextId: newNextId,
-          pageindex: nextId === 'nextPage'?this.currentPage+1:this.currentPage, // 更新当前页码
-        }
-      });
-        } else {
-          this.$message({
-            type: 'info',
-            message: '已经是最后一条记录'
-          });
-        }
-    },
-    // 在编辑页添加获取列表数据的方法,用于计算下一条
-  async getTableData() {
-      const { data: res } = await listpage({
-        current: this.$route.query.pageindex || 1,
-        size: this.$route.query.pagesize || 20,
-        projectId: this.$route.query.value,
-        certificateUserName: this.$route.query.searchinput,
-        certificateType: this.$route.query.certificateTypeValue,
-      });
-      
-      if (res.code === 200) {
-        this.tableData = res.data.records;
-        this.total = res.data.total;
-        this.currentPage = res.data.current;
-      }
-  },
-    async getNextPageData() {
-    // 从路由参数中获取当前分页信息
-    const currentPage = Number(this.$route.query.pageindex) || 1;
-    const pageSize = Number(this.$route.query.pagesize) || 20;
-    console.log(currentPage,'currentPage');
-    
-    // 调用列表接口查询下一页数据
-    const { data: res } = await listpage({
-      current: currentPage + 1, // 下一页
-      size: pageSize,
-      projectId: this.$route.query.value,
-      certificateUserName: this.$route.query.searchinput,
-      certificateType: this.$route.query.certificateTypeValue,
-    });
-    
-    if (res.code === 200 && res.data.records.length > 0) {
-      // 返回下一页第一条记录的ID
-      return res.data.records[0].id;
-    }
-    return null; // 没有下一页数据
-  },
   },
   created () {
     this.getOptions()
@@ -810,7 +697,6 @@ export default {
     this.queryRole()//获取角色方
     this.findUserByName()//关联用户
     this.findPfxType();//查询企业签章类型
-      this.getTableData(); // 添加这行,获取列表数据用于计算下一条
   },
   mounted () {
     this.updateDependentFieldValidation();