chenhaozhe
2025-12-01 dc984ce6a4d20b85d64fd0a909cf49c640aec5aa
src/views/component/HSourceReportHtml/index.vue
@@ -2,13 +2,19 @@
    <div style="padding: 10px; position: relative;">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="78px" class="searchBox">
            <el-form-item label="单据号" prop="HBillNo" style="margin-left: 100px">
                <el-input v-model="queryParams.HBillNo" placeholder="请输入单据号" @keyup.enter.native="handleQuery" />
                <el-input v-model="queryParams.HBillNo" placeholder="请输入单据号" style="width: 150px" />
            </el-form-item>
            <el-form-item label="部门">
            <el-form-item label="部门" label-width="48px">
                <el-select v-model="queryParams.HDeptName" placeholder="请选择" style="width: 150px">
                    <el-option v-for="(item, index) in HDeptList" :key="index" :label="item.HName"
                        :value="item.HName" />
                        :value="item.HItemID" />
                </el-select>
            </el-form-item>
            <el-form-item label="流转卡号" prop="HProcExchBillNo" v-if="HSouceBillType == '生产入库单'">
                <el-input v-model="queryParams.HProcExchBillNo" placeholder="请输入流转卡号" style="width: 150px" />
            </el-form-item>
            <el-form-item label="物料编码" prop="PartNumber">
                <el-input v-model="queryParams.PartNumber" placeholder="请输入物料编码" style="width: 150px" />
            </el-form-item>
            <el-form-item label-width="78px">
                <el-button type="primary" icon="el-icon-search" @click="handleQuery">
@@ -18,21 +24,33 @@
            <el-collapse v-model="activeSeach">
                <el-collapse-item title="更多" name="1">
                    <el-card class="box-card">
                        <el-form-item label="部门名称" prop="HDepartName">
                            <el-input v-model="queryParams.HDepartName" placeholder="请输入部门名称"
                                @keyup.enter.native="HDepartName" />
                        <el-form-item label="物料名称" prop="PartName">
                            <el-input v-model="queryParams.PartName" placeholder="请输入物料名称" />
                        </el-form-item>
                        <el-form-item label="物料代码" prop="HMaterNumber">
                            <el-input v-model="queryParams.HMaterNumber" placeholder="请输入物料代码"
                                @keyup.enter.native="handleQuery" />
                        <el-form-item label="状态" prop="HBillStatus">
                            <el-select v-model="queryParams.HBillStatus" placeholder="请选择">
                                <el-option label="计划" value="计划" />
                                <el-option label="计划确认" value="计划确认" />
                                <el-option label="下达" value="下达" />
                                <el-option label="开工" value="开工" />
                                <el-option label="完工" value="完工" />
                                <el-option label="结案" value="结案" />
                                <el-option label="结案" value="结算" />
                            </el-select>
                        </el-form-item>
                        <el-form-item label="物料名称" prop="HMaterName">
                            <el-input v-model="queryParams.HMaterName" placeholder="请输入物料名称"
                                @keyup.enter.native="handleQuery" />
                        <el-form-item label="领料状态" prop="HSPickMtrlStatus" v-if="HSouceBillType == '生产订单'">
                            <el-select v-model="queryParams.HSPickMtrlStatus" placeholder="请选择">
                                <el-option label="未领料" value="未领料" />
                                <el-option label="部分领料" value="部分领料" />
                                <el-option label="全部领料" value="全部领料" />
                                <el-option label="超额领料" value="超额领料" />
                            </el-select>
                        </el-form-item>
                        <el-form-item label="仓库" prop="HWHID">
                            <el-input v-model="queryParams.HWHID" placeholder="请输入仓库"
                                @keyup.enter.native="handleQuery" />
                        <el-form-item label="是否排产" prop="HIsScheduling" v-if="HSouceBillType == '生产订单'">
                            <el-select v-model="queryParams.HIsScheduling" placeholder="请选择">
                                <el-option label="已排产" value="已排产" />
                                <el-option label="未排产" value="未排产" />
                            </el-select>
                        </el-form-item>
                        <div slot="header" class="clearfix"><span>过滤</span></div>
                        <div>
