wangyi
2026-02-28 a1cc3f87d24ae2a19295c7b38faa17228cd863ec
src/views/logistics/transportGPS/WL_YayBill.vue
@@ -171,8 +171,12 @@
                    @click="handleVolume(rowForm)">维护零单占用体积</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-circle-check" size="mini" :disabled="single"
                    @click="SelectPayWayBill()">下推运单费用</el-button>
                <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"
@@ -281,10 +285,18 @@
            <!-- 包装容器出入库明细 -->
            <PackStockDetail :visible.sync="packStockDetailShow" ref="packStockDetail" />
            <!-- 下推 -->
            <el-dialog title="下推" :visible.sync="selectEdit" width="1480px" append-to-body class="xsckdBox"
            <el-dialog title="下推运单结算单" :visible.sync="openPush" width="1480px" append-to-body class="xsckdBox"
                @close="close">
                <edit :OperationType=OperationType :linterid=this.rowForm.HInterID :HEntryID=this.rowForm.HEntryID
                    :copyType="copyType" @editClose="editClose" v-if="TranEditShow" />
                <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>
@@ -296,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: { BarCodeDetail,PackStockDetail,Edit,PayMentOtherBillTranEdit,RowSettings,PrintList},
    components: { BarCodeDetail, PackStockDetail, Edit, RowSettings, PrintList, PayMentOtherBillTranEdit, GyCar, GyDriver },
    data() {
        return {
            baseURL: process.env.VUE_APP_BASE_API,                //后端接口前缀(后端服务器ip地址)
@@ -344,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,                                   //按钮组件容器显示标记
@@ -358,8 +375,11 @@
            barCodeDetailShow: false,                             //条码明细组件容器显示标记
            packStockDetailShow: false,                            //包装容器出入库明细容器显示标记
            openVolume: false,                                    //维护零单占用体积弹窗标记
            selectEdit: false,
            TranEditShow: false,
            openData: false,                                                           //数据弹窗
            dialogTypeNum: null,                                                       //部门弹窗1,仓库弹窗2
            gyCarShow: false,                                                          //车辆数据组件显示标记
            gyDriverShow: false,                                                       //司机数据组件显示标记
            deptform: {},                                                              //弹窗选中数据
            // 查询参数
            sWhere: '',                                                   // 拼接过滤条件
            queryParams: {                                                // form数据
@@ -447,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
@@ -574,6 +595,7 @@
            // if (this.queryParams.HOrgID) {
            //     this.sWhere += " and HOrgID = '" + this.queryParams.HOrgID + "'";
            // }
            this.clearData()
            this.getList()
        },
        //#endregion
@@ -801,6 +823,14 @@
            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
@@ -849,6 +879,38 @@
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        //#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 关闭/反关闭
@@ -1109,6 +1171,8 @@
            this.tableShow = true
            this.openEdit = false
            this.editShow = false
            this.pushShow = false
            this.openPush = false
            this.handleQuery()
        },
        //#endregion
@@ -1129,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>