陈婷婷
2026-03-31 c9bd26c6cdac80e94e79da47c5113d95ba6e726f
src/views/logistics/transportGPS/WL_YayBill.vue
@@ -17,8 +17,14 @@
                </el-select>
            </el-form-item>
            <el-form-item label="单据号" prop="HBillNo">
                <el-input v-model="queryParams.HBillNo" placeholder="请输入单据号" @keyup.enter.native="handleQuery" />
                <el-input v-model="queryParams.HBillNo" placeholder="请输入单据号" @keyup.enter.native="handleQuery"
                    style="width: 150px;" />
            </el-form-item>
            <el-form-item label="车牌号" prop="HPlateNumber">
                <el-input v-model="queryParams.HPlateNumber" placeholder="请输入车牌号" @keyup.enter.native="handleQuery"
                    style="width: 120px;" />
            </el-form-item>
            <el-form-item label="组织" prop="HOrgID">
                <el-select v-model="queryParams.HOrgID" placeholder="请选择组织">
                    <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name"
@@ -143,8 +149,32 @@
                </el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
                    @click="set_CheckBill(0, form = rowForm)">审核</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
                    @click="set_CheckBill(1, form = rowForm)">反审核</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-circle-check" size="mini" :disabled="single"
                    @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="set_ConfirmBill">供应商确认</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
                    @click="hanleCarOrDriver(form = rowForm)">分配车辆和司机</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"
                    @click="openDataDialog(15, form = rowForm)">分配司机</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-circle-check" size="mini" :disabled="single"
@@ -162,21 +192,9 @@
                <el-button type="primary" icon="el-icon-circle-check" size="mini" :disabled="single"
                    @click="set_ConfirmOtherBill(4)">到货签收确认</el-button>
            </el-col>
            <!-- <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-circle-check" size="mini" :disabled="single"
                    @click="set_CheckBill(0, form = rowForm)">分配司机</el-button>
            </el-col> -->
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-circle-check" size="mini" :disabled="single"
                    @click="handleVolume(rowForm)">维护零单占用体积</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
                    @click="set_CheckBill(0, form = rowForm)">审核</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
                    @click="set_CheckBill(1, form = rowForm)">反审核</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"
@@ -195,22 +213,14 @@
                    @click="set_DropBill(2, form = rowForm)">反作废</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-printer" size="mini" @click="get_PrintReport">打印</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-date" size="mini" @click="handleRowHide">隐藏列设置</el-button>
            </el-col>
            <!-- <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-printer" size="mini" @click="get_PrintReport">打印</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single"
                    @click="get_BarCodeDetail">条码明细</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single"
                    @click="get_PackStockDetail">包装容器出入库明细</el-button>
            </el-col>-->
        </el-row>
        <div class="tableBox" v-loading="loading">
            <el-table :data="tableData" ref="tableData" max-height="710" :summary-method="getSummaries"
@@ -247,14 +257,14 @@
            <!-- 编辑 -->
            <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>
            <!-- 打印 -->
            <el-dialog title="打印模板选择" :visible.sync="openPrintList" width="800px" append-to-body>
                <PrintList :linterid=this.rowForm.HInterID :MyMsg=this.rowForm.HInterID :Type='HBillType'
                    :HModName="HModName" @rowEditClose="rowSetClose" v-if="printListShow" />
                <PrintList :linterid='printIds' :MyMsg='printIds' :Type='HBillType' :HModName="HBillType"
                    @rowEditClose="rowSetClose" v-if="printListShow" />
                <!-- <div>111</div> -->
            </el-dialog>
@@ -264,7 +274,8 @@
                        <el-input v-model="formVolume.单据号" placeholder="请输入单据号" disabled />
                    </el-form-item>
                    <el-form-item label="零单占用体积">
                        <el-input-number v-model="formVolume.currentVolume" placeholder="请输入零单占用体积" />
                        <el-input-number v-model="formVolume.currentVolume"
                            :placeholder="`零担体积: ${formVolume.零担体积 || 0}`" />
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
@@ -276,6 +287,41 @@
            <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>
            <!-- 分配车辆和司机 -->
            <el-dialog title="分配车辆和司机" :visible.sync="openCarDriver" width="500px" append-to-body>
                <el-form ref="carDriverForm" :model="carDriverForm" :rules="carDriverRules" label-width="100px">
                    <el-form-item label="车牌号" prop="CarHNumber">
                        <el-input v-model="carDriverForm.CarHNumber" placeholder="请输入车牌号" />
                    </el-form-item>
                    <el-form-item label="车辆名称" prop="CarHName">
                        <el-input v-model="carDriverForm.CarHName" placeholder="请输入车辆名称" />
                    </el-form-item>
                    <el-form-item label="驾驶员" prop="DriverHName">
                        <el-input v-model="carDriverForm.DriverHName" placeholder="请输入驾驶员" />
                    </el-form-item>
                    <el-form-item label="身份证号" prop="DriverHIDCard">
                        <el-input v-model="carDriverForm.DriverHIDCard" placeholder="请输入身份证号" />
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="submitCarDriver">确 定</el-button>
                    <el-button @click="openCarDriver = false">取 消</el-button>
                </div>
            </el-dialog>
        </div>
    </div>