@@ -54,8 +72,7 @@
                                            </el-select>
                                        </el-col>
                                        <el-col :span="11">
                                            <el-input v-model="queryParams.ColContent1" placeholder="请输入" clearable
                                                @keyup.enter.native="handleQuery" />
                                            <el-input v-model="queryParams.ColContent1" placeholder="请输入" clearable />
                                        </el-col>
                                    </el-row>
                                </el-form-item>
@@ -166,10 +183,12 @@
            queryParams: {
                HBillNo: "",
                HDeptName: '',
                HDepartName: "",
                HWHID: null,
                HMaterNumber: "",
                HMaterName: "",
                HProcExchBillNo: "",
                PartNumber: "",
                PartName: "",
                HBillStatus: '开工',
                HSPickMtrlStatus: "",
                HIsScheduling: "",
                ColName1: "",
                ColName2: "",
                ColName: "",
@@ -266,6 +285,17 @@
            if (this.pageSize == 0) {
                this.pageSize = 50;
            }
            if (this.queryParams.HBillStatus &&this.HSouceBillType == '生产订单') {
                this.sWhere += " and 状态 = '" + this.queryParams.HBillStatus + "'";
            }
            if (this.HSouceBillType == '生产订单') {
                this.queryParams.HIsScheduling = '已排产'
                if (sessionStorage["Organization"] == "九菱电机") {
                    if (this.queryParams.HIsScheduling) {
                        this.sWhere += this.queryParams.HIsScheduling == "未排产" ? "and 是否排产 = ''" : " and 是否排产 = '" + this.queryParams.HIsScheduling + "'"
                    }
                }
            }
            // 列表
            axios.get(this.baseURL + "/Sc_BarCode/ReportFromBillList", {
                params: {
@@ -293,6 +323,10 @@
                            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: "合计" });
@@ -335,45 +369,45 @@
                    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;
                }
                    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) => {
@@ -640,17 +674,28 @@
            if (this.queryParams.HBillNo) {
                this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
            }
            if (this.queryParams.HDepartName) {
                this.sWhere += " and 部门名称 like '%" + this.queryParams.HDepartName + "%'";
            if (this.queryParams.HProcExchBillNo &&this.HSouceBillType == '生产入库单') {
                this.sWhere += " and 流转卡号 like '%" + this.queryParams.HProcExchBillNo + "%'";
            }
            if (this.queryParams.HWHID) {
                this.sWhere += " and 仓库 like '%" + this.queryParams.HWHID + "%'";
            if (this.queryParams.HDeptName) {
                this.sWhere += " and HDeptID = '" + this.queryParams.HDeptName + "'";
            }
            if (this.queryParams.HMaterNumber) {
                this.sWhere += " and 物料代码 like '%" + this.queryParams.HMaterNumber + "%'";
            if (this.queryParams.PartNumber) {
                this.sWhere += " and 物料代码 like '%" + this.queryParams.PartNumber + "%'";
            }
            if (this.queryParams.HMaterName) {
                this.sWhere += " and 物料名称 like '%" + this.queryParams.HMaterName + "%'";
            if (this.queryParams.PartName) {
                this.sWhere += " and 物料名称 like '%" + this.queryParams.PartName + "%'";
            }
            if (this.queryParams.HBillStatus &&this.HSouceBillType == '生产订单') {
                this.sWhere += " and 状态 like '%" + this.queryParams.HBillStatus + "%'";
            }
            if (sessionStorage["Organization"] == "九菱电机" && this.HSouceBillType == '生产订单') {
                if (this.queryParams.HIsScheduling) {
                    this.sWhere += " and 领料状态 like '%" + this.queryParams.HIsScheduling + "%'";
                }
                if (this.queryParams.HIsScheduling) {
                    this.sWhere += this.queryParams.HIsScheduling == "未排产" ? "and 是否排产 = ''" : " and 是否排产 = '" + this.queryParams.HIsScheduling + "'"
                }
            }
            this.getList();
        },