Browse Source

修改批量操作 新增定位最后一行

Qukatie 1 month ago
parent
commit
2db95a0d9e

+ 13 - 3
src/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation/precontainers.vue

@@ -8,10 +8,14 @@
             @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 309.1)">
             <template slot="menuLeft">
                 <el-button type="primary" size="small" :disabled="seeDisabled" @click.stop="addfun">新 增</el-button>
-                <el-button type="danger" size="small" plain :disabled="seeDisabled||assemblyForm.preContainersList.length==0" @click.stop="handleDelete">一键删除
+                <el-button type="danger" size="small" plain
+                    :disabled="seeDisabled || assemblyForm.preContainersList.length == 0" @click.stop="handleDelete">一键删除
+                </el-button>
+                <el-button type="primary" size="small" :disabled="seeDisabled || assemblyForm.preContainersList.length == 0"
+                    @click="batchSavefun">一键保存</el-button>
+                <el-button type="info" plain size="small"
+                    :disabled="seeDisabled || assemblyForm.preContainersList.length == 0" @click="onclickEdit">一键编辑
                 </el-button>
-                <el-button type="primary" size="small" :disabled="seeDisabled||assemblyForm.preContainersList.length==0" @click="batchSavefun">一键保存</el-button>
-                <el-button type="info" plain size="small" :disabled="seeDisabled||assemblyForm.preContainersList.length==0" @click="onclickEdit">一键编辑 </el-button>
                 <!--<el-button type="success" size="small" plain :disabled="seeDisabled"-->
                 <!--           @click.stop="equalDistribution">均分箱量-->
                 <!--</el-button>-->
@@ -679,6 +683,12 @@ export default {
         addfun() {
             this.$refs.crud.rowCellAdd({})
             // this.$refs.crud.rowAdd()
+            this.$nextTick(() => {
+                const container = this.$refs.crud.$el.querySelector('.el-table__body-wrapper');
+                if (container) {
+                    container.scrollTop = container.scrollHeight;
+                }
+            });
         },
         // 编辑
         editfun(row, index) {

+ 59 - 1
src/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue

@@ -99,6 +99,9 @@
                     <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1" type="primary"
                         plain size="small" :disabled="disabled || pleasereviewType"
                         @click="allClick('发票申请', 'D')">发票申请</el-button>
+                    <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1" type="primary" plain size="small"
+                        :disabled="disabled || !selectionDList.length"
+                        @click="allClick('批量修改结算单位')">批量修改结算单位</el-button>
                 </template>
                 <template slot="indexHeader" slot-scope="scope">
                     <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1" type="primary"
@@ -586,6 +589,18 @@
 
         <!--费用打印-->
         <reportContainer ref="reportContainer"></reportContainer>
+        <el-dialog title="修改结算单位" :visible.sync="dialogVisible" width="30%" :before-close="upClose" append-to-body>
+            <span>
+                <dic-select v-model="upForm.shortName" placeholder="结算单位" label="shortName" res="records"
+                    :slotRight="true" rightLabel="code" url="/blade-los/bcorps/selectList?status=0&current=1&size=10"
+                    :filterable="true" :remote="true" dataName="shortName"
+                    @selectChange="dicChange('shortName', $event)"></dic-select>
+            </span>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogVisible = false" size="small">取 消</el-button>
+                <el-button type="primary" @click="upSibmit" size="small">确 定</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
@@ -607,7 +622,8 @@ import {
     feecenterTemplateImport,
     listFeeCountByCorp,
     losbfeestemplateGetListTemplate,
-    accountsReceivable
+    accountsReceivable,
+    updateCorpBatch
 } from "@/api/iosBasicData/bills";
 import { losbfeestemplateDetail } from "@/api/iosBasicData/losbfeestemplate";
 import { popupReminder, requiredMessage } from "@/util/messageReminder";
@@ -649,6 +665,8 @@ export default {
     },
     data() {
         return {
+            upForm: {},
+            dialogVisible: false,
             amendsStatus: false,
             amendOption: {
                 border: true,
@@ -1814,6 +1832,46 @@ export default {
                     }
                 })
             }
+            if (name == '批量修改结算单位') {
+                if (this.selectionDList.length == 0) return this.$message.error("请选择费用");
+                if (this.selectionDList.length != this.selectionDList.filter(e => e.accStatus == 0).length) return this.$message.error("已生成账单费用明细不允许修改结算单位");
+                this.dialogVisible = true
+            }
+        },
+        upClose(done) {
+            this.upForm = {}
+            done();
+        },
+        upSibmit() {
+            const obj = {
+                corpId: this.upForm.corpId,
+                corpCnName: this.upForm.corpCnName,
+                corpEnName: this.upForm.corpEnName,
+                shortName: this.upForm.shortName,
+                feeCenterListD: this.selectionDList
+            }
+            updateCorpBatch(obj).then(res => {
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                });
+                this.dialogVisible = false
+                this.$emit('billsDetailfun')
+            })
+        },
+        dicChange(name, row) {
+            if (name == 'shortName') {
+                if (row) {
+                    this.upForm.corpId = row.id
+                    this.upForm.corpCnName = row.cnName
+                    this.upForm.corpEnName = row.enName
+                } else {
+                    this.upForm.corpId = null
+                    this.upForm.shortName = null
+                    this.upForm.corpCnName = null
+                    this.upForm.corpEnName = null
+                }
+            }
         },
         // 应收新增
         addDfun() {

+ 190 - 11
src/views/iosBasicData/OceanFreightImport/bills/index.vue

@@ -9,8 +9,8 @@
                 @refresh-change="refreshChange" @on-load="onLoad" @expand-change="expandChange" @resetColumn="
                     resetColumnTwo('crud', 'option', 'optionBack', 309.11)
                     " @saveColumn="
-                    saveColumnTwo('crud', 'option', 'optionBack', 309.11)
-                    ">
+                        saveColumnTwo('crud', 'option', 'optionBack', 309.11)
+                        ">
                 <template slot-scope="{ disabled, size }" slot="billSortSearch">
                     <el-radio-group v-model="query.billSort">
                         <el-radio label="1">ETD</el-radio>
@@ -333,6 +333,18 @@
                     </el-button>
                     <el-button type="warning" size="small" @click="outExport">导 出
                     </el-button>
+                    <el-dropdown style="line-height: 0" @command="batchClick">
+                        <el-button size="small" type="danger" :disabled="selectionList.length == 0">
+                            批量操作<i class="el-icon-arrow-down el-icon--right"></i>
+                        </el-button>
+                        <el-dropdown-menu slot="dropdown">
+                            <el-dropdown-item command="批量单据请核">批量单据请核</el-dropdown-item>
+                            <el-dropdown-item command="批量撤销单据请核">批量撤销单据请核</el-dropdown-item>
+                            <el-dropdown-item command="批量生成账单">批量生成账单</el-dropdown-item>
+                            <el-dropdown-item command="批量撤销账单">批量撤销账单</el-dropdown-item>
+                            <el-dropdown-item command="批量复制">批量复制</el-dropdown-item>
+                        </el-dropdown-menu>
+                    </el-dropdown>
                     <div style="margin-top: 10px">
                         <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
 
@@ -410,7 +422,7 @@
                 <template slot="eta" slot-scope="scope">
                     <span>{{
                         scope.row.eta ? scope.row.eta.slice(0, 10) : ""
-                        }}</span>
+                    }}</span>
                 </template>
                 <template slot="updateTime" slot-scope="scope">
                     <span>{{
@@ -437,13 +449,13 @@
                         309.7
                     )
                     " @saveColumn="
-                    saveColumnTwo(
-                        'mawbOptionCrud',
-                        'mawbOption',
-                        'mawbOptionBack',
-                        309.7
-                    )
-                    ">
+                        saveColumnTwo(
+                            'mawbOptionCrud',
+                            'mawbOption',
+                            'mawbOptionBack',
+                            309.7
+                        )
+                        ">
                 <template slot="radio" slot-scope="{ row }">
                     <el-radio v-model="dialogRadio" :label="row.id" @input="radioInput(row)"></el-radio>
                 </template>
@@ -469,7 +481,12 @@ import {
     billsListAll,
     billsDisembarking,
     editypesSendingEdi,
-    billsRevokeDisembarking
+    billsRevokeDisembarking,
+    checkBillsBatch,
+    revokeCheckBillsBatch,
+    generateBillBatch,
+    revokeBillBatch,
+    batchCopyBills
 } from "@/api/iosBasicData/bills";
 import { mapGetters } from "vuex";
 import billsDetails from "@/views/iosBasicData/OceanFreightImport/bills/billsDetails.vue";
@@ -1560,6 +1577,168 @@ export default {
         }
     },
     methods: {
+        batchClick(name) {
+            if (name == '批量更改') {
+                this.updateField()
+            }
+            if (name == '批量单据请核') {
+                this.$confirm('是否批量单据请核?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const obj = {
+                        billsIds: this.ids,
+                        url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
+                        pageStatus: "this.$store.getters.approvalDetails",
+                        pageLabel: "审批详情(F)",
+                    }
+                    checkBillsBatch(obj).then(res => {
+                        this.$message({
+                            type: "success",
+                            message: "操作成功!"
+                        });
+                        this.onLoad(this.page, this.query);
+                    })
+                })
+            }
+            if (name == '批量撤销单据请核') {
+                for (let item of this.selectionList) {
+                    if (item.status == 0) {
+                        return this.$message.error("请选择已提交审核的单据");
+                    }
+                }
+                this.$confirm('是否批量撤销单据请核?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const obj = {
+                        billsIds: this.ids,
+                    }
+                    revokeCheckBillsBatch(obj).then(res => {
+                        this.$message({
+                            type: "success",
+                            message: "操作成功!"
+                        });
+                        this.onLoad(this.page, this.query);
+                    })
+                })
+            }
+            if (name == '批量生成账单') {
+                this.$confirm('是否批量生成账单?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const obj = {
+                        billsIds: this.ids,
+                    }
+                    generateBillBatch(obj).then(res => {
+                        this.$message({
+                            type: "success",
+                            message: "操作成功!"
+                        });
+                        this.onLoad(this.page, this.query);
+                    })
+                })
+            }
+            if (name == '批量撤销账单') {
+                this.$confirm('是否批量撤销账单?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const obj = {
+                        billsIds: this.ids,
+                    }
+                    revokeBillBatch(obj).then(res => {
+                        this.$message({
+                            type: "success",
+                            message: "操作成功!"
+                        });
+                        this.onLoad(this.page, this.query);
+                    })
+                })
+
+            }
+            if (name == '批量复制') {
+                this.$DialogForm.show({
+                    title: "复制单据",
+                    width: "300px",
+                    menuPosition: "right",
+                    data: { checkbox: "复制费用,复制箱型箱量" },
+                    option: {
+                        submitText: "确认",
+                        emptyText: "取消",
+                        span: 24,
+                        column: [
+                            {
+                                label: "单据类型",
+                                prop: "billType",
+                                type: "select",
+                                value: this.selectionList[0].billType,
+                                dicData: [
+                                    {
+                                        label: '直单',
+                                        value: 'DD'
+                                    },
+                                    {
+                                        label: '主单',
+                                        value: 'MM'
+                                    },
+                                    {
+                                        label: '分单',
+                                        value: 'MH'
+                                    }
+                                ],
+                                dataType: "string",
+                                span: 24
+                            },
+                            {
+                                label: "复制类型",
+                                prop: "checkbox",
+                                type: "checkbox",
+                                dicData: [
+                                    {
+                                        label: "复制费用",
+                                        value: "复制费用"
+                                    },
+                                    {
+                                        label: "复制箱型箱量",
+                                        value: "复制箱型箱量"
+                                    }
+                                ],
+                                dataType: "string",
+                                span: 24
+                            }
+                        ]
+                    },
+                    beforeClose: done => {
+                        done();
+                    },
+                    callback: res => {
+                        res.done();
+                        const types = res.data.checkbox ? res.data.checkbox.split(",") : []
+                        console.log(res.data.checkbox.includes('复制费用'))
+                        const obj = {
+                            ids: this.ids,
+                            billType: res.data.billType,
+                            copyCntr: res.data.checkbox.includes('复制箱型箱量') ? 1 : 0,
+                            copyFee: res.data.checkbox.includes('复制费用') ? 1 : 0
+                        }
+                        batchCopyBills(obj).then(res => {
+                            this.$message({
+                                type: "success",
+                                message: "操作成功!"
+                            });
+                            this.onLoad(this.page, this.query);
+                        })
+                        res.close();
+                    }
+                });
+            }
+        },
         rowStyle({ row, column, rowIndex, columnIndex }) {
             if (row.status == 2) {
                 return {

+ 13 - 6
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation/precontainers.vue

@@ -1,10 +1,10 @@
 <template>
     <basic-container>
-        <avue-crud style="height: 230px;" :option="option" :table-loading="loading"
-            :data="assemblyForm.preContainersList" :page.sync="page" :permission="permissionList"
-            :before-open="beforeOpen" v-model="form" :cell-style="{ padding: '0px', textAlign: 'center' }" ref="crud"
-            @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @selection-change="selectionChange"
-            @refresh-change="refreshChange" @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 309.1)"
+        <avue-crud :option="option" :table-loading="loading" :data="assemblyForm.preContainersList" :page.sync="page"
+            :permission="permissionList" :before-open="beforeOpen" v-model="form"
+            :cell-style="{ padding: '0px', textAlign: 'center' }" ref="crud" @row-update="rowUpdate" @row-save="rowSave"
+            @row-del="rowDel" @selection-change="selectionChange" @refresh-change="refreshChange"
+            @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 309.1)"
             @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 309.1)">
             <template slot="menuLeft">
                 <div style="display: flex;align-items: center;">
@@ -133,7 +133,7 @@ export default {
             option: {},
             optionBack: {
                 // height: '200',
-                // calcHeight: 30,
+                calcHeight: 30,
                 maxHeight: '180',
                 tip: false,
                 searchShow: true,
@@ -728,7 +728,14 @@ export default {
         // 新增
         addfun() {
             this.$refs.crud.rowCellAdd({})
+            // this.assemblyForm.preContainersList.push({ });
             // this.$refs.crud.rowAdd()
+            this.$nextTick(() => {
+                const container = this.$refs.crud.$el.querySelector('.el-table__body-wrapper');
+                if (container) {
+                    container.scrollTop = container.scrollHeight;
+                }
+            });
         },
         // 编辑
         editfun(row, index) {

+ 59 - 2
src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue

@@ -102,6 +102,9 @@
                         :disabled="disabled || pleasereviewType" @click="copyfun('D')">生成应付</el-button>
                     <el-button v-if="isFeeEditD" type="primary" plain size="small"
                         :disabled="disabled || pleasereviewType" @click="allClick('发票申请', 'D')">发票申请</el-button>
+                    <el-button v-if="isFeeEditD" type="primary" plain size="small"
+                        :disabled="disabled || !selectionDList.length"
+                        @click="allClick('批量修改结算单位')">批量修改结算单位</el-button>
                 </template>
                 <template slot="indexHeader" slot-scope="scope">
                     <el-button v-if="isFeeEditD" type="primary" size="small" icon="el-icon-plus" circle
@@ -593,6 +596,18 @@
 
         <!--费用打印-->
         <reportContainer ref="reportContainer"></reportContainer>
+        <el-dialog title="修改结算单位" :visible.sync="dialogVisible" width="30%" :before-close="upClose" append-to-body>
+            <span>
+                <dic-select v-model="upForm.shortName" placeholder="结算单位" label="shortName" res="records"
+                    :slotRight="true" rightLabel="code" url="/blade-los/bcorps/selectList?status=0&current=1&size=10"
+                    :filterable="true" :remote="true" dataName="shortName"
+                    @selectChange="dicChange('shortName', $event)"></dic-select>
+            </span>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogVisible = false" size="small">取 消</el-button>
+                <el-button type="primary" @click="upSibmit" size="small">确 定</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
@@ -614,7 +629,8 @@ import {
     feecenterTemplateImport,
     listFeeCountByCorp,
     losbfeestemplateGetListTemplate,
-    accountsReceivable
+    accountsReceivable,
+    updateCorpBatch
 } from "@/api/iosBasicData/bills";
 import { losbfeestemplateDetail } from "@/api/iosBasicData/losbfeestemplate";
 import { popupReminder, requiredMessage } from "@/util/messageReminder";
@@ -658,6 +674,8 @@ export default {
     },
     data() {
         return {
+            upForm: {},
+            dialogVisible: false,
             amendsStatus: false,
             amendOption: {
                 border: true,
@@ -3015,7 +3033,42 @@ export default {
                         }
                     })
                 }
-
+            }
+            if (name == '批量修改结算单位') {
+                if (this.selectionDList.length == 0) return this.$message.error("请选择费用");
+                if (this.selectionDList.length != this.selectionDList.filter(e => e.accStatus == 0).length) return this.$message.error("已生成账单费用明细不允许修改结算单位");
+                this.dialogVisible = true
+            }
+        },
+        upSibmit() {
+            const obj = {
+                corpId: this.upForm.corpId,
+                corpCnName: this.upForm.corpCnName,
+                corpEnName: this.upForm.corpEnName,
+                shortName: this.upForm.shortName,
+                feeCenterListD: this.selectionDList
+            }
+            updateCorpBatch(obj).then(res => {
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                });
+                this.dialogVisible = false
+                this.$emit('billsDetailfun')
+            })
+        },
+        dicChange(name, row) {
+            if (name == 'shortName') {
+                if (row) {
+                    this.upForm.corpId = row.id
+                    this.upForm.corpCnName = row.cnName
+                    this.upForm.corpEnName = row.enName
+                } else {
+                    this.upForm.corpId = null
+                    this.upForm.shortName = null
+                    this.upForm.corpCnName = null
+                    this.upForm.corpEnName = null
+                }
             }
         },
         // 预览报表
@@ -3258,6 +3311,10 @@ export default {
             }
             return back;
         },
+        upClose(done) {
+            this.upForm = {}
+            done();
+        },
         // 关闭弹窗
         handleClose(done) {
             this.feesselectionList = [] // 清空多选

+ 5 - 0
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -1449,6 +1449,11 @@ export default {
                 })
             }
             if (name == '批量撤销单据请核') {
+                for (let item of this.selectionList) {
+                    if (item.status == 0) {
+                        return this.$message.error("请选择已提交审核的单据");
+                    }
+                }
                 this.$confirm('是否批量撤销单据请核?', '提示', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',