</template>
@@ -286,18 +332,20 @@
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地址)
            HModName: "Cg_ContractTransportBillMainList",
            HBillType: "Cg_ContractTransportBillMainList",
            HBillType: "WL_YayBill",
            OperationType: null,                                  //保存类型(新增1修改3)
            copyType: 0,                                          //复制标记。打开编辑组件时,用于区分编辑还是复制
            HInterID: null,
@@ -334,11 +382,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,                                   //按钮组件容器显示标记
@@ -348,12 +399,29 @@
            barCodeDetailShow: false,                             //条码明细组件容器显示标记
            packStockDetailShow: false,                            //包装容器出入库明细容器显示标记
            openVolume: false,                                    //维护零单占用体积弹窗标记
            openData: false,                                                           //数据弹窗
            openCarDriver: false,                                                      //分配车辆和司机弹窗标记
            carDriverForm: {                                                           //分配车辆和司机表单
                CarHNumber: '',
                CarHName: '',
                DriverHName: '',
                DriverHIDCard: ''
            },
            carDriverRules: {                                                          //分配车辆和司机表单验证
                CarHNumber: [{ required: true, message: '请输入车牌号', trigger: 'blur' }],
                CarHName: [{ required: true, message: '请输入车辆名称', trigger: 'blur' }],
                DriverHName: [{ required: true, message: '请输入驾驶员', trigger: 'blur' }],
                DriverHIDCard: [{ required: true, message: '请输入身份证号', trigger: 'blur' }],
            },
            dialogTypeNum: null,                                                       //部门弹窗1,仓库弹窗2
            gyCarShow: false,                                                          //车辆数据组件显示标记
            gyDriverShow: false,                                                       //司机数据组件显示标记
            deptform: {},                                                              //弹窗选中数据
            // 查询参数
            sWhere: '',                                                   // 拼接过滤条件
            queryParams: {                                                // form数据
                HBillNo: '',
                HPlateNumber: '',
                HInitTimeCycle: 29,
                sTime: '',
                eTime: '',
@@ -371,7 +439,6 @@
                ColContent2: '',
                ColContent: '',
            },
            page: 1,                                                      //page页索引
            pageSize: 0,                                                  //page页面记录数
            total: 0,                                                     //记录合计数
@@ -379,6 +446,7 @@
            totalNameList: [],                                            // 需要设置合计行的列数组
            tableData: [],                                                // 列表数据。用于table监听事件
            ids: [],                                                      // 选中行的hmainid数组
            printIds: '',                                                   //打印选择Id字段
            single: true,                                                 // 当选中的行数不为1时为true。用于禁用相关操作
            multiple: true,                                               // 当选中的行数为0时为true。用于禁用相关操作
            lastSelectedRowIndex: null,                                   // 用于记录上次点击的行索引
@@ -437,6 +505,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
@@ -486,10 +555,29 @@
            this.handleQuery()
        },
        //#endregion
        //#region 权限判断
        async set_ModCheck(ModRightNameCheck) {
            var Permission = false;
            const res = await axios.get(this.$baseUrl + '/LMES/getReportByModRightNameCheck', {
                params: {
                    "ModRightNameCheck": ModRightNameCheck,
                    "user": sessionStorage["HUserName"],
                },
            }).then(result => {
                if (result.data.count != 1) {
                    Permission = true;
                    this.sWhere = this.sWhere + " and 承运商ID =" + sessionStorage["HSupID"]
                }
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        //#endregion
        //#region 快速过滤
        handleQuery() {
        async handleQuery() {
            this.sWhere = ''
            await this.set_ModCheck("WLYayBill_SUPQuery")
            if (this.queryParams.ColName && this.queryParams.Comparator) {
                var com = "";
                switch (this.queryParams.Comparator) {
@@ -561,9 +649,15 @@
            if (this.queryParams.HBillNo) {
                this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
            }
            if (this.queryParams.HPlateNumber) {
                this.sWhere += " and 车牌号 like '%" + this.queryParams.HPlateNumber + "%'";
            }
            // if (this.queryParams.HOrgID) {
            //     this.sWhere += " and HOrgID = '" + this.queryParams.HOrgID + "'";
            // }
            console.log("swhere", this.sWhere)
            this.clearData()
            this.getList()
        },
        //#endregion
@@ -576,9 +670,9 @@
            }
            this.tableShow = false
            this.loading = true
            console.log("swhere", this.sWhere)
            // 列表查询
            axios.get(this.baseURL + '/WLYayBillController/GetListPage', {
            axios.get(this.$baseUrl + '/WLYayBillController/GetListPage', {
                params: {
                    "sWhere": this.sWhere,
                    "user": sessionStorage["HUserName"],
@@ -681,7 +775,7 @@
        //#region 删除
        handleDelete() {
            this.$modal.confirm('确认要删除吗,删除后不能恢复').then(() => {
                axios.get(this.baseURL + "/WLYayBillController/deleteBill", {
                axios.get(this.$baseUrl + "/WLYayBillController/deleteBill", {
                    params: { 'HItemID': this.rowForm.HInterID.toString(), 'user': sessionStorage["HUserName"] }
                }).then(response => {
                    if (response.data.count == 1) {
@@ -708,7 +802,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
@@ -744,7 +838,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
@@ -768,6 +862,7 @@
                HInterID: 0,
                HEntryID0: 0,
                currentVolume: 0,
                单据号: ''
            }
        },
@@ -775,23 +870,39 @@
        //#region 维护零单占用体积重置
        handleVolume(form) {
            this.resetVolume()
            axios.get(this.baseURL + "/WLYayBillController/WL_YayBillDetail", {
            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.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()
            this.handleQuery()
        },
        //#region 维护零单占用体积提交
        set_HScatteredVolumeList() {
            axios.get(this.baseURL + "/WLYayBillController/updateBillMEs", {
            axios.get(this.$baseUrl + "/WLYayBillController/updateBillMEs", {
                params: {
                    'HInterID': this.formVolume.HInterID.toString(),
                    "HEntryID": this.formVolume.HEntryID.toString(),
@@ -802,7 +913,7 @@
                let result = response.data
                if (result.count == 1) {
                    this.handleQuery()
                    this.openVolume = true
                    this.openVolume = true
                    this.$modal.msgSuccess(result.Message)
                } else {
                    this.$modal.msgError(result.code + result.Message);
@@ -818,7 +929,7 @@
        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
@@ -834,11 +945,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
@@ -858,7 +1001,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
@@ -887,7 +1030,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,
@@ -1034,29 +1177,13 @@
        //#region 打印
        get_PrintReport() {
            if (this.ids.length != 1) {
                this.$modal.msgError("请选择一行数据")
            } else if (this.rowForm.单据状态 != "已审核" && !this.defaintOperationByCompanyName()) {
                this.$modal.msgError("打印失败!原因:单据状态不为'已审核'状态!!");
            if (this.ids.length == 0) {
                this.$modal.msgError("请至少选择一行数据")
            } else {
                axios.get(this.baseURL + "/Kf_SellOutBill/CheckSellOutBill_IsExist", {
                    params: { "HInterID": this.rowForm.HInterID }
                }).then(response => {
                    var result = response.data
                    if (result.count == 1) {
                        this.printListShow = true
                        this.openPrintList = true
                        // this.$router.push({ path:'/printList', query: { linterid: this.rowForm.hmainid,MyMsg:this.rowForm.hmainid,Type:'Kf_SellOutBillList' }})
                    } else {
                        this.$modal.msgError(result.code + result.Message)
                    }
                }).catch(error => {
                    this.$modal.msgError("接口请求失败!");
                });
                this.printIds = this.ids.join(',')
                this.printListShow = true
                this.openPrintList = true
            }
            //  var content= ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=Kf_SellOutBillList', 'yes']
        },
        //#endregion
@@ -1092,6 +1219,8 @@
            this.tableShow = true
            this.openEdit = false
            this.editShow = false
            this.pushShow = false
            this.openPush = false
            this.handleQuery()
        },
        //#endregion
@@ -1099,7 +1228,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 == "水务") {
@@ -1112,6 +1241,141 @@
            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 {
                console.log(deptRow)
                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
        //#region 分配车辆和司机
        hanleCarOrDriver(form) {
            this.carDriverForm = {
                CarHNumber: '',
                CarHName: '',
                DriverHName: '',
                DriverHIDCard: ''
            }
            this.openCarDriver = true
        },
        submitCarDriver() {
            this.$refs.carDriverForm.validate((valid) => {
                if (valid) {
                    axios({
                        method: 'GET',
                        url: this.baseURL + "WLYayBillController/selectDriver1",
                        params: {
                            "CarHNumber": this.carDriverForm.CarHNumber,
                            "CarHName": this.carDriverForm.CarHName,
                            "DriverHName": this.carDriverForm.DriverHName,
                            "DriverHIDCard": this.carDriverForm.DriverHIDCard,
                            "CurUserName": sessionStorage["HUserName"],
                            "HInterID": this.rowForm.HInterID
                        },
                    }).then(response => {
                        let result = response.data
                        if (result.code == 1) {
                            this.$modal.msgSuccess(result.Message || "分配成功");
                            this.openCarDriver = false
                            this.handleQuery()
                        } else {
                            this.$modal.msgError(result.code + result.Message);
                        }
                    }).catch(error => {
                        console.log(error)
                        this.$modal.msgError("接口请求失败!");
                    });
                }
            })
        },
        //#endregion
        //清除选中数据的缓存
        clearData() {
            this.ids = []
            this.multiple = true
            this.single = true
            this.OperationType = 0
            this.copyType = 0
        },
    }
};
</script>