chenhaozhe
23 小时以前 f1fac4593c4753975560ab820c98d3ce8722127a
锦隆 添加 批量获取条码单据信息, 批量生成条码 接口
2个文件已添加
1032 ■■■■■ 已修改文件
public/static/hipirnt 标准模板.js 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong_Patch_AutoLogin.vue 964 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/static/hipirnt ±ê׼ģ°å.js
New file
@@ -0,0 +1,68 @@
function(t, e) {
  var html = `
  <style>
      table{border-top:1px solid #333;border-left:1px solid #333;border-spacing:0;background-color:#fff;width:100%}
      table td{border-bottom:1px solid #333;border-right:1px solid #333;font-size:13px;padding:5px}
      .xl65{text-align:center ;}
      </style>
      </head>
      <body>
          <table style="width:278pt"> <!--StartFragment--> <!-- è‡ªå®šä¹‰è¡¨æ ¼çš„宽度 -->
       <colgroup>
        <col width="80" style="mso-width-source:userset;mso-width-alt:2560;width:60pt">
        <col width="133" style="mso-width-source:userset;mso-width-alt:4245;width:100pt">
        <col width="34" style="mso-width-source:userset;mso-width-alt:1088;width:26pt">
        <col width="44" span="2" style="mso-width-source:userset;mso-width-alt:1408;
       width:33pt">
       </colgroup>
       <tbody>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td class></td>
         <td colspan="3" rowspan="4" class="xl65"></td>
        </tr>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td class></td>
        </tr>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td class></td>
        </tr>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td class></td>
        </tr>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td class></td>
         <td class></td>
         <td class></td>
         <td class></td>
        </tr>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td colspan="4" class="xl65"></td>
        </tr>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td colspan="4" class="xl65"></td>
        </tr>
        <tr style="height: 17.5pt;">
         <td class></td>
         <td colspan="4" class="xl65"></td>
        </tr>
        <tr style="height: 17.5pt;">
          <td class></td>
          <td colspan="4" class="xl65"></td>
         </tr>
        <!--EndFragment-->
       </tbody>
      </table>
      </body>
  `
    // ! è¿™é‡Œçš„处理很关键
    return html
    // ! è¿™é‡Œçš„处理很关键
    }
src/views/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong_Patch_AutoLogin.vue
New file
@@ -0,0 +1,964 @@
<template>
  <div style="margin: 10px;">
    <div style=" margin-bottom: 10px; border-bottom: 1px solid #f6f6f6;">
      <el-button type="primary" @click="onClickMethod_BarCodeProduce"
        :disabled="disabledFlag_BarCodeProduce">生成</el-button>
      <el-button type="primary" @click="get_PrintReport">打印</el-button>
      <el-button type="primary" @click="get_BarCodeBillList">条码档案</el-button>
      <el-button type="primary" @click="get_BarCodeBillHSEQ">条码行号查询</el-button>
    </div>
    <div style="margin: 10px; font-size: 28px; font-weight: bold; text-align: center;">条码生成</div>
    <el-form :model="initMainData" label-width="80px">
      <el-row>
        <el-col :span="6">
          <el-form-item label="日期">
            <el-date-picker v-model="initMainData.HDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"
              style="width: 100%"> </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="源单单号">
            <el-input v-model="initMainData.HMainSourceBillNo" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="采购订单号">
            <el-input v-model="initMainData.HPOOrderBillNo" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="物料代码">
            <el-input v-model="initMainData.HMaterNumber" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="物料名称">
            <el-input v-model="initMainData.HMaterName" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="规格型号">
            <el-input v-model="initMainData.HMaterModel" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="计量单位">
            <el-input v-model="initMainData.HUnitName" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="辅助属性代码">
            <el-input v-model="initMainData.HAuxPropNumber" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="辅助属性名称">
            <el-input v-model="initMainData.HAuxPropName" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="供应商代码">
            <el-input v-model="initMainData.HSupNumber" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="供应商名称">
            <el-input v-model="initMainData.HSupName" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="批号">
            <el-input v-model="initMainData.HBatchNo"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="源单数量">
            <el-input-number v-model="initMainData.HQty_SourceBill" @change="onChangeForHQty_SourceBill" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="数量/ç®±">
            <el-input-number v-model="initMainData.HMinQty" @change="onChangeForHMinQty" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="包数">
            <el-input-number v-model="initMainData.HBQty" disabled />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="尾包数量">
            <el-input-number v-model="initMainData.HEndQty" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="采购跟踪号">
            <el-input v-model="initMainData.HPOOrderBillMTO" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="复检启用">
            <el-checkbox v-model="initMainData.HReInspectionFlag" disabled>复检启用</el-checkbox>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="生产日期">
            <el-date-picker v-model="initMainData.HInspectionDate" type="date" placeholder="选择日期"
              value-format="yyyy-MM-dd" style="width: 100%"> </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="复检周期">
            <el-input-number v-model="initMainData.HInspectionCycle" disabled />天
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="复检日期">
            <el-date-picker v-model="initMainData.HReInspectionDate" type="date" placeholder="选择日期"
              value-format="yyyy-MM-dd" style="width: 100%" disabled> </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="客户订单号">
            <el-input v-model="initMainData.HSeOrderBillNo" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="产品型号">
            <el-input v-model="initMainData.HCusModel" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="组织" @change="onChangeMethod_HOrganization">
            <el-select v-model="initMainData.HOrganizationID" placeholder="请选择组织" style="width: 100%">
              <el-option v-for="(item, index) in HOrganizationList" :key="index" :value="item.ID"
                :label="item.Name"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-tabs type="border-card" v-model="SelectedTabName" style="height:400px;">
        <!-- æ¡ç åˆ—表 -->
        <el-tab-pane label="条码列表" name="BarCode">
          <el-table :data="tableData_BarCode" @selection-change="onSelectionChange_BarCode"
            :row-class-name="RowIndex_BarCode" style="width: 100%" height="900" width="100%" border
            v-if="tableData_BarCode.length > 0">
            <el-table-column type="selection" width="55" align="center" />
            <el-table-column align="center" label="序号" type="index" width="80" fixed />
            <template v-for="(item, index) in tableColumns_BarCode">
              <el-table-column :prop="item.field" :label="item.title" :key="index" show-overflow-tooltip
                :width="item.width" align="center" v-if="!item.hide">
                <template slot-scope="{row,  column }">
                  <div :style="item.style"><span>{{ row[column.label] }}</span> </div>
                </template>
              </el-table-column>
            </template>
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </el-form>
    <!-- æ‰“印弹窗 -->
    <el-dialog title="打印模板选择" :visible.sync="openPrintList" width="800px" append-to-body>
      <PrintList :linterid="rowSel.toString()" :MyMsg="rowSel.toString()" Type="HGy_BarCodeBill"
        HModName="HGy_BarCodeBill" @rowEditClose="rowSetClose" v-if="printListShow" />
    </el-dialog>
  </div>
