qq_41295110
2025-12-04 05fb7af4f0316fdae54f52076509e582ca5e1e4c
src/views/component/HSourceReportHtml/index.vue
@@ -285,7 +285,7 @@
            if (this.pageSize == 0) {
                this.pageSize = 50;
            }
            if (this.queryParams.HBillStatus &&this.HSouceBillType == '生产订单') {
            if (this.queryParams.HBillStatus && this.HSouceBillType == '生产订单') {
                this.sWhere += " and 状态 = '" + this.queryParams.HBillStatus + "'";
            }
            if (this.HSouceBillType == '生产订单') {
@@ -306,111 +306,117 @@
                    limit: this.pageSize,
                },
            }).then((response) => {
                console.log(response)
                this.tyResList = response.data.data; //总数据
                let data1 = response.data;
                let option = [];
                if (data1.code == 1) {
                    this.btResList = data1.list; //接口表头数据
                    this.total = data1.count;
                    var data = []; //列字段数据
                    var col = [];
                    var totalArray = ["件数"];
                    //给空的数组赋值
                    for (var key in data1.list) {
                        //循序遍历数组
                        data.push({
                            id: data1.list[key].ColmCols,
                            name: data1.list[key].ColmCols,
                            Type: data1.list[key].ColmType,
                        }); //从每个对象中提取数据
                        var patrn = new RegExp(/^h/i);
                        if (patrn.test(data1.list[key].ColmCols)) {
                            this.titleData[key] = data1.list[key].ColmCols;
                        }
                // if (data1.code == 1) {
                this.btResList = data1.list; //接口表头数据
                this.total = data1.count;
                var data = []; //列字段数据
                var col = [];
                var totalArray = ["件数"];
                //给空的数组赋值
                for (var key in data1.list) {
                    //循序遍历数组
                    data.push({
                        id: data1.list[key].ColmCols,
                        name: data1.list[key].ColmCols,
                        Type: data1.list[key].ColmType,
                    }); //从每个对象中提取数据
                    var patrn = new RegExp(/^h/i);
                    if (patrn.test(data1.list[key].ColmCols)) {
                        this.titleData[key] = data1.list[key].ColmCols;
                    }
                    //在列表左边添加勾选框
                    col.push({ type: "checkbox", fixed: "left", totalRowText: "合计" });
                    for (var i = 0; i < data.length; i++) {
                        //遍历data数组重的数据
                        if (this.titleData.indexOf(data[i].name) > -1) {
                            //检查data【i】.name是否在数组中  //计算列
                            col.push({
                                field: data[i].id,
                                title: data[i].name,
                                align: "center",
                                hide: true,
                            }); //隐藏id列
                        } else if (
                            totalArray.indexOf(data[i].name) > -1 ||
                            data[i].Type == "Decimal" ||
                            data[i].Type == "Int32"
                        ) {
                            //计算列
                            col.push({
                                field: data[i].id,
                                title: data[i].name,
                                align: "center",
                                sort: true,
                                totalRow: true,
                                width: 120,
                            });
                        } else {
                            col.push({
                                field: data[i].id,
                                title: data[i].name,
                                align: "center",
                                sort: true,
                                width: 200,
                            });
                        }
                    }
                    option.cols = [col];
                    this.dataList = option;
                    option.data = data1.data;
                    var result = data1.data;
                    option.data = result;
                    switch (this.HSouceBillType) {
                        case '生产订单':
                            this.HModName = "Sc_ICMOBill_3710";
                            break;
                        case '生产汇报单':
                            this.HModName = "Sc_ICMOReportBill_3711";
                            break;
                        case '采购订单':
                            this.HModName = "Cg_POOrderBill_1102";
                            break;
                        case '收料通知单':
                            this.HModName = "Cg_POInStockBill_1103";
                            break;
                        case '委外订单':
                            this.HModName = "WW_EntrustOrderBill_1601";
                            break;
                        case '生产入库单':
                            $("#HProcExchBillNoHidden").show();
                            this.HModName = "ProductInBill_1202";
                            break;
                        case '采购入库单':
                            this.HModName = "POStockInBill_1201";
                            break;
                        case '销售退货':
                            this.HModName = "SellOutBackBill_1247";
                            break;
                        case '生产退料':
                            this.HModName = "MateOutBackBill_1244";
                            break;
                        case '工序流转卡':
                            this.HModName = "ProcessExchangeBill_3772";
                            break;
                        case '销售出库单':
                            this.HModName = "SellOutBill_1205";
                            break;
                        case '领料出库单':
                            this.HModName = "MateOutBill_1204";
                            break;
                    }
                    this.DisPlay_HideColumn(this.HModName, sessionStorage["HUserName"], option, this.dataList);
                }
                //在列表左边添加勾选框
                col.push({ type: "checkbox", fixed: "left", totalRowText: "合计" });
                for (var i = 0; i < data.length; i++) {
                    //遍历data数组重的数据
                    if (this.titleData.indexOf(data[i].name) > -1) {
                        //检查data【i】.name是否在数组中  //计算列
                        col.push({
                            field: data[i].id,
                            title: data[i].name,
                            align: "center",
                            hide: true,
                        }); //隐藏id列
                    } else if (
                        totalArray.indexOf(data[i].name) > -1 ||
                        data[i].Type == "Decimal" ||
                        data[i].Type == "Int32"
                    ) {
                        //计算列
                        col.push({
                            field: data[i].id,
                            title: data[i].name,
                            align: "center",
                            sort: true,
                            totalRow: true,
                            width: 120,
                        });
                    } else {
                        col.push({
                            field: data[i].id,
                            title: data[i].name,
                            align: "center",
                            sort: true,
                            width: 200,
                        });
                    }
                }
                option.cols = [col];
                this.dataList = option;
                if (data1.code == 0) {
                    data1.data = []
                }
                option.data = data1.data;
                var result = data1.data;
                option.data = result;
                switch (this.HSouceBillType) {
                    case '生产订单':
                        this.HModName = "Sc_ICMOBill_3710";
                        break;
                    case '生产汇报单':
                        this.HModName = "Sc_ICMOReportBill_3711";
                        break;
                    case '采购订单':
                        this.HModName = "Cg_POOrderBill_1102";
                        break;
                    case '收料通知单':
                        this.HModName = "Cg_POInStockBill_1103";
                        break;
                    case '委外订单':
                        this.HModName = "WW_EntrustOrderBill_1601";
                        break;
                    case '生产入库单':
                        $("#HProcExchBillNoHidden").show();
                        this.HModName = "ProductInBill_1202";
                        break;
                    case '采购入库单':
                        this.HModName = "POStockInBill_1201";
                        break;
                    case '销售退货':
                        this.HModName = "SellOutBackBill_1247";
                        break;
                    case '生产退料':
                        this.HModName = "MateOutBackBill_1244";
                        break;
                    case '工序流转卡':
                        this.HModName = "ProcessExchangeBill_3772";
                        break;
                    case '销售出库单':
                        this.HModName = "SellOutBill_1205";
                        break;
                    case '领料出库单':
                        this.HModName = "MateOutBill_1204";
                        break;
                }
                this.DisPlay_HideColumn(this.HModName, sessionStorage["HUserName"], option, this.dataList);
                // }
            }).catch((error) => {
                console.log(error)
                this.$modal.msgError("接口请求失败!");
            });
        },
@@ -674,7 +680,7 @@
            if (this.queryParams.HBillNo) {
                this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
            }
            if (this.queryParams.HProcExchBillNo &&this.HSouceBillType == '生产入库单') {
            if (this.queryParams.HProcExchBillNo && this.HSouceBillType == '生产入库单') {
                this.sWhere += " and 流转卡号 like '%" + this.queryParams.HProcExchBillNo + "%'";
            }
            if (this.queryParams.HDeptName) {
@@ -686,7 +692,7 @@
            if (this.queryParams.PartName) {
                this.sWhere += " and 物料名称 like '%" + this.queryParams.PartName + "%'";
            }
            if (this.queryParams.HBillStatus &&this.HSouceBillType == '生产订单') {
            if (this.queryParams.HBillStatus && this.HSouceBillType == '生产订单') {
                this.sWhere += " and 状态 like '%" + this.queryParams.HBillStatus + "%'";
            }
            if (sessionStorage["Organization"] == "九菱电机" && this.HSouceBillType == '生产订单') {