Qukatie 6 месяцев назад
Родитель
Сommit
9b5e95e189

+ 48 - 5
src/views/iosBasicData/costcenter/coc/detailsPage.vue

@@ -1209,7 +1209,11 @@ export default {
         reports
     },
     props: {
-        detailData: Object
+        detailData: Object,
+        pageIds: {
+            type: Array, // 指定 prop 的类型为 Array
+            default: () => [], // 提供一个默认值,这里使用函数形式返回一个空数组
+        }
     },
     async created() {
         this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
@@ -1232,6 +1236,44 @@ export default {
         }
     },
     methods: {
+               lastPage() {
+            if (this.pageIds.length) {
+                const index = this.pageIds.indexOf(this.form.id)
+                if (index == 0) {
+                    return this.$message.error('没有上一票了');
+                }
+                const lastIndex = index - 1
+                if (this.form.id) {
+                    this.unLock({
+                        moduleName: "COC",
+                        tableName: "COC_order",
+                        billId: this.form.id,
+                        billNo: this.form.businessNo
+                    });
+                }
+                this.pageLoading = true
+                this.getDetails(this.pageIds[lastIndex])
+            }
+        },
+        nextPage() {
+            if (this.pageIds.length) {
+                const index = this.pageIds.indexOf(this.form.id)
+                if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
+                    return this.$message.error('没有下一票了');
+                }
+                const nextIndex = index + 1
+                if (this.form.id) {
+                    this.unLock({
+                        moduleName: "COC",
+                        tableName: "COC_order",
+                        billId: this.form.id,
+                        billNo: this.form.businessNo
+                    });
+                }
+                this.pageLoading = true
+                this.getDetails(this.pageIds[nextIndex])
+            }
+        },
         exrateDateCount() {
             this.form.costItemList.forEach(item => {
                 let polSUM = 0
@@ -1508,8 +1550,9 @@ export default {
                 background: 'rgba(255,255,255,0.7)'
             });
             getDetail({ id: id }).then(res => {
-                this.polFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POL')
-                this.podFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POD')
+                // this.polFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POL')
+                // this.podFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POD')
+              console.log(res.data.data)
                 this.saveLocalCurrency(res.data.data.belongingCompanyId)
                 this.form = res.data.data
                 if (res.data.data.status != '录入') {
@@ -1529,8 +1572,8 @@ export default {
                 background: 'rgba(255,255,255,0.7)'
             });
             copyAgent({ id: id }).then(res => {
-                this.polFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POL')
-                this.podFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POD')
+                // this.polFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POL')
+                // this.podFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POD')
                 this.form = res.data.data
             }).finally(() => {
                 loading.close()

+ 10 - 3
src/views/iosBasicData/costcenter/coc/index.vue

@@ -41,14 +41,14 @@
                 <template slot="status" slot-scope="{ row }">
                     <span v-if="row.status == '录入'"
                         style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #409EFF;">{{
-                        row.status }}</span>
+                            row.status }}</span>
                     <span v-if="row.status != '录入'"
                         style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #67C23A;">{{
-                        row.status }}</span>
+                            row.status }}</span>
                 </template>
             </avue-crud>
         </basic-container>
-        <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
+        <detailsPage v-if="!isShow" :detailData="detailData" :pageIds="pageIds" @goBack="goBack"></detailsPage>
     </div>
 </template>
 
@@ -325,6 +325,7 @@ export default {
                 ]
             },
             data: [],
+            pageIds: []
         };
     },
     components: {
@@ -416,6 +417,7 @@ export default {
             this.query.destinationCname = obj.podCname
         },
         addButton() {
+            this.pageIds = []
             this.isShow = false
         },
         copyButton() {
@@ -425,6 +427,10 @@ export default {
             };
         },
         rowEdit(row) {
+            this.pageIds = []
+            this.data.forEach(item => {
+                this.pageIds.push(item.id)
+            })
             this.detailData = {
                 id: row.id
             };
@@ -489,6 +495,7 @@ export default {
         // 详情的返回列表
         goBack() {
             // 初始化数据
+            this.pageIds = []
             if (JSON.stringify(this.$route.query) != "{}") {
                 this.$router.$avueRouter.closeTag();
                 this.$router.push({

+ 2 - 2
src/views/iosBasicData/costcenter/soc/detailsPage.vue

@@ -1914,7 +1914,7 @@ export default {
                     });
                 }
                 this.pageLoading = true
-                this.billsDetailfun(this.pageIds[lastIndex])
+                this.getDetails(this.pageIds[lastIndex])
             }
         },
         nextPage() {
@@ -1933,7 +1933,7 @@ export default {
                     });
                 }
                 this.pageLoading = true
-                this.billsDetailfun(this.pageIds[nextIndex])
+                this.getDetails(this.pageIds[nextIndex])
             }
         },
         getDefault(data) {