</template>
<script>
import axios from 'axios'                                                   //axios请求方法库
import moment from 'moment';                                                //moment.js库
import PrintList from "@/views/component/printList";                        //打印
import HSourceReportHtml from '@/views/component/HSourceReportHtml'
import GyProperty from "@/views/basic/gyProperty/gyPropertyList.vue";
import Material from '@/views/gyMaterial/GyMaterial.vue'
export default {
  name: 'Gy_BarCodeBill_JinLong_AutoLogin',
  components: { HSourceReportHtml, PrintList, GyProperty, Material },
  data() {
    return {
      BillInfoProps: [], // é€’入单据信息缓存
      baseURL: process.env.VUE_APP_BASE_API,                      //后端接口访问前缀
      HModName: "Gy_BarCodeBill_JinLong_AutoLogin",               //模块名称
      disabledFlag_BarCodeProduce: false,                          //禁用标记-生成 æŒ‰é’®                                             // iframe URL
      rules: {                                                     //表头form æ ¡éªŒ
      },
      HOrganizationList: [],                                       //组织下拉列表数据
      initMainData: {                                              //表头数据初始化
        HDate: moment().format('YYYY-MM-DD')                    //日期
        , HMainSourceInterID: 0                                   //源单主ID
        , HMainSourceEntryID: 0                                   //源单子ID
        , HMainSourceBillNo: ""                                   //源单单号
        , HMainSourceBillType: ""                                 //源单类型
        , HPOOrderBillNo: ""                                      //采购订单号
        , HMaterID: 0                                             //物料ID
        , HMaterNumber: ""                                        //物料代码
        , HMaterName: ""                                          //物料名称
        , HMaterModel: ""                                         //规格型号
        , HUnitID: ""                                             //计量单位ID
        , HUnitName: ""                                           //计量单位名称
        , HAuxPropID: 0                                           //辅助属性ID
        , HAuxPropNumber: ""                                      //辅助属性代码
        , HAuxPropName: ""                                        //辅助属性
        , HBatchNo: ""                                            //批号
        , HSupID: 0                                               //供应商ID
        , HSupNumber: ""                                          //供应商代码
        , HSupName: ""                                            //供应商
        , HQty_SourceBill: 0                                      //源单数量
        , HMinQty: 0                                              //标准包装数
        , HBQty: 0                                                //包数
        , HEndQty: 0                                              //尾包数量
        , HReInspectionFlag: false                                //复检启用
        , HInspectionDate: null                                   //生产日期
        , HInspectionCycle: 0                                     //复检周期(天)
        , HReInspectionDate: null                                 //复检日期
        , HPOOrderBillMTO: ""                                     //采购跟踪号
        , HSeOrderBillNo: ""                                      //客户订单号
        , HCusModel: ""                                           //产品型号
        , HMTONo: null                                            //计划跟踪号
        , HSourceBillSEQ: 0                                       //源单行号
        , HOrganizationID: 0                                      //组织ID
        , HOrganization: ""                                       //组织名称
      },
      SelectedTabName: "BarCode",                                  //表格页签-当前选择页面name
      tableColumns_BarCode: [                                     //条码列表table åˆ—数据
        { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
        , { field: 'hmainid', title: 'hmainid', width: 100, hide: true }
        , { field: 'hsubid', title: 'hsubid', width: 100, hide: true }
        , { field: 'HinterID', title: 'HinterID', width: 100, hide: true }
        , { field: '条码类型', title: '条码类型', width: 100 }
        , { field: '条码编号', title: '条码编号', width: 120 }
        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
        , { field: '物料代码', title: '物料代码', width: 120 }
        , { field: '物料名称', title: '物料名称', width: 120 }
        , { field: '规格型号', title: '规格型号', width: 120 }
        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
        , { field: '计量单位代码', title: '计量单位代码', width: 120 }
        , { field: '计量单位', title: '计量单位', width: 120 }
        , { field: 'HAuxPropID', title: '辅助属性ID', width: 100, hide: true }
        , { field: '辅助属性代码', title: '辅助属性代码', width: 120 }
        , { field: '辅助属性', title: '辅助属性', width: 120 }
        , { field: '批号', title: '批号', width: 120 }
        , { field: '数量', title: '数量', width: 100 }
        , { field: '源单单号', title: '源单单号', width: 120 }
        , { field: '计划跟踪号', title: '计划跟踪号', width: 120 }
        , { field: '是否赠品', title: '是否赠品', width: 100 }
        , { field: 'DeptID', title: '车间ID', width: 100, hide: true }
        , { field: '车间', title: '车间', width: 120 }
        , { field: 'HSupID', title: '供应商ID', width: 100, hide: true }
        , { field: '供应商代码', title: '供应商代码', width: 120 }
        , { field: '供应商', title: '供应商', width: 120 }
        , { field: '客户条码编号', title: '客户条码编号', width: 120 }
        , { field: '客户型号', title: '客户型号', width: 120 }
        , { field: '往来单位', title: '往来单位', width: 120 }
        , { field: '销售订单号', title: '销售订单号', width: 120 }
        , { field: '销售订单行号', title: '销售订单行号', width: 120 }
        , { field: '托号', title: '托号', width: 120 }
        , { field: '总托数', title: '总托数', width: 100 }
        , { field: '条码日期', title: '条码日期', width: 120 }
        , { field: '生产入库日期', title: '生产入库日期', width: 120 }
        , { field: '生产入库单号', title: '生产入库单号', width: 120 }
        , { field: '生产入库次数', title: '生产入库次数', width: 100 }
        , { field: '销售出库日期', title: '销售出库日期', width: 120 }
        , { field: '销售出库单号', title: '销售出库单号', width: 120 }
        , { field: '销售出库次数', title: '销售出库次数', width: 100 }
        , { field: '作废标记', title: '作废标记', width: 100 }
        , { field: '作废人', title: '作废人', width: 100 }
        , { field: '备注', title: '备注', width: 120 }
        , { field: '制作人', title: '制作人', width: 100 }
        , { field: '日期', title: '日期', width: 120 }
        , { field: '计划完工日期', title: '计划完工日期', width: 120 }
        , { field: '打印次数', title: '打印次数', width: 100 }
        , { field: 'HSTOCKORGID', title: 'HSTOCKORGID', width: 100, hide: true }
        , { field: '生成组织', title: '生成组织', width: 120 }
      ],
      tableData_BarCode: [],                                       //条码列表table æ•°æ®
      RowIndex_BarCode: 0,                                         //条码列表table è¡Œç´¢å¼•
      openPrintList: false,                                         //打印弹窗显示标记
      printListShow: false,                                        //打印模板数据显示标记
      selectedData_BarCode: 0,                                     //条码列表table é€‰ä¸­æ•°æ®é›†åˆ
      tableColumns_Mater: [], // ç‰©æ–™ä¿¡æ¯ è¡¨å¤´
      tableData_Mater: [], // ç‰©æ–™ä¿¡æ¯ è¡¨ä½“
    };
  },
  async created() {
    await this.loging();                                            //自动登录
    await this.judgeIsLoging();                                           //判断是否登录,未登录则跳转回登录页面
    await this.get_OrganizationList();                              //页面初始化 èŽ·å–ç»„ç»‡ä¸‹æ‹‰åˆ—è¡¨æ•°æ®
    await this.initPageData();                                      //页面初始化
  },
  methods: {
    //#region åˆ¤æ–­æ˜¯å¦ç™»å½•,未登录则跳转回登录页面
    async judgeIsLoging() {
      if (sessionStorage["login"] != "login") {
        this.$modal.msgError("登录失效,请重新登录!!");
        this.$router.push({ path: "/" }).catch(() => { })
      }
    },
    //#endregion
    //#region é¡µé¢åˆå§‹åŒ–
    async initPageData() {
      var params = this.get_UrlVars();
      var OperationType = params[params[0]];      //操作类型
      if (OperationType == "1" || typeof (OperationType) == "undefined") {                                             //
      }
      else if (OperationType == "4") {                                        //下推
        this.setInit_PushBill();
      }
      else {
        layer.alert("未知操作类型!", { icon: 5 });
      }
    },
    //#endregion
    //#region èŽ·å–ç»„ç»‡ä¸‹æ‹‰åˆ—è¡¨æ•°æ®
    async get_OrganizationList() {
      axios.get(this.$baseUrl + '/Web/GetOrganizations', { async: false }).then(response => {
        let result = response.data
        if (result.count == 1) {
          var data = result.data;
          for (var i = 0; i < data.length; i++) {
            this.HOrganizationList.push(
              {
                ID: data[i].ID,
                Name: data[i].Name,
              }
            )
          }
          this.initMainData.HOrganizationID = sessionStorage["OrganizationID"] * 1;
        } else {
          this.$modal.msgError(result.message);
        }
      }).catch(error => {
        this.$modal.msgError("接口请求失败!" + error);
      });
    },
    //#endregion
    //#region ç»„织下拉列表变更事件
    onChangeMethod_HOrganization() {
    },
    //#endregion
    //#region æºå•数量数据变更事件
    onChangeForHQty_SourceBill() {
      if (this.initMainData.HMinQty > 0) {
        this.initMainData.HBQty = Math.floor((this.initMainData.HQty_SourceBill / this.initMainData.HMinQty) + (this.initMainData.HQty_SourceBill % this.initMainData.HMinQty == 0 ? 0 : 1));
      } else {
        this.initMainData.HBQty = 0;
      }
      if (this.initMainData.HMinQty > 0) {
        this.initMainData.HEndQty = this.initMainData.HQty_SourceBill % this.initMainData.HMinQty;
      }
    },
    //#endregion
    //#region æ ‡å‡†åŒ…装数数据变更事件
    onChangeForHMinQty() {
      if (this.initMainData.HMinQty > 0) {
        this.initMainData.HBQty = Math.floor((this.initMainData.HQty_SourceBill / this.initMainData.HMinQty) + (this.initMainData.HQty_SourceBill % this.initMainData.HMinQty == 0 ? 0 : 1));
      } else {
        this.initMainData.HBQty = 0;
      }
      if (this.initMainData.HMinQty > 0) {
        this.initMainData.HEndQty = this.initMainData.HQty_SourceBill % this.initMainData.HMinQty;
      }
    },
    //#endregion
    //#region ç”Ÿäº§æŒ‰é’®ç‚¹å‡»äº‹ä»¶æ•°æ®æ ¡éªŒ
    AllowLoadData(sSubStr) {
      var Result = true;
      //数值格式校验工具
      var ref = /^\d+(\.\d+)?$/;          //非负数正则表达式
      var ref1 = /^[1-9]\d*$/;            //正整数正则表达式
      var temp = "";
      sSubStr = JSON.parse(sSubStr);
      if (sSubStr[0].HDate == "") {
        this.$modal.msgError("日期未设置!!");
        return Result = false;
      }
      if (sSubStr[0].HSourceInterID == "0" || sSubStr[0].HSourceEntryID == "0" || sSubStr[0].HSourceBillNo == "") {
        this.$modal.msgError("源单信息有误!!【主内码:" + sSubStr[0].HSourceInterID + ";子内码:" + sSubStr[0].HSourceEntryID + ";源单号:" + sSubStr[0].HSourceBillNo + ";】");
        return Result = false;
      }
      if (sSubStr[0].HMaterID == "0") {
        this.$modal.msgError("物料信息有误!!【物料ID:" + sSubStr[0].HMaterID + ";物料代码:" + sSubStr[0].HMaterNumber + ";物料名称:" + sSubStr[0].HMaterName + ";规格型号:" + sSubStr[0].HMaterModel + ";】");
        return Result = false;
      }
      if (sSubStr[0].HSupID == "0") {
        this.$modal.msgError("供应商信息有误!!【供应商ID:" + sSubStr[0].HMaterID + ";供应商代码:" + sSubStr[0].HMaterNumber + ";供应商名称:" + sSubStr[0].HMaterName + ";】");
        return Result = false;
      }
      temp = sSubStr[0].HQty + "";
      if (temp == "0" || temp == "") {
        this.$modal.msgError("源单数量不能为0或空!!");
        return Result = false;
      } else if (!ref.test(temp)) {
        this.$modal.msgError("源单数量请输入大于0的数字!!");
        return Result = false;
      }
      temp = sSubStr[0].HMinQty + "";
      if (temp == "0" || temp == "") {
        this.$modal.msgError("标准包装数不能为0或空!!");
        return Result = false;
      } else if (!ref.test(temp)) {
        this.$modal.msgError("标准包装数请输入大于0的数字!!");
        return Result = false;
      }
      temp = sSubStr[0].HBQty + "";
      if (!ref1.test(temp)) {
        this.$modal.msgError("包数请输入大于0的整数数字!!");
        return Result = false;
      }
      var regex = /^\d{4}-\d{2}-\d{2}$/;                              //正则表达式:校验 yyyy-MM-dd
      temp = this.initMainData.HInspectionDate;
      if (!regex.test(temp)) {
        this.$modal.msgError("请设置生产日期!!!");
        return Result = false;
      }
      // var HEndQty = this.initMainData.HEndQty;
      // if (HEndQty == "") {
      //     this.$modal.msgError("尾包数量不能为空!!");
      //     return Result = false;
      // } else if (!ref.test(HEndQty)) {
      //     this.$modal.msgError("尾包数量请输入不小于0的数字!!");
      //     return Result = false;
      // }
      return Result;
    },
    //#endregion
    //#region ç”ŸæˆæŒ‰é’®ç‚¹å‡»äº‹ä»¶
    async onClickMethod_BarCodeProduce() {
      this.disabledFlag_BarCodeProduce = true;                                //禁用生成按钮
      if (this.initMainData.HMaterName != null && (this.initMainData.HMaterName.indexOf("\"") != -1 || this.initMainData.HMaterName.indexOf(";") != -1)) {
        this.initMainData.HMaterName = this.initMainData.HMaterName.replaceAll("\"", "”").replaceAll(";", ";")
      }
      if (this.initMainData.HMaterModel != null && (this.initMainData.HMaterModel.indexOf("\"") != -1 || this.initMainData.HMaterModel.indexOf(";") != -1)) {
        this.initMainData.HMaterModel = this.initMainData.HMaterModel.replaceAll("\"", "”").replaceAll(";", ";")
      }
      //判断生成条码数量是否超过可生成条码数量
      var temp = await this.getPushSource_POInStockBillInit(this.initMainData.HMainSourceInterID, this.initMainData.HMainSourceEntryID);
      var dataArray = [];
      dataArray.push(temp);
      var HQty_SourceBill = this.initMainData.HQty_SourceBill * 1;
      if (HQty_SourceBill > ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1))) {
        this.$modal.msgError("条码生成数量大于最大可生成数量【" + ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1)) + "】!!");
        return false;
      }
      var sMainData_temp = [
        {
          "HMainID": this.initMainData.HMainSourceInterID
          , "HSubID": this.initMainData.HMainSourceEntryID
          , "HBillNo": this.initMainData.HMainSourceBillNo
          , "HBillType": this.initMainData.HMainSourceBillType
          , "HMaterID": this.initMainData.HMaterID
          , "HMaterNumber": this.initMainData.HMaterNumber
          , "HMaterName": this.initMainData.HMaterName
          , "HMaterModel": this.initMainData.HMaterModel
          , "HCusModel": this.initMainData.HCusModel
          , "HCusMaterName": ""
          , "HEmpID": 0
          , "HEmpNumber": ""
          , "HEmpName": ""
          , "HGroupID": 0
          , "HGroupNumber": ""
          , "HGroupName": ""
          , "HCheckEmpName": ""
          , "HBatchNo": this.initMainData.HBatchNo
          , "HQty": this.initMainData.HQty_SourceBill
          , "HMinQty": this.initMainData.HMinQty
          , "HBQty": this.initMainData.HBQty
          , "HSourceBillSEQ": this.initMainData.HSourceBillSEQ
          , "HPackQty": 0
          , "HCoilNO": ""
          , "HFurnaceNO": ""
          , "HFactory": ""
          , "HCusID": 0
          , "HCusNumber": ""
          , "HCusName": ""
          , "HSeOrderBillNo": ""
          , "HRemark": ""
          , "HProduceDate": this.initMainData.HDate
          , "HExpiryDate": this.initMainData.HDate
          , "HheatNO": ""
          , "HAuxPropID": this.initMainData.HAuxPropID
          , "HAuxPropNumber": this.initMainData.HAuxPropNumber
          , "HAuxPropName": this.initMainData.HAuxPropName
          , "HUnitID": this.initMainData.HUnitID
          , "HUnitNumber": ""
          , "HUnitName": this.initMainData.HUnitName
          , "HAuxQty": 0
          , "HExpirationDateFlag": 0
          , "HGiveAwayFlag": 0
          , "HDate": this.initMainData.HDate
          , "HMTONo": ""
          , "HBarCodeType": "唯一条码"
          , "HSupID": this.initMainData.HSupID
          , "HSupNumber": this.initMainData.HSupNumber
          , "HSupName": this.initMainData.HSupName
          , "HInnerBillNo": this.initMainData.HPOOrderBillNo
          , "HReInspectionFlag": this.initMainData.HReInspectionFlag
          , "HInspectionDate": this.initMainData.HInspectionDate
          , "HInspectionCycle": this.initMainData.HInspectionCycle
          , "HReInspectionDate": this.initMainData.HReInspectionDate
          , "HPOOrderBillMTO": this.initMainData.HPOOrderBillMTO
          , "HSeOrderBillNo": this.initMainData.HSeOrderBillNo
          , "HMTONo": this.initMainData.HMTONo
        }
      ]
      var sSubStr = JSON.stringify(sMainData_temp);
      //物料明细信息不为空判断
      if (!this.AllowLoadData(sSubStr))//数据验证
      {
        this.disabledFlag_BarCodeProduce = false;                           //生成按钮启用
        return;
      }
      var HOrgType = sessionStorage["Organization"];                         //获取选择的组织
      var HSourceBillType = this.initMainData.HMainSourceBillType;            //获取选择的源单类型
      var CampanyName = "xxx";                                                //获取选择的工厂代码
      var UserName = sessionStorage["HUserName"];                             //获取当前登录人员
      var sMainSub = sSubStr + ';' + HOrgType + ';' + HSourceBillType + ';' + CampanyName + ';' + UserName;
      this.SaveBarCodeCreate(sMainSub);                                       //条码生成
    },
    //#endregion
    //#region æ‰“印按钮点击事件
    get_PrintReport() {
      if (this.selectedData_BarCode.length == 0) {
        this.$modal.msgError("请选择数据");
      } else {
        this.rowSel = [];
        for (var i = 0; i < this.selectedData_BarCode.length; i++) {
          this.rowSel.push(this.selectedData_BarCode[i].HItemID.toString());
        }
        this.printListShow = true;
        this.openPrintList = true;
      }
    },
    //#endregion
    //#region æ¡ç æ¡£æ¡ˆæŒ‰é’®ç‚¹å‡»äº‹ä»¶
    get_BarCodeBillList() {
      this.$router.push({ path: "/warehouse/barcodeMaster/Gy_BarCodeBillList_JinLong_AutoLogin" }).catch(() => { });
    },
    //#endregion
    //#region下推生成条码
    async get_BarCodeBillHSEQ() {
      var params = this.get_UrlVars();
      var HSourceInterID = params[params[1]];
      var HSourceEntryID = params[params[2]];
      var res1 = await this.getPushSource_POInStockBillInit1(HSourceInterID, HSourceEntryID);
      var temp = res1.data.data[0];
      var dataArray = [temp];
      var HSEQ
      if (dataArray && dataArray.length > 0 && dataArray[0]) {
        if (dataArray[0].HSEQ == '') {
          HSEQ = 0;
        } else {
          HSEQ = dataArray[0].HSEQ;
        }
      } else {
        HSEQ = 0;
      }
      this.$router.push({
        path: `/warehouse/barcodeMaster/Gy_BarCodeBillList_JinLong_AutoLogin?OperationType=4&HSourceInterID=${HSourceInterID}&HSourceEntryID=${HSourceEntryID}&HSEQ=${HSEQ}`
      }).catch(() => { });
    },
    //#endregion
    //#region æ¡ç åˆ—表复选框选择状态变更监听事件
    onSelectionChange_BarCode(selection) {
      this.selectedData_BarCode = selection;
    },
    //#endregion
    //#region èŽ·å–å‚æ•°
    get_UrlVars() {
      var vars = [], hash;
      var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
      for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
      }
      return vars;
    },
    //#endregion
    //#region æ ¹æ®ä¸»å†…码与子内码获取源单收料通知单数据
    async getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID) {
      var res = "none";
      var sql = "select * from h_v_IF_POInStockBillList_Source where 1=1 and HMainID = " + HSourceInterID + " and HSubID = " + HSourceEntryID;
      var ModRightNameCheck = "";
      return axios.get(this.$baseUrl + '/CommonModel/searchMethod', {
        async: false,
        params: {
          "sql": sql
          , "user": sessionStorage["HUserName"]
          , "ModRightNameCheck": ModRightNameCheck
        },
      })
    },
    //#endregion
    //#region æ ¹æ®ä¸»å†…码与子内码获取源单收料通知单数据(合并版)
    async getPushSource_POInStockBillInit1(HSourceInterID, HSourceEntryID) {
      var sql = `SELECT m.*, s.*
                    FROM Cg_POInStockBillMain m
                    INNER JOIN Cg_POInStockBillSub s ON m.hinterid = s.HInterID
                    WHERE 1=1`;
      sql += ` AND m.hinterid = ${HSourceInterID}`;
      sql += ` AND s.HEntryID = ${HSourceEntryID}`;
      var ModRightNameCheck = "";
      return axios.get(this.$baseUrl + '/CommonModel/searchMethod', {
        params: {
          "sql": sql,
          "user": sessionStorage["HUserName"],
          "ModRightNameCheck": ModRightNameCheck
        },
      })
    },
    //#endregion
    //#endregion
    //#region ä¸‹æŽ¨é¡µé¢åˆå§‹åŒ–
    async setInit_PushBill(HSourceInterID, HSourceEntryID) {
      //获取参数
      var params = this.get_UrlVars();
      var OperationType = params[params[0]];      //操作类型
      var HSourceInterID = params[params[1]];     //源单主id
      var HSourceEntryID = params[params[2]];     //源单子id
      var HSourceBillType = params[params[3]];    //源单类型
      var HSourceBillNo = params[params[4]];      //源单单号
      //获取源单信息
      var temp = null;
      var res = "none"
      var res1 = "none"
      try {
        res1 = await this.getPushSource_POInStockBillInit1(HSourceInterID, HSourceEntryID);
        if (res1.data.data.length <= 0) {
          this.$modal.msgError("当前单据未同步,请返回金蝶云SRM平台送货单列表找到该单据在查看页面点击【传递WMS】按钮!!");
        } else {
          res = await this.getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
          if (res.data.code == "1") {
            if (res.data.data.length > 0) {
              res = await this.getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
            } else {
              res = "none";
              this.$modal.msgError("单据已经全部下推,如果想继续下推,去条码档案作废对应条码");
            }
          }
          else {
            res = "none";
            this.$modal.msgError(res.data.Message);
          }
        }
      } catch (error) {
        res = "none";
        this.$modal.msgError("接口请求失败!" + error);
      }
      if (res != "none") {
        temp = res.data.data[0];
      } else {
        return;
      }
      var dataArray = [];
      dataArray.push(temp);
      this.initMainData.HDate = moment().format('YYYY-MM-DD');
      this.initMainData.HMainSourceInterID = HSourceInterID;
      this.initMainData.HMainSourceEntryID = HSourceEntryID;
      this.initMainData.HMainSourceBillNo = HSourceBillNo;
      this.initMainData.HMainSourceBillType = HSourceBillType;
      this.initMainData.HPOOrderBillNo = dataArray[0].源单单号 == null ? "" : dataArray[0].源单单号;
      this.initMainData.HMaterID = dataArray[0].HMaterID == null ? 0 : dataArray[0].HMaterID;
      this.initMainData.HMaterNumber = dataArray[0].物料代码 == null ? "" : dataArray[0].物料代码;
      this.initMainData.HMaterName = dataArray[0].物料名称 == null ? "" : dataArray[0].物料名称;
      this.initMainData.HMaterModel = dataArray[0].规格型号 == null ? "" : dataArray[0].规格型号;
      this.initMainData.HUnitID = dataArray[0].HUnitID == null ? 0 : dataArray[0].HUnitID;
      this.initMainData.HUnitName = dataArray[0].计量单位 == null ? "" : dataArray[0].计量单位;
      this.initMainData.HAuxPropID = dataArray[0].HAuxPropID == null ? 0 : dataArray[0].HAuxPropID;
      this.initMainData.HAuxPropNumber = dataArray[0].辅助属性代码 == null ? "" : dataArray[0].辅助属性代码;
      this.initMainData.HAuxPropName = dataArray[0].辅助属性 == null ? "" : dataArray[0].辅助属性;
      this.initMainData.HSupID = dataArray[0].HSupID == null ? 0 : dataArray[0].HSupID;
      this.initMainData.HSupNumber = dataArray[0].供应商代码 == null ? "" : dataArray[0].供应商代码;
      this.initMainData.HSupName = dataArray[0].供应商 == null ? "" : dataArray[0].供应商;
      this.initMainData.HBatchNo = dataArray[0].批号 == null ? "" : dataArray[0].批号;
      this.initMainData.HQty_SourceBill = ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1)) < 0 ? 0 : ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1));
      this.initMainData.HReInspectionFlag = dataArray[0].复检标记 == 1 ? true : false;
      this.initMainData.HInspectionCycle = dataArray[0].复检标记 == 1 ? dataArray[0].复检周期 : 0;
      this.initMainData.HInspectionDate = dataArray[0].复检标记 == 1 ? moment(dataArray[0].检验日期).format('YYYY-MM-DD') : null;
      this.initMainData.HReInspectionDate = dataArray[0].复检标记 == 1 ? moment(dataArray[0].检验日期).add(dataArray[0].复检周期, "days").format('YYYY-MM-DD') : null;
      this.initMainData.HPOOrderBillMTO = dataArray[0].采购跟踪号;
      this.initMainData.HSeOrderBillNo = dataArray[0].客户订单号;
      this.initMainData.HCusModel = dataArray[0].产品型号;
      this.initMainData.HMTONo = dataArray[0].计划跟踪号;
      this.initMainData.HSourceBillSEQ = dataArray[0].源单行号;
      this.initMainData.HMinQty = 0;
      if (this.initMainData.HMinQty > 0) {
        this.initMainData.HBQty = (this.initMainData.HQty_SourceBill / this.initMainData.HMinQty) + (this.initMainData.HQty_SourceBill % this.initMainData.HMinQty == 0 ? 0 : 1);
      } else {
        this.initMainData.HBQty = 0;
      }
      if (this.initMainData.HMinQty > 0) {
        this.initMainData.HEndQty = this.initMainData.HQty_SourceBill % this.initMainData.HMinQty;
      }
    },
    //#endregion
    //#region æ¡ç ç”Ÿæˆ
    SaveBarCodeCreate(sMainSub, CampanyName) {
      axios({
        method: 'post',
        url: this.$baseUrl + "/Sc_BarCode/Sub_SaveBill_JinLong",
        data: {
          "msg": sMainSub, "CampanyName": CampanyName
        },
      }).then(response => {
        let result = response.data
        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
          this.tableData_BarCode = result.data;
          console.log(this.tableData_BarCode);
        }
        else {
          this.disabledFlag_BarCodeProduce = false                            //生成按钮启用
          this.$modal.msgError(result.Message);
        }
      }).catch(error => {
        this.disabledFlag_BarCodeProduce = false                            //生成按钮启用
        this.$modal.msgError("接口请求失败!");
      });
    },
    //#endregion
    //#region èŽ·å–æ¡ç ä¸‹æŽ¨å•æ®ä¿¡æ¯
    async selectReportFormBillList() {
      try {
        let res = await axios.post(`${this.$baseUrl}/Sc_BarCode/SelectReportFromBillList`,
          {
            msg: this.BillInfoProps
          }
        )
        let { data, count, Message, code } = res.data
        if (count == 1) {
          this.tableData_Mater = data
        } else {
          this.$modal.msgError(code + Message);
        }
      } catch (err) {
        this.$modal.msgError(err);
      }
    },
    //#endregion
    //#region ç”Ÿæˆæ¡ç æ˜Žç»†
    async generateBarCode() {
      try {
        let res = await axios.post(`${this.$baseUrl}/Sc_BarCode/Sub_SaveBill`, {
          msg: tableData_Mater
        })
        let { data, count, Message, code } = res.data
        if (count == 1) {
          this.tableData_BarCode = data
        } else {
          this.$modal.msgError(code + Message);
        }
      } catch (err) {
        this.$modal.msgError(err);
      }
    },
    //#endregion
    //#region è‡ªåŠ¨ç™»å½•
    async loging() {
      // æ‰¹é‡ä¸‹æŽ¨ ä½¿ç”¨æ•°ç»„类型 ä¸€ä¸€å¯¹åº” æºå•主id和源单子id å¦‚
      // æœ€å¥½ä¸è¦é€šè¿‡url去下推,容易超长度,使用:prop æˆ–者 window绑定属性 æˆ–者 this.$refs.模块名.属性直接赋值的方式。
      // [{"BillType":"1103","BillTitle":"收料通知单","BillNo":"CGSLD250304019","BillMainID":100304,"BillSubID":100426,"SPID":0,"BatchNo":"","HAuxPropID":0}]
      var params = this.get_UrlVars();
      var OperationType = params[params[0]];          //操作类型
      var HSourceInterID = params[params[1]];         //源单主id(批量获取)
      var HSourceEntryID = params[params[2]];         //源单子id(批量获取)
      var HSourceBillType = params[params[3]];        //源单类型
      var HSourceBillNo = params[params[4]];          //源单单号(批量获取)
      //var encodedString = params[params[6]];      // ä»ŽC#获取的编码字符串
      //var decodedBytes = atob(encodedString);     // è§£ç Base64字符串为二进制字符串
      //var decodedString = decodeURIComponent(escape(window.atob(encodedString))); // å°†äºŒè¿›åˆ¶å­—符串转换为UTF-8字符串
      //var HUserName = decodedString;                //登录名
      var HUserName = params[params[5]];              //登录名
      var HPwdWord = params[params[6]];               //登录密码
      var HOrgID = params[params[7]];                 //组织id
      var HOrgName = "";
      if (HOrgID == 0) {
        //判断是否登录 æœªç™»å½•则跳到登录页
        if (sessionStorage.login != "login") {
          this.$modal.msgError("登录失效,请重新登录!!");
          this.$router.push({ path: "/" }).catch(() => { })
        }
        return;
      }
      var sql_getHOrgName = "select HName from Xt_Organizations where HItemID = " + HOrgID;
      var ModRightNameCheck = "";
      try {
        let response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
          params: {
            "sql": sql_getHOrgName
            , "user": HUserName
            , "ModRightNameCheck": ModRightNameCheck
          }
        })
        var data1 = response.data
        if (data1.count == 1) {
          if (data1.data.length > 0) {
            HOrgName = data1.data[0]["HName"];
          } else {
            this.$modal.msgError("登录失败!!组织不存在,请重新登录!!");
            this.$router.push({ path: "/" }).catch(() => { })
          }
        }
        else {
          this.$modal.msgError(data1.code + data1.Message);
          this.$router.push({ path: "/" }).catch(() => { })
        }
      } catch (error) {
        this.$modal.msgError("接口请求失败!");
        this.$router.push({ path: "/" }).catch(() => { })
      };
      // å†™å…¥sessionStorage éœ€è¦æ—¶é—´ï¼ŒåŽç»­æ“ä½œéœ€è¦ç­‰å¾… å†™å…¥sessionStorage完成后再执行
      var sql_login = "select * from h_v_Gy_Czygl_Login where Czymc = '" + HUserName + "'";
      try {
        let res = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
          params: {
            "sql": sql_login
            , "user": HUserName
            , "ModRightNameCheck": ""
          }
        })
        var data1 = res.data
        if (data1.count == 1) {
          if (data1.data.length > 0) {
            HUserName = data1.data[0]["Czybm"];
            var result = data1;
            sessionStorage["HCloudUserName"] = result.data[0].HCloudUserName;//金蝶云账号
            sessionStorage["HCloudUserPsd"] = result.data[0].HCloudUserPsd;
            sessionStorage["HMaker"] = result.data[0].Czymc;
            sessionStorage["HUserName"] = result.data[0].Czymc;
            sessionStorage["HBillerID"] = result.data[0].HK3UserID;
            sessionStorage["SourceFlag"] = false;
            sessionStorage["HKeeperID"] = result.data[0].HKeeperID;
            sessionStorage["HKeeper"] = result.data[0].HKeeper;
            sessionStorage["HSecManagerID"] = result.data[0].HSecManagerID;
            sessionStorage["HSecManager"] = result.data[0].HSecManager;
            sessionStorage["HSellManID"] = result.data[0].HSellManID;
            sessionStorage["HSellMan"] = result.data[0].HSellMan;
            sessionStorage["HDeptID"] = result.data[0].HDeptID;
            sessionStorage["HDept"] = result.data[0].HDept;
            sessionStorage["HWHID"] = result.data[0].HWhID;
            sessionStorage["HWHName"] = result.data[0].HWHName;
            sessionStorage["HSPID"] = result.data[0].HSPID;
            sessionStorage["HSPName"] = result.data[0].HSPName;
            sessionStorage["HSupID"] = result.data[0].HSupID;
            sessionStorage["HSupName"] = result.data[0].HSupName;
            sessionStorage["Czmm"] = result.data[0].Czmm;
            sessionStorage["Czybm"] = result.data[0].Czybm;
            sessionStorage["HEmpID"] = result.data[0].HEmpID;
            sessionStorage["HEmpNumber"] = result.data[0].HEmpNumber;
            sessionStorage["HEmpName"] = result.data[0].HEmpName;
            sessionStorage["HGroup"] = result.data[0].HGroup;
            sessionStorage["HGroupID"] = result.data[0].HGroupID;
            sessionStorage["HProc"] = result.data[0].HProc;
            sessionStorage["HProcNo"] = result.data[0].HProcNo;
            sessionStorage["HSource"] = result.data[0].HSource;
            sessionStorage["HSourceID"] = result.data[0].HSourceID;
            sessionStorage["HWorkCenter"] = result.data[0].HWorkCenter;
            sessionStorage["HWorkCenterID"] = result.data[0].HWorkCenterID;
            sessionStorage["HProcName"] = result.data[0].HProcName;
            sessionStorage["HProcID"] = result.data[0].HProcID;
            sessionStorage["HCheckEmpID"] = result.data[0].HCheckEmpID;
            sessionStorage["HCheckEmpName"] = result.data[0].HCheckEmpName;
            sessionStorage["login"] = "login";
            sessionStorage["OrganizationID"] = HOrgID;
            sessionStorage["Organization"] = HOrgName;
            sessionStorage["HTranSlate"] = "1";
            sessionStorage["HAutoLogin"] = "1";
            this.selectReportFromBillList()
          } else {
            this.$modal.msgError("加载失败!!账号不存在,请联系管理员维护账号信息!!");
            this.$router.push({ path: "/" }).catch(() => { });
          }
        } else {
          this.$modal.msgError("登录失败!!" + result.Message);
          this.$router.push({ path: "/" }).catch(() => { })
        }
      } catch (error) {
        this.$modal.msgError("接口请求失败!");
        this.$router.push({ path: "/" }).catch(() => { })
      };
    },
    //#endregion
  }
};
</script>
<style>
.input-search-btn {
  background-color: rgb(24, 144, 255) !important;
  color: #fff !important;
}
</style>