wangyi
2026-02-28 a1cc3f87d24ae2a19295c7b38faa17228cd863ec
src/views/logistics/transportGPS/WL_YayBill.vue
@@ -168,7 +168,15 @@
            </el-col> -->
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-circle-check" size="mini" :disabled="single"
                    @click="set_HScatteredVolumeList">维护零单占用体积</el-button>
                    @click="handleVolume(rowForm)">维护零单占用体积</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini"
                    @click="handlePush(row = rowForm, OperationType = 4)">下推(费用结算单)</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
                    @click="openDataDialog(14, form = rowForm)">分配司机</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
@@ -247,7 +255,7 @@
            <!-- 编辑 -->
            <el-dialog title="编辑" :visible.sync="openEdit" width="1480px" append-to-body class="xsckdBox"
                @close="close">
                <edit :OperationType=OperationType :linterid=this.rowForm.HInterID
                <Edit :OperationType=OperationType :linterid=this.rowForm.HInterID
                    :HSouceBillType=this.rowForm.HSourceBillType :copyType="copyType" @editClose="editClose"
                    v-if="editShow" />
            </el-dialog>
@@ -257,10 +265,39 @@
                    :HModName="HModName" @rowEditClose="rowSetClose" v-if="printListShow" />
                <!-- <div>111</div> -->
            </el-dialog>
            <el-dialog title="维护零单占用体积" :visible.sync="openVolume" width="580px" append-to-body>
                <el-form ref="form" :model="formVolume" :rules="rulesVolume" label-width="130px">
                    <el-form-item label="单据号">
                        <el-input v-model="formVolume.单据号" placeholder="请输入单据号" disabled />
                    </el-form-item>
                    <el-form-item label="零单占用体积">
                        <el-input-number v-model="formVolume.currentVolume" placeholder="请输入零单占用体积" />
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="set_HScatteredVolumeList">确 定</el-button>
                    <el-button @click="cancelVolume">取 消</el-button>
                </div>
            </el-dialog>
            <!-- 条码明细 -->
            <BarCodeDetail :visible.sync="barCodeDetailShow" ref="barcodeDetail" />
            <!-- 包装容器出入库明细 -->
            <PackStockDetail :visible.sync="packStockDetailShow" ref="packStockDetail" />
            <!-- 下推 -->
            <el-dialog title="下推运单结算单" :visible.sync="openPush" width="1480px" append-to-body class="xsckdBox"
                @close="close">
                <PayMentOtherBillTranEdit :OperationType='4' :propsData='pushData'
                    :HSouceBillType=this.rowForm.HSourceBillType @editClose="pushClose" v-if="pushShow" />
            </el-dialog>
            <el-dialog :title="dialogTitle" :visible.sync="openData" width="1280px" append-to-body>
                <GyCar @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyCarShow" />
                <GyDriver @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyDriverShow" />
                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="deptClickSub">确 定</el-button>
                    <el-button @click="deptClose">取 消</el-button>
                </div>
            </el-dialog>
        </div>
    </div>
</template>
@@ -271,12 +308,14 @@
import RowSettings from '@/views/component/rowSettings'                   //列设置组件
import PrintList from '@/views/component/printList'                       //打印组件
import BarCodeDetail from '@/views/component/BarCodeDetail'               //条码明细组件
import PackStockDetail from '@/views/component/PackStockDetail'               //条码明细组件
import PackStockDetail from '@/views/component/PackStockDetail'           //条码明细组件
import Edit from '@/views/logistics/transportGPS/Add_Edit_WL_YayBill'   //编辑页面组件
import PayMentOtherBillTranEdit from "@/views/logistics/WayBillPaymentBill/Pay_WayBillPaymentBillEdit.vue";  //编辑页面组件
import GyCar from "@/views/basic/gyCar/gyCarList.vue"
import GyDriver from "@/views/system/user/GyDriver.vue"
export default {
    name: 'WL_YayBill',
    components: { RowSettings, Edit, PrintList, BarCodeDetail, PackStockDetail },
    components: { BarCodeDetail, PackStockDetail, Edit, RowSettings, PrintList, PayMentOtherBillTranEdit, GyCar, GyDriver },
    data() {
        return {
            baseURL: process.env.VUE_APP_BASE_API,                //后端接口前缀(后端服务器ip地址)
@@ -319,11 +358,14 @@
            title: "",                                            // 弹出层标题
            open: false,                                          // 是否显示弹出层
            loading: true,                                        // 遮罩层
            rowList: [],                                          // 选中行数据集合
            activeSeach: '',
            // addBtnShow: false,                                    //编辑组件容器显示标记
            editShow: false,                                      //编辑组件容器显示标记
            openEdit: false,                                      //编辑组件显示标记
            pushShow: false,
            openPush: false,
            pushData: '',
            openPrintList: false,                                 //打印组件容器显示标记
            printListShow: false,                                 //打印组件显示标记
            openBtnHide: false,                                   //按钮组件容器显示标记
@@ -332,9 +374,12 @@
            rowHideShow: false,                                   //列设置组件容器显示标记
            barCodeDetailShow: false,                             //条码明细组件容器显示标记
            packStockDetailShow: false,                            //包装容器出入库明细容器显示标记
            openVolume: false,                                    //维护零单占用体积弹窗标记
            openData: false,                                                           //数据弹窗
            dialogTypeNum: null,                                                       //部门弹窗1,仓库弹窗2
            gyCarShow: false,                                                          //车辆数据组件显示标记
            gyDriverShow: false,                                                       //司机数据组件显示标记
            deptform: {},                                                              //弹窗选中数据
            // 查询参数
            sWhere: '',                                                   // 拼接过滤条件
            queryParams: {                                                // form数据
@@ -370,7 +415,8 @@
            lastSelectedRow: null,                                        // 上一次选中的行
            selectedRow: null,                                            // 当前选中的行
            rowForm: {},                                                  // 当选中的只有一行时,更新数据为该选中的行。
            formVolume: {},                                               // 维护零单占用体积表单。
            rulesVolume: {},                                               // 维护零单占用体积表单验证。
            tyResList: [],                                                // 列表数据,用于导出
            titleData: ["HInterID", "HEntryID", "HBillStatus", "HMaterID", "HPreventErrMouldID", "HOrgID"],           // 不需要显示的字段 可扩展
            btResList: [],                                                // 列表表头数据。用于列设置
@@ -421,6 +467,7 @@
        //#region 多选框选中数据
        handleSelectionChange(selection) {
            // this.rowForm = {}
            this.rowList = selection
            this.ids = selection.map(item => item.HInterID)
            this.single = selection.length != 1
            this.multiple = !selection.length
@@ -548,6 +595,7 @@
            // if (this.queryParams.HOrgID) {
            //     this.sWhere += " and HOrgID = '" + this.queryParams.HOrgID + "'";
            // }
            this.clearData()
            this.getList()
        },
        //#endregion
@@ -562,7 +610,7 @@
            this.loading = true
            // 列表查询
            axios.get(this.baseURL + '/WLYayBillController/GetListPage', {
            axios.get(this.$baseUrl + '/WLYayBillController/GetListPage', {
                params: {
                    "sWhere": this.sWhere,
                    "user": sessionStorage["HUserName"],
@@ -665,8 +713,8 @@
        //#region 删除
        handleDelete() {
            this.$modal.confirm('确认要删除吗,删除后不能恢复').then(() => {
                axios.get(this.baseURL + "/WLYayBillController/deleteBill", {
                    params: { 'HItemID': this.rowForm.HInterID.toString(), 'user': sessionStorage["HUserName"] }
                axios.get(this.$baseUrl + "/Cg_ContractTransportBillListController/DeleteBill", {
                    params: { 'HInterID': this.rowForm.HInterID.toString(), 'user': sessionStorage["HUserName"] }
                }).then(response => {
                    if (response.data.count == 1) {
                        this.handleQuery()
@@ -692,7 +740,7 @@
            }
            this.$modal.confirm(confirmMes).then(() => {
                axios.get(this.baseURL + "/WLYayBillController/ConfrimBillNo", {
                axios.get(this.$baseUrl + "/WLYayBillController/ConfrimBillNo", {
                    params: { 'HInterID': this.rowForm.HInterID.toString(), "IsAudit": 0, 'CurUserName': sessionStorage["HUserName"] }
                }).then(response => {
                    let result = response.data
@@ -710,7 +758,7 @@
        },
        //#endregion
         //#region 其他确认
        //#region 其他确认
        set_ConfirmOtherBill(nums) {
            var confirmMes = "";
            if (nums === 1) {
@@ -728,7 +776,7 @@
                confirmMes = "是否确认承运商确认时间?"
            }
            this.$modal.confirm(confirmMes).then(() => {
                axios.get(this.baseURL + "/WLYayBillController/ConfrimOtherBillNo", {
                axios.get(this.$baseUrl + "/WLYayBillController/ConfrimOtherBillNo", {
                    params: { 'HInterID': this.rowForm.HInterID.toString(), "IsAudit": nums, 'CurUserName': sessionStorage["HUserName"] }
                }).then(response => {
                    let result = response.data
@@ -745,107 +793,79 @@
            }).catch(() => { })
        },
        //#endregion
         //#region 维护零单占用体积
        //#region 维护零单占用体积
        //#region 维护零单占用体积重置
        resetVolume() {
            this.formVolume = {
                HInterID: 0,
                HEntryID0: 0,
                currentVolume: 0,
                单据号: ''
            }
        },
        //#endregion
        //#region 维护零单占用体积重置
        handleVolume(form) {
            this.resetVolume()
            axios.get(this.$baseUrl + "/WLYayBillController/WL_YayBillDetail", {
                params: { 'HID': form.HInterID }
            }).then(response => {
                console.log(response.data.data.h_v_WL_YayBillEdit)
                // this.formVolume = response.data.data.h_v_WL_YayBillEdit[form.HEntryID-1]
                this.formVolume = form
                this.openVolume = true
            })
        },
        //#endregion
        //#region 下推运单费用
        SelectPayWayBill() {
            this.editShow = true
            this.openEdit = true
            this.OperationType = 4
        },
        //关闭下推页面
        pushClose(val) {
            this.open = val
            this.pushShow = false
            this.openPush = val
            this.clearData()
            this.getList()
        },
        //#endregion
        cancelVolume() {
            this.openVolume = false
            this.resetVolume()
        },
        //#region 维护零单占用体积提交
        set_HScatteredVolumeList() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].HInterID.toString();
                    var HEntryID = data[0].HEntryID.toString();
                    var currentVolume = data[0]["零单占用体积"] || 0; // 获取当前零单占用体积,如果没有则为0
                    // 弹出层,包含label和输入框
                    layer.open({
                        type: 1,
                        title: '维护零单占用体积',
                        area: ['400px', '250px'],
                        content:
                            '<div style="padding: 20px;">' +
                            '   <div class="layui-form-item">' +
                            '       <label class="layui-form-label">单据号:</label>' +
                            '       <div class="layui-input-block">' +
                            '           <input type="text" class="layui-input" value="' + (data[0].单据号 || '') + '" readonly style="background-color: #f2f2f2;">' +
                            '       </div>' +
                            '   </div>' +
                            '   <div class="layui-form-item">' +
                            '       <label class="layui-form-label">零单占用体积:</label>' +
                            '       <div class="layui-input-block">' +
                            '           <input type="number" id="scatteredVolume" class="layui-input" value="' + currentVolume + '" placeholder="请输入零单占用体积" step="0.01" min="0">' +
                            '       </div>' +
                            '   </div>' +
                            '   <div class="layui-form-item" style="margin-top: 30px; text-align: center;">' +
                            '       <span style="color: #666; font-size: 12px;">注:请输入数字,支持两位小数</span>' +
                            '   </div>' +
                            '</div>',
                        btn: ['确定', '取消'],
                        yes: function (index, layero) {
                            var volume = $('#scatteredVolume').val();
                            if (!volume || volume === '') {
                                layer.msg('请输入零单占用体积', { icon: 2 });
                                return;
                            }
                            if (isNaN(volume) || parseFloat(volume) < 0) {
                                layer.msg('请输入有效的正数', { icon: 2 });
                                return;
                            }
                            var wait = layer.load();
                            $.ajax({
                                url: GetWEBURL() + '/WLYayBillController/updateBillMEs',
                                type: "GET",
                                data: {
                                    "HInterID": InterID,
                                    "HEntryID": HEntryID,
                                    "ScatteredVolume": volume,
                                    "CurUserName": sessionStorage["HUserName"]
                                },
                                success: function (result) {
                                    layer.close(wait);
                                    if (result.count == 1) {
                                        layer.msg(result.Message, { icon: 1 }, function () {
                                            layer.close(index);
                                            get_FastQuery();
                                        });
                                    } else {
                                        layer.alert(result.code + result.Message, { icon: 5 });
                                    }
                                },
                                error: function (xhr, status, error) {
                                    layer.close(wait);
                                    layer.alert("接口请求失败: " + error, { icon: 5 });
                                }
                            });
                        },
                        btn2: function (index, layero) {
                        },
                        success: function (layero, index) {
                            // 弹窗成功打开后,绑定enter键提交
                            $('#scatteredVolume').on('keypress', function (e) {
                                if (e.keyCode === 13) {
                                    layero.find('.layui-layer-btn0').click();
                                }
                            });
                            $('#scatteredVolume').focus().select();
                        }
                    });
                } else {
                    layer.msg('请选择一行数据!', { icon: 2 });
            axios.get(this.$baseUrl + "/WLYayBillController/updateBillMEs", {
                params: {
                    'HInterID': this.formVolume.HInterID.toString(),
                    "HEntryID": this.formVolume.HEntryID.toString(),
                    "ScatteredVolume": this.formVolume.currentVolume,
                    'CurUserName': sessionStorage["HUserName"]
                }
            },
            //#endregion
            }).then(response => {
                let result = response.data
                if (result.count == 1) {
                    this.handleQuery()
                    this.openVolume = true
                    this.$modal.msgSuccess(result.Message)
                } else {
                    this.$modal.msgError(result.code + result.Message);
                }
            }).catch(error => {
                console.log(error)
                this.$modal.msgError("接口请求失败!");
            });
        },
        //#endregion
        //#endregion
        //#region 审核/反审核
        set_CheckBill(num, form) {
            var InterID = form.hmainid || form.HInterID
            //逻辑审核方法
            axios.get(this.baseURL + "/WLYayBillController/AuditWLYayBill", {
            axios.get(this.$baseUrl + "/WLYayBillController/AuditWLYayBill", {
                params: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"] }
            }).then(response => {
                let result = response.data
@@ -861,11 +881,43 @@
            });
        },
        //#endregion
        //#region 打开下推组件弹窗
        handlePush() {
            if (this.rowList && this.rowList.length > 0) {
                var dataArray = [];
                for (var i = 0; i < this.rowList.length; i++) {
                    if (this.rowList[i].单据状态 != "已审核") {
                        this.$modal.msgError("下推失败!所选单据【" + this.rowList[i].单据号 + "】不为已审核状态,不允许下推!")
                        return;
                    }
                    if (this.rowList[i].HQtyMust <= 0) {
                        this.$modal.msgError("下推失败!所选单据【" + this.rowList[i].单据号 + "】对应可下推数量必须大于 0 !")
                        return;
                    }
                    var temp = {
                        "HInterID": this.rowList[i].HInterID
                        , "HEntryID": this.rowList[i].HEntryID
                        , "HBillStatus": this.rowList[i].单据状态
                    }
                    dataArray.push(temp);
                }
                var datajson = {
                    "data": dataArray
                };
                this.pushData = JSON.stringify(datajson)
                this.pushShow = true
                this.openPush = true
            } else {
                this.$modal.msgError("请选择数据下推!")
            }
        },
        //#endregion
        //#region 关闭/反关闭
        set_CloseBills(num) {
            var InterID = form.hmainid || form.HInterID
            //逻辑审核方法
            axios.get(this.baseURL + "/Cg_ContractTransportBillEdit/CloseCg_ContractTransportBillEdit", {
            axios.get(this.$baseUrl + "/Cg_ContractTransportBillEdit/CloseCg_ContractTransportBillEdit", {
                params: { "HInterID": InterID, "Type": num, "CurUserName": sessionStorage["HUserName"] }
            }).then(response => {
                let result = response.data
@@ -885,7 +937,7 @@
        set_DropBill(num) {
            var InterID = form.hmainid || form.HInterID
            //逻辑审核方法
            axios.get(this.baseURL + "/Cg_ContractTransportBillEdit/DropCg_ContractTransportBillEdit", {
            axios.get(this.$baseUrl + "/Cg_ContractTransportBillEdit/DropCg_ContractTransportBillEdit", {
                params: { "HInterID": InterID, "Type": num, "CurUserName": sessionStorage["HUserName"] }
            }).then(response => {
                let result = response.data
@@ -914,7 +966,7 @@
        },
        DisPlay_HideColumn(HModName, user, option, dataOption) {
            this.totalNameList = []
            axios.get(this.baseURL + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', {
            axios.get(this.$baseUrl + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', {
                params: {
                    "HModName": HModName,
                    "user": user,
@@ -1066,7 +1118,7 @@
            } else if (this.rowForm.单据状态 != "已审核" && !this.defaintOperationByCompanyName()) {
                this.$modal.msgError("打印失败!原因:单据状态不为'已审核'状态!!");
            } else {
                axios.get(this.baseURL + "/Kf_SellOutBill/CheckSellOutBill_IsExist", {
                axios.get(this.$baseUrl + "/Kf_SellOutBill/CheckSellOutBill_IsExist", {
                    params: { "HInterID": this.rowForm.HInterID }
                }).then(response => {
                    var result = response.data
@@ -1119,6 +1171,8 @@
            this.tableShow = true
            this.openEdit = false
            this.editShow = false
            this.pushShow = false
            this.openPush = false
            this.handleQuery()
        },
        //#endregion
@@ -1126,7 +1180,7 @@
        //#region 获取公司名,根据公司进行定制化开发
        defaintOperationByCompanyName() {
            var result = false;
            axios.get(this.baseURL + '/Xt_getInfo/getCompanyName').then(response => {
            axios.get(this.$baseUrl + '/Xt_getInfo/getCompanyName').then(response => {
                var data1 = response.data
                if (data1.count == 1) {
                    if (data1.data == "水务") {
@@ -1139,6 +1193,99 @@
            return result;
        },
        //#endregion
        //#region 数据弹窗
        //#region 打开数据列表弹窗
        openDataDialog(num, row) {
            this.showReset()
            if (num == 14) {
                this.dialogTitle = '车辆列表'
                this.gyCarShow = true
                this.openData = true
            } else if (num == 15) {
                this.dialogTitle = '司机列表'
                this.gyDriverShow = true
                this.openData = true
            }
        },
        //#region 将数据弹窗全部取消加载
        showReset() {
            this.gyCarShow = false
            this.gyDriverShow = false
        },
        //#endregion
        //#endregion
        //#region 弹窗数据双击返回表单赋值事件
        async dbEmitData(deptRow, num) {
            let IsAudit = null
            if (num == 14) {
                IsAudit = 1
            } else if (num == 15) {
                IsAudit = 2
            }
            try {
                const response = await axios.get(this.baseURL + '/WLYayBillController/selectDriver', {
                    params: {
                        "HInterID": this.rowForm.HInterID.toString(),
                        "HcheckID": deptRow.HItemID,
                        "IsAudit": IsAudit,
                        "CurUserName": sessionStorage["HUserName"]
                    },
                });
                if (response.data.code == 1) {
                    // return response.data.data[0];
                    if (num == 14) {
                        this.gyCarShow = false
                        this.openData = false
                        this.$modal.msgSuccess(response.data.msg || "车辆添加成功");
                        num = 15
                        this.$nextTick(() => {
                            this.gyDriverShow = true
                            this.openData = true
                        })
                    } else if (num == 15) {
                        this.gyDriverShow = false
                        this.openData = false
                        this.$modal.msgSuccess(response.data.msg || "司机添加成功");
                    }
                } else {
                    this.$modal.msgError(response.data.msg || "获取源单数据失败");
                }
            } catch (error) {
                this.$modal.msgError("获取源单数据时发生错误,请稍后重试!");
            }
        },
        //#endregion
        //#region 弹窗数据单击事件
        emitData(deptRow, num) {
            this.dialogTypeNum = num
            this.deptform = deptRow
        },
        //#endregion
        //#region 弹窗确定事件
        deptClickSub() {
            this.dbEmitData(this.deptform, this.dialogTypeNum)
            this.deptform = {}
        },
        //#endregion
        //#region 弹窗取消事件
        deptClose() {
            this.deptform = {}
            this.openData = false
        },
        //#endregion
        //#endregion
        //清除选中数据的缓存
        clearData() {
            this.ids = []
            this.multiple = true
            this.single = true
            this.OperationType = 0
            this.copyType = 0
        },
    }
};
</script>