Browse Source

JMS 批量复制费用 海运出口添加直接在主单上做分单的功能

Qukatie 2 months ago
parent
commit
b6361710bf

+ 32 - 0
src/api/iosBasicData/bills.js

@@ -354,3 +354,35 @@ export const getGeneralbill2 = (data) => {
     params: data
   })
 }
+//创建分单并添加到主单
+export const createAndAdd = (data) => {
+  return request({
+    url: '/api/blade-los/bills/createAndAdd',
+    method: 'get',
+    params: data
+  })
+}
+//获取单据加费用信息列表
+export const getBillsAndFee = (data) => {
+  return request({
+    url: '/api/blade-los/bills/getBillsAndFee',
+    method: 'get',
+    params: data
+  })
+}
+//批量复制费用
+export const batchCopyCost = (data) => {
+  return request({
+    url: '/api/blade-los/bills/batchCopyCost',
+    method: 'post',
+    data: data
+  })
+}
+//校验批量复制费用
+export const batchCopyCostPrompt = (data) => {
+  return request({
+    url: '/api/blade-los/bills/batchCopyCostPrompt',
+    method: 'post',
+    data: data
+  })
+}

+ 264 - 0
src/views/iosBasicData/SeafreightExportF/bills/assembly/copyFee.vue

@@ -0,0 +1,264 @@
+<template>
+    <div>
+        <el-dialog title="批量复制费用" append-to-body :visible.sync="feeVisible" width="80%" :close-on-click-modal="false"
+            v-dialog-drag>
+            <span v-if="feeVisible">
+                <el-row :gutter="10">
+                    <el-col :span="12">
+                        <avue-crud :data="data" :option="option" :page.sync="page" :table-loading="loading"
+                            :cell-style="cellStyle" @current-row-change="handleCurrentRowChange"
+                            @current-change="currentChange" @size-change="sizeChange" @on-load="onLoad">
+                        </avue-crud>
+                    </el-col>
+                    <el-col :span="12">
+                        <avue-crud :data="itemData" :option="itemOption" :table-loading="loading"
+                            :cell-style="cellStyle" @selection-change="selectionChange">
+                        </avue-crud>
+                    </el-col>
+                </el-row>
+
+            </span>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="feeVisible = false" size="mini">取 消</el-button>
+                <el-button type="primary" @click="importData" size="mini">导 入</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import { getDicinit } from "@/api/dicSelect/index";
+import { getToken } from "@/util/auth";
+import { getBillsAndFee, batchCopyCost, batchCopyCostPrompt } from "@/api/iosBasicData/bills";
+export default {
+    data() {
+        return {
+            loading: false,
+            headers: { "Blade-Auth": 'Bearer ' + getToken() },
+            action: null,
+            feeVisible: false,
+            id: null,
+            ids: null,
+            mblno: null,
+            quantityCntrDescr: null,
+            data: [],
+            itemData: [],
+            selectionList: [],
+            option: {
+                height: 500,
+                border: true,
+                align: 'center',
+                menu: false,
+                addBtn: false,
+                refreshBtn: false,
+                columnBtn: false,
+                header: false,
+                stripe: true,
+                highlightCurrentRow: true,
+                column: [
+                    {
+                        label: '客户简称',
+                        prop: 'shortName',
+                        overHidden: true,
+                    },
+                    {
+                        label: 'MB/L NO',
+                        prop: 'mblno',
+                        overHidden: true,
+                    },
+                    {
+                        label: '船名',
+                        prop: 'vesselEnName',
+                        overHidden: true,
+                    },
+                    {
+                        label: '航次',
+                        prop: 'voyageNo',
+                        overHidden: true,
+                    },
+                    {
+                        label: '装货港',
+                        prop: 'polCnName',
+                        overHidden: true,
+                    },
+                    {
+                        label: '卸货港',
+                        prop: 'podCnName',
+                        overHidden: true,
+                    },
+                    {
+                        label: '箱型/箱量',
+                        prop: 'quantityCntrDescr',
+                        overHidden: true,
+                    }
+                ]
+            },
+            itemOption: {
+                height: 500,
+                border: true,
+                align: 'center',
+                menu: false,
+                addBtn: false,
+                refreshBtn: false,
+                columnBtn: false,
+                header: false,
+                stripe: true,
+                tip: false,
+                selection: true,
+                column: [
+                    {
+                        label: '结算单位',
+                        prop: 'shortName',
+                        overHidden: true,
+                    },
+                    {
+                        label: '费用名称',
+                        prop: 'feeCnName',
+                        overHidden: true,
+                    },
+                    {
+                        label: '币种',
+                        prop: 'curCode',
+                        overHidden: true,
+                    },
+                    {
+                        label: '单位',
+                        prop: 'unitNo',
+                        overHidden: true,
+                    },
+                    {
+                        label: '单价',
+                        prop: 'price',
+                        overHidden: true,
+                    },
+                    {
+                        label: '数量',
+                        prop: 'quantity',
+                        overHidden: true,
+                    },
+                    {
+                        label: '金额',
+                        prop: 'amount',
+                        overHidden: true,
+                    }
+                ]
+            },
+            url: null,
+            type: null,
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+                pagerCount: 3,
+            },
+        };
+    },
+    created() { },
+    methods: {
+        currentChange(currentPage) {
+            this.page.currentPage = currentPage;
+        },
+        sizeChange(pageSize) {
+            this.page.pageSize = pageSize;
+        },
+        openDialog(ids, mblno) {
+            console.log(ids, mblno)
+            this.id = null
+            this.quantityCntrDescr = null
+            this.ids = ids
+            this.mblno = mblno
+            this.data = []
+            this.page.currentPage = 1
+            this.page.pageSize = 10
+            this.itemData = []
+            this.selectionList = []
+            this.feeVisible = true
+            // this.onLoad()
+
+        },
+        onLoad() {
+            let obj = {
+                current: this.page.currentPage,
+                size: this.page.pageSize,
+                mblno: this.mblno
+            }
+            this.loading = true;
+            getBillsAndFee(obj).then(res => {
+                this.data = res.data.data.records
+                this.page.total = res.data.data.total
+                this.itemData = []
+            }).finally(() => {
+                this.loading = false;
+            })
+        },
+        handleCurrentRowChange(row) {
+            this.id = row.id
+            this.quantityCntrDescr = row.quantityCntrDescr
+            this.itemData = row.feeCenterListAll
+        },
+        selectionChange(list) {
+            this.selectionList = list
+        },
+        importData() {
+            if (this.data.length == 0) {
+                return this.$message.error("主表暂时没数据");
+            }
+            if (!this.id) {
+                return this.$message.error("请选择主表数据");
+            }
+            if (this.selectionList.length == 0) {
+                return this.$message.error("请选择数据");
+            }
+            let obj = {
+                id: this.id,
+                quantityCntrDescr: this.quantityCntrDescr,
+                ids: this.ids,
+                feeCenterListAll: this.selectionList
+            }
+            batchCopyCostPrompt(obj).then(res => {
+                console.log(res)
+                if (res.data.data == '操作成功') {
+                    this.loading = true
+                    batchCopyCost(obj).then(res => {
+                        this.feeVisible = false
+                    }).finally(() => {
+                        this.loading = false;
+                    })
+                } else {
+                    this.$confirm(res.data.data, '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        this.loading = true
+                        batchCopyCost(obj).then(res => {
+                            this.feeVisible = false
+                        }).finally(() => {
+                            this.loading = false;
+                        })
+                    })
+                }
+            })
+
+        },
+        cellStyle({ row, column, rowIndex, columnIndex }) {
+            if (row.result == '失败') {
+                return {
+                    color: '#F56C6C',
+                }
+            } else {
+                return {
+                    color: '##67C23A',
+                }
+            }
+        }
+    }
+}
+
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-dialog__body {
+    padding: 10px 8px !important;
+}
+</style>

+ 80 - 3
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -336,7 +336,8 @@ import {
     billsListAll, billsRevokeCheckBills, editypesSendingEdi,
     billsSubmit,
     billsAdd,
-    deptGetDetailPol, postSelectByUser, documentVerification, agreementpriceList
+    deptGetDetailPol, postSelectByUser, documentVerification,
+    agreementpriceList, createAndAdd
 } from '@/api/iosBasicData/bills'
 import { dateFormat } from "@/util/date";
 import checkSchedule from "@/components/checkH/checkSchedule.vue";
@@ -2118,7 +2119,7 @@ export default {
                         })
                         return;
                     }
-                    console.log("this.verifySymbolStatus",this.verifySymbolStatus)
+                    console.log("this.verifySymbolStatus", this.verifySymbolStatus)
                     if (this.verifySymbolStatus == 1) {
                         /*
                         let msgsList = []
@@ -2384,7 +2385,7 @@ export default {
                     } else {
                         this.billsSubmitfun(status)
                     }
-                }else{
+                } else {
                     console.log("this.editCustomer not valid")
                 }
             })
@@ -2654,6 +2655,82 @@ export default {
                 loading.close();
             })
         },
+        copyCreateAndAdd(id, type) {
+            console.log(id,1234556)
+            let obj={
+                id:id
+            }
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            });
+            createAndAdd(obj).then(res => {
+                this.form = res.data.data;
+                this.pageLoading = false
+                // 配箱最上面可以编辑
+                for (let item of this.form.containersList) {
+                    item.edit = false
+                }
+                // 先把状态改成可以编辑,然后判断是否可以编辑
+                this.generateBillsfalse = false
+                // 应收
+                for (let item of this.form.feeCenterListD) {
+                    // 判断是否生成了账单
+                    if (item.accStatus == 1) {
+                        this.columnforfun('corpCnName').disabled = true
+                        this.columnforfun('srcType').disabled = true
+                        this.columnforfun('mblno').disabled = true
+                        this.columnforfun('bookingNo').disabled = true
+                        this.columnforfun('refno').disabled = true
+                        this.generateBillsfalse = true
+                    }
+                    if (item.curCode == 'CNY') {
+                        this.$set(item, 'rmbAmount', item.amount)
+                        this.$set(item, 'usdAmount', '')
+                        this.$set(item, 'rmbAmountNet', item.amountNet)
+                        this.$set(item, 'usdAmountNet', '')
+                    } else {
+                        this.$set(item, 'usdAmount', item.amount)
+                        this.$set(item, 'rmbAmount', '')
+                        this.$set(item, 'usdAmountNet', item.amountNet)
+                        this.$set(item, 'rmbAmountNet', '')
+                    }
+                    item.edit = false
+                }
+                // 应付
+                for (let item of this.form.feeCenterListC) {
+                    // 判断是否生成了账单
+                    if (item.accStatus == 1) {
+                        this.generateBillsfalse = true
+                        this.columnforfun('corpCnName').disabled = true
+                        this.columnforfun('srcType').disabled = true
+                        this.columnforfun('mblno').disabled = true
+                        this.columnforfun('bookingNo').disabled = true
+                        this.columnforfun('refno').disabled = true
+                    }
+                    if (item.curCode == 'CNY') {
+                        this.$set(item, 'rmbAmount', item.amount)
+                        this.$set(item, 'usdAmount', '')
+                        this.$set(item, 'rmbAmountNet', item.amountNet)
+                        this.$set(item, 'usdAmountNet', '')
+                    } else {
+                        this.$set(item, 'usdAmount', item.amount)
+                        this.$set(item, 'rmbAmount', '')
+                        this.$set(item, 'usdAmountNet', item.amountNet)
+                        this.$set(item, 'rmbAmountNet', '')
+                    }
+                    item.edit = false
+                }
+                // 文件中心
+                for (let item of this.form.filesList) {
+                    this.$set(item, 'edit', false)
+                }
+            }).finally(() => {
+                loading.close();
+            })
+        },
         // 详情接口
         async billsDetailfun(id, status) {
             const res = await billsDetail(id)

+ 57 - 14
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -71,6 +71,7 @@
                             <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">
@@ -284,6 +285,7 @@
         </el-dialog> -->
         <!-- 导入 MH -->
         <import-module ref="importModule" @refreshData="refreshData" />
+        <copy-fee ref="copyFee"></copy-fee>
     </div>
 </template>
 
@@ -304,7 +306,7 @@ import {
     generateBillBatch,
     revokeBillBatch,
     batchCopyBills,
-    postMagicHandImportBills
+    postMagicHandImportBills,
 } from "@/api/iosBasicData/bills";
 import { mapGetters } from "vuex";
 import billsDetails from "@/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue";
@@ -323,6 +325,7 @@ import { getDeptTree } from "@/api/system/dept";
 import { getToken } from "@/util/auth";
 import UpdateBatchField from "@/views/iosBasicData/SeafreightExportF/bills/updateBatchField.vue";
 import importModule from "./assembly/importModule.vue";
+import copyFee from "./assembly/copyFee.vue";
 export default {
     components: {
         UpdateBatchField,
@@ -331,7 +334,8 @@ export default {
         feesTemplateItems,
         billsDetails,
         SplitList,
-        importModule
+        importModule,
+        copyFee
     },
     data() {
         return {
@@ -1173,17 +1177,6 @@ export default {
                         searchValue: "1",
                         overHidden: true
                     },
-                    //   {
-                    //       label: "更新人",
-                    //       prop: "updateUserName",
-                    //       overHidden:true,
-                    //   },
-                    //   {
-                    //       label: "更新时间",
-                    //       prop: "updateTime",
-                    //       width:"160",
-                    //       overHidden:true,
-                    //   },
                     {
                         label: "edi发送状态",
                         prop: "ediStatus",
@@ -1617,6 +1610,45 @@ export default {
                     }
                 });
             }
+            if (name == '批量复制费用') {
+                this.$DialogForm.show({
+                    title: "批量复制费用",
+                    width: "300px",
+                    menuPosition: "right",
+                    option: {
+                        submitText: "确认",
+                        emptyText: "取消",
+                        span: 24,
+                        column: [
+                            {
+                                label: "MB/L NO",
+                                prop: "mblno",
+                                span: 24,
+                                rules: [
+                                    {
+                                        required: true,
+                                        message: '请输入MB/L NO',
+                                        trigger: 'blur'
+                                    }
+                                ]
+                            },
+                        ]
+                    },
+                    beforeClose: done => {
+                        done();
+                    },
+                    callback: res => {
+                        res.done();
+                        let ids = []
+                        for (let item of this.selectionList) {
+                            ids.push(item.id)
+                        }
+                        console.log(res.data.mblno)
+                        this.$refs.copyFee.openDialog(ids.join(','), res.data.mblno)
+                        res.close();
+                    }
+                });
+            }
 
         },
         updateField() {
@@ -1878,7 +1910,7 @@ export default {
 
             // 当前登录人和选择的创建人对比是不是一个人
             for (let item of this.selectionList) {
-                if (!(this.saberUserInfo.role_name.indexOf("admin") != -1||this.saberUserInfo.role_name.indexOf("允许修改他人业务") != -1)) {
+                if (!(this.saberUserInfo.role_name.indexOf("admin") != -1 || this.saberUserInfo.role_name.indexOf("允许修改他人业务") != -1)) {
                     if (this.saberUserInfo.user_id != item.createUser) {
                         sumArr.push(
                             h("p", `你没有"允许修改他人业务"权限,请重新选择数据`)
@@ -1996,8 +2028,19 @@ export default {
         addbtnfun(type) {
             this.detailData.seeDisabled = false;
             this.detailData.billType = type;
+            // this.detailData.copyId=this.selectionList[0].id
             this.isShow = false;
             this.$store.commit("IN_SEAFE_DETAIL");
+            if (this.selectionList.length == 1 && type == 'MH') {
+                console.log(this.selectionList[0].id, 1111)
+                this.$nextTick(() => {
+                    console.log(this.selectionList[0].id, 2222)
+                    this.$refs.billsDetails.pageLoading = true;
+                    this.$refs.billsDetails.copyCreateAndAdd(
+                        this.selectionList[0].id, type
+                    );
+                });
+            }
         },
         allClick(name) {
             if (name == '修改单据类型') {