chenhaozhe
7 天以前 c3ceee9402fd69f87797ed82137b82217aff63e4
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-VUEUI
5个文件已修改
1个文件已添加
1753 ■■■■■ 已修改文件
src/permission.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/permission.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/basicModeling/Gy_MouldFile.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/xtUserListEdit.vue 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong.vue 1445 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.js
@@ -22,6 +22,7 @@
  "/gyMaterial",
  "/FbStepFoldinBillList",
  "/FbStepFoldOutBillList",
  "/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong",
]; // no redirect whitelist
const isWhiteList = (path) => {
src/router/index.js
@@ -139,6 +139,31 @@
  },
  //#endregion
  
  //#region 条码生成_锦隆
  {
    path: "/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong",
    component: Layout,
    hidden: true,
    redirect: "noredirect",
    meta: {
      breadcrumb: false, // 如果设置为false,则不会在breadcrumb面包屑中显示
      activeMenu: "/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong", // 当路由设置了该属性,则会高亮相对应的侧边栏。
    },
    children: [
      {
        path: "/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong",
        component: () =>
          import("@/views/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong.vue"),
        name: "Gy_BarCodeBill_JinLong",
        meta: {
          title: "条码生成_锦隆",
          activeMenu: "warehouse/barcodeMaster",
        },
      },
    ],
  },
  //#endregion
  //#region 条码主挡
  {
    path: "/warehouse/barcodeMaster/Gy_BarCodeBillList",
src/store/modules/permission.js
@@ -428,6 +428,21 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "条码生成_锦隆",
                    },
                    component: () =>
                      import(
                        "@/views/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong.vue"
                      ),
                    hidden: false,
                    name: "Gy_BarCodeBill_JinLong",
                    path: "Gy_BarCodeBill_JinLong",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "条码主档",
                    },
                    component: () =>
src/views/scMould/basicModeling/Gy_MouldFile.vue
@@ -11,18 +11,18 @@
        <el-tab-pane label="基本信息" name="first">
          <el-row>
            <el-col :span="6">
              <el-form-item label="单据号" prop="HBillNo">
              <el-form-item label="单据号" prop="HBillNo" v-show="isShow">
                <el-input v-model="form.HBillNo" placeholder="请输入单据号" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="日期" prop="HDate">
              <el-form-item label="日期" prop="HDate" v-show="isShow">
                <el-date-picker v-model="form.HDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="货主类型" prop="HMouldOWNER">
              <el-form-item label="货主类型" prop="HMouldOWNER" v-show="isHide">
                <el-select v-model="form.HMouldOWNER" placeholder="请选择">
                  <el-option label="自费" value="自费" />
                  <el-option label="客供" value="客供" />
@@ -30,79 +30,79 @@
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具编号" prop="HMouldNo">
              <el-form-item label="器具编号" prop="HMouldNo" v-show="isShow">
                <el-input v-model="form.HMouldNo" placeholder="请输入器具编号" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="器具名称" prop="HName">
              <el-form-item label="器具名称" prop="HName" v-show="isShow">
                <el-input v-model="form.HName" placeholder="请输入器具名称" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具规格" prop="HModel">
              <el-form-item label="器具规格" prop="HModel" v-show="isShow">
                <el-input v-model="form.HModel" placeholder="请输入器具规格" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具型号" prop="HModel2">
              <el-form-item label="器具型号" prop="HModel2" v-show="isShow">
                <el-input v-model="form.HModel2" placeholder="请输入器具型号" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="直径" prop="HDiameter">
              <el-form-item label="直径" prop="HDiameter" v-show="isHide">
                <el-input v-model="form.HDiameter" placeholder="请输入直径" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="辅助属性" prop="HSubjoin">
              <el-form-item label="辅助属性" prop="HSubjoin" v-show="isHide">
                <el-input v-model="form.HSubjoin" placeholder="请输入辅助属性" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="辅助属性2" prop="HSubjoin2">
              <el-form-item label="辅助属性2" prop="HSubjoin2" v-show="isHide">
                <el-input v-model="form.HSubjoin2" placeholder="请输入辅助属性2" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="图号" prop="HPICNo">
              <el-form-item label="图号" prop="HPICNo" v-show="isHide">
                <el-input v-model="form.HPICNo" placeholder="请输入图号" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="生产产品型号" prop="HWorkMaterModel">
              <el-form-item label="生产产品型号" prop="HWorkMaterModel" v-show="isHide">
                <el-input v-model="form.HWorkMaterModel" placeholder="请输入生产产品型号" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="对应ERP物料" prop="HMaterNumber">
              <el-form-item label="对应ERP物料" prop="HMaterNumber" v-show="isHide">
                <el-input v-model="form.HMaterNumber" placeholder="请输入对应ERP物料" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(3)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具分类" prop="HMouleTypeName">
              <el-form-item label="器具分类" prop="HMouleTypeName" v-show="isHide">
                <el-input v-model="form.HMouleTypeName" placeholder="请输入器具分类" disabled>
                  <el-button slot="append" icon="el-icon-search"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="单位" prop="HUnitName">
              <el-form-item label="单位" prop="HUnitName" v-show="isHide">
                <el-input v-model="form.HUnitName" placeholder="请输入单位" disabled>
                  <el-button slot="append" icon="el-icon-search"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="出厂日期" prop="HOutComDate">
              <el-form-item label="出厂日期" prop="HOutComDate" v-show="isHide">
                <el-date-picker v-model="form.HOutComDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
@@ -110,26 +110,26 @@
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="出厂编号" prop="HOutComNo">
              <el-form-item label="出厂编号" prop="HOutComNo" v-show="isHide">
                <el-input v-model="form.HOutComNo" placeholder="请输入出厂编号" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="使用部门" prop="HDeptName">
              <el-form-item label="使用部门" prop="HDeptName" v-show="isHide">
                <el-input v-model="form.HDeptName" placeholder="请输入使用部门" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(1)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="供应商" prop="HSupName">
              <el-form-item label="供应商" prop="HSupName" v-show="isHide">
                <el-input v-model="form.HSupName" placeholder="请输入供应商" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(6)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具状态" prop="HMouldStatus">
              <el-form-item label="器具状态" prop="HMouldStatus" v-show="isHide">
                <el-select v-model="form.HMouldStatus" placeholder="请选择">
                  <el-option label="在库" value="在库" />
                  <el-option label="上机" value="上机" />
@@ -147,24 +147,24 @@
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="安全寿命" prop="HSaveLife">
              <el-form-item label="安全寿命" prop="HSaveLife" v-show="isHide">
                <el-input v-model="form.HSaveLife" placeholder="请输入安全寿命" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="默认仓库" prop="HWHName">
              <el-form-item label="默认仓库" prop="HWHName" v-show="isHide">
                <el-input v-model="form.HWHName" placeholder="请输入默认仓库" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(2, ckType = 1)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="版本号" prop="HVersion">
              <el-form-item label="版本号" prop="HVersion" v-show="isHide">
                <el-input v-model="form.HVersion" placeholder="请输入版本号" disabled />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="默认仓位" prop="HSPName">
              <el-form-item label="默认仓位" prop="HSPName" v-show="isHide">
                <el-input v-model="form.HSPName" placeholder="请输入默认仓位" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(9, cwType = 1)"></el-button>
                </el-input>
@@ -173,66 +173,66 @@
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="设计寿命" prop="HDesignLife">
              <el-form-item label="设计寿命" prop="HDesignLife" v-show="isHide">
                <el-input v-model="form.HDesignLife" placeholder="请输入设计寿命" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="使用寿命" prop="HUseLife">
              <el-form-item label="使用寿命" prop="HUseLife" v-show="isHide">
                <el-input v-model="form.HUseLife" placeholder="请输入使用寿命" disabled />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="剩余寿命" prop="HLeaveLife">
              <el-form-item label="剩余寿命" prop="HLeaveLife" v-show="isHide">
                <el-input v-model="form.HLeaveLife" placeholder="请输入剩余寿命" disabled />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="已生产数量" prop="HProdQty">
              <el-form-item label="已生产数量" prop="HProdQty" v-show="isHide">
                <el-input v-model="form.HProdQty" placeholder="请输入已生产数量" disabled />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="已生产重量" prop="HProdWeight">
              <el-form-item label="已生产重量" prop="HProdWeight" v-show="isHide">
                <el-input v-model="form.HProdWeight" placeholder="请输入已生产重量" disabled />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="穴数" prop="HCaveQty">
              <el-form-item label="穴数" prop="HCaveQty" v-show="isHide">
                <el-input v-model="form.HCaveQty" placeholder="请输入穴数" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="默认保养规程" prop="HMouldMaintainRuleInterName">
              <el-form-item label="默认保养规程" prop="HMouldMaintainRuleInterName" v-show="isHide">
                <el-input v-model="form.HMouldMaintainRuleInterName" placeholder="请输入默认保养规程" disabled>
                  <el-button slot="append" icon="el-icon-search"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="条码编号" prop="HBarCode">
              <el-form-item label="条码编号" prop="HBarCode" v-show="isHide">
                <el-input v-model="form.HBarCode" placeholder="请输入条码编号" disabled />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="制造厂商" prop="HMadeSupName">
              <el-form-item label="制造厂商" prop="HMadeSupName" v-show="isHide">
                <el-input v-model="form.HMadeSupName" placeholder="请输入制造厂商" disabled>
                  <el-button slot="append" icon="el-icon-search"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="下次保养/校正日期" prop="HNextMainDate">
              <el-form-item label="下次保养/校正日期" prop="HNextMainDate" v-show="isHide">
                <el-date-picker v-model="form.HNextMainDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具类型" prop="HMouldClass">
              <el-form-item label="器具类型" prop="HMouldClass" v-show="isHide">
                <el-select v-model="form.HMouldClass" placeholder="请选择">
                  <el-option label="模具" value="模具" />
                  <el-option label="工装" value="工装" />
@@ -245,28 +245,28 @@
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="上线初始化寿命" prop="HInitLife">
              <el-form-item label="上线初始化寿命" prop="HInitLife" v-show="isHide">
                <el-input v-model="form.HInitLife" placeholder="请输入上线初始化寿命" disabled />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="当前仓库" prop="HNowWHName">
              <el-form-item label="当前仓库" prop="HNowWHName" v-show="isHide">
                <el-input v-model="form.HNowWHName" placeholder="请输入当前仓库" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(2, ckType = 2)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="当前仓位" prop="HNowSPName">
              <el-form-item label="当前仓位" prop="HNowSPName" v-show="isHide">
                <el-input v-model="form.HNowSPName" placeholder="请输入当前仓库" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(9, cwType = 2)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具可用状态" prop="HMouldUseStatus">
              <el-form-item label="器具可用状态" prop="HMouldUseStatus" v-show="isHide">
                <el-select v-model="form.HMouldUseStatus" placeholder="请选择">
                  <el-option label="正常" value="正常" />
                  <el-option label="异常" value="异常" />
@@ -275,47 +275,49 @@
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="使用组织" prop="HCREATEORGID">
              <el-form-item label="长" prop="HMouldLength" v-show="isShow">
                <el-input v-model="form.HMouldLength" placeholder="请输入长" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="宽" prop="HMouldWidth" v-show="isShow">
                <el-input v-model="form.HMouldWidth" placeholder="请输入宽" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="高" prop="HMouldHeight" v-show="isShow">
                <el-input v-model="form.HMouldHeight" placeholder="请输入高" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
             <el-col :span="6">
              <el-form-item label="折叠高度" prop="HMouldFoldHeight" v-show="isShow">
                <el-input v-model="form.HMouldFoldHeight" placeholder="请输入折叠高度" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="" prop="HTransPackFlag" v-show="isShow">
                <el-checkbox v-model="form.HTransPackFlag">周转容器标记</el-checkbox>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="" prop="HSendPackFlag" v-show="isShow">
                <el-checkbox v-model="form.HSendPackFlag">发货容器标记</el-checkbox>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
             <el-col :span="6">
              <el-form-item label="使用组织" prop="HCREATEORGID" v-show="isShow">
                <el-select v-model="form.HCREATEORGID" placeholder="请选择组织使用" @change="organizationChange"
                  :disabled="zzSelDis">
                  <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="长" prop="HMouldLength">
                <el-input v-model="form.HMouldLength" placeholder="请输入长" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="宽" prop="HMouldWidth">
                <el-input v-model="form.HMouldWidth" placeholder="请输入宽" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="高" prop="HMouldHeight">
                <el-input v-model="form.HMouldHeight" placeholder="请输入高" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="折叠高度" prop="HMouldFoldHeight">
                <el-input v-model="form.HMouldFoldHeight" placeholder="请输入折叠高度" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="周转容器标记" prop="HTransPackFlag">
                <el-checkbox v-model="form.HTransPackFlag"></el-checkbox>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="发货容器标记" prop="HSendPackFlag">
                <el-checkbox v-model="form.HSendPackFlag"></el-checkbox>
              </el-form-item>
            </el-col>
          </el-row>
@@ -386,7 +388,7 @@
          </el-row>
        </el-tab-pane>
      </el-tabs>
      <el-tabs type="border-card">
      <el-tabs type="border-card" v-show="isHide">
        <el-tab-pane label="子器具">
          <div style="margin-bottom: 10px;">
            <el-button type="success" plain icon="el-icon-plus" @click="handleAddSysZb(type = 'edit')"
@@ -539,6 +541,8 @@
  },
  data() {
    return {
      isShow: true,
      isHide: false,
      HModName: "Gy_MouldFile",
      ckType: null,
      cwType: null,
@@ -917,7 +921,7 @@
      this.form = {
        HInterID: 0,
        HBillNo: '',
        HDate: moment(new Date()).format('YYYY-MM-DDTHH:mm:ss'),
        HDate: moment(new Date()).format('YYYY-MM-DD'),
        HMouldOWNER: '',
        HMouldNo: '',
        HName: '',
@@ -934,7 +938,7 @@
        HMouleTypeName: '',
        HUnitID: 0,
        HUnitName: '',
        HOutComDate: moment(new Date()).format('YYYY-MM-DDTHH:mm:ss'),
        HOutComDate: moment(new Date()).format('YYYY-MM-DD'),
        HOutComNo: '',
        HDeptID: 0,
        HDeptName: '',
@@ -977,7 +981,7 @@
        HTransPackFlag: 0,
        HSendPackFlag: 0,
        HMaker: sessionStorage["HUserName"],
        HMakeDate: '',
        HMakeDate: moment(new Date()).format('YYYY-MM-DD'),
        HChecker: '',
        HCheckDate: '',
        HUpDater: '',
@@ -986,6 +990,8 @@
        HCloseDate: '',
        HDeleteMan: '',
        HDeleteDate: '',
        HInComDate: moment(new Date()).format('YYYY-MM-DD'),
        DateTime: moment(new Date()).format('YYYY-MM-DD'),
      }
      this.editData = []
      this.editBtData = []
@@ -1017,6 +1023,8 @@
          HBillType: '3899'
        }
      }).then(response => {
        console.log(response)
        this.form.HInterID = response.data.data[0].HInterID
        this.form.HBillNo = response.data.data[0].HBillNo
      }).catch(error => {
        this.$modal.msgError("接口请求失败!");
@@ -1441,10 +1449,20 @@
          this.form.HTransPackFlag = this.form.HTransPackFlag == false ? 0 : 1
          this.form.HSendPackFlag = this.form.HSendPackFlag == false ? 0 : 1
          var sMainStr = JSON.stringify(this.form);
          var sSubStr = JSON.stringify(this.editData);
          var mainTableMaintainRuleStr = JSON.stringify(this.maintainData);
          var mainTableDotCheckRuleStr = JSON.stringify(this.dotCheckData);
          var sSubStr = JSON.stringify(this.editData)
          var mainTableMaintainRuleStr = JSON.stringify(this.maintainData)
          var mainTableDotCheckRuleStr = JSON.stringify(this.dotCheckData)
          // if (this.editData.length > 0) {
          //   sSubStr = JSON.stringify(this.editData);
          // }
          // if (this.maintainData.length > 0) {
          //   mainTableMaintainRuleStr = JSON.stringify(this.maintainData);
          // }
          // if (this.dotCheckData.length > 0) {
          //   mainTableDotCheckRuleStr = JSON.stringify(this.dotCheckData);
          // }
          var oMain = sMainStr + ";" + ModRightNameAdd + ";" + user + ";" + sSubStr + ";" + mainTableMaintainRuleStr + ";" + mainTableDotCheckRuleStr;
          console.log(oMain)
          axios({
            method: 'post',
            url: this.baseURL + url,
@@ -1453,13 +1471,14 @@
            },
          }).then(response => {
            console.log(response)
            if (response.data.count == 1) {
              // this.subDisabled = true//设置保存按钮不可用
              this.$modal.msgSuccess(response.data.Message);
              // this.addBtnShow = true
              this.formShow = false
              this.$emit('editClose', false)
            } else {
              this.$modal.msgError(response.data.Message);
            }
          }).catch(error => {
            console.log(error)
src/views/system/user/xtUserListEdit.vue
@@ -327,9 +327,6 @@
        Czybm: [
          { required: true, message: "编码不能为空!", trigger: "blur" }
        ],
        Czybm: [
          { required: true, message: "编码不能为空!", trigger: "blur" }
        ],
        Czymc: [
          { required: true, message: "用户名不能为空!", trigger: "blur" }
        ],
@@ -660,39 +657,56 @@
    },
    // 编辑提交保存
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          var num = [];
          var Sav = ''
          if (this.OperationType == 1) {
            Sav = 'Add'
          } else if (this.OperationType == 3) {
            Sav = "Update"
          }
          for (var i = 0; i < this.checkedSysZb.length; i++) {
            num.push(this.checkedSysZb[i].HGroupID)
          }
          var sSubStr = num.toString() == "" ? "-1" : num.toString();
          var sMainStr = JSON.stringify(this.form) + ';' + Sav + ';' + sSubStr;
          axios({
            method: 'post',
            url: this.baseURL + "/Xt_User/SaveUser",
            data: {
              'msg': sMainStr
            },
          }).then(response => {
            if (response.data.count == 1) {
              this.formShow = false
              this.$emit('editClose', false)
              this.$modal.msgSuccess(response.data.Message);
            } else {
              this.$modal.msgError(response.data.Message)
      if (!this.form.Czybm) {
        this.$modal.msgError("编码不能为空!");
      } else if (!this.form.Czymc) {
        this.$modal.msgError("用户名不能为空!");
      } else if (!this.form.Czmm) {
        this.$modal.msgError("密码不能为空!");
      } else if (!this.form.Czyyz) {
        this.$modal.msgError("确认密码不能为空!");
      } else if (this.form.Czmm != this.form.Czyyz) {
        this.$modal.msgError("密码和确认密码不一样!");
      } else if (!this.form.HDept) {
        this.$modal.msgError("部门不能为空!");
      } else if (this.form.HWHName == this.form.HSCWHName) {
        this.$modal.msgError("对应仓库和调入仓库不能相同!");
      } else {
        this.$refs["form"].validate(valid => {
          if (valid) {
            var num = [];
            var Sav = ''
            if (this.OperationType == 1) {
              Sav = 'Add'
            } else if (this.OperationType == 3) {
              Sav = "Update"
            }
          }).catch(error => {
            this.$modal.msgError("接口请求失败!");
          });
        }
      });
            for (var i = 0; i < this.checkedSysZb.length; i++) {
              num.push(this.checkedSysZb[i].HGroupID)
            }
            var sSubStr = num.toString() == "" ? "-1" : num.toString();
            var sMainStr = JSON.stringify(this.form) + ';' + Sav + ';' + sSubStr;
            axios({
              method: 'post',
              url: this.baseURL + "/Xt_User/SaveUser",
              data: {
                'msg': sMainStr
              },
            }).then(response => {
              if (response.data.count == 1) {
                this.formShow = false
                this.$emit('editClose', false)
                this.$modal.msgSuccess(response.data.Message);
              } else {
                this.$modal.msgError(response.data.Message)
              }
            }).catch(error => {
              this.$modal.msgError("接口请求失败!");
            });
          }
        });
      }
    },
    showReset() {
      this.deptShow = false
src/views/warehouse/barcodeMaster/Gy_BarCodeBill_JinLong.vue
New file
@@ -0,0 +1,1445 @@
<template>
    <div v-loading="formLoading" v-if="formShow" style="margin: 10px;">
        <div style=" margin-bottom: 10px; border-bottom: 1px solid #f6f6f6;">
            <el-button type="primary" @click="get_PrintReport">预览打印</el-button>
            <el-button type="primary" @click="ToolCreate" :disabled="disabledToolCreate">生成</el-button>
            <!-- <el-button type="primary">重置</el-button>
            <el-button type="primary">库存</el-button>
            <el-button type="primary">同步资料</el-button> -->
            <el-button type="primary" @click="ToolBatch">批次</el-button>
            <el-button type="primary" @click="close">退 出</el-button>
        </div>
        <div style="margin: 10px; font-size: 28px; font-weight: bold; text-align: center;">条码生成</div>
        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
            <el-row>
                <el-col :span="6">
                    <el-form-item label="组织" prop="HOrgID" @change="HOrgIDChange">
                        <el-select v-model="form.HOrgID" placeholder="请选择组织" style="width: 100%">
                            <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name"
                                :value="item.ID">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="工厂代码" prop="HWorksNumber">
                        <el-select v-model="form.HWorksNumber" placeholder="请选择工厂" style="width: 100%">
                            <el-option v-for="(item, index) in HWorksNumberList" :key="index" :label="item"
                                :value="item">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="日期" prop="HDate">
                        <el-date-picker v-model="form.HDate" type="date" placeholder="选择日期" value-format="yyyy-MM-ddT"
                            style="width: 100%"> </el-date-picker>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="6">
                    <el-form-item label="源单类型" prop="HSourceBillType">
                        <el-select v-model="form.HSourceBillType" placeholder="请选择" style="width: 100%"
                            @change="HSourceBillTypeChange">
                            <el-option v-for="(item, index) in HSourceBillTypeList" :key="index" :label="item.label"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="选单号" prop="HSourceBillNo">
                        <el-input v-model="form.HSourceBillNo" placeholder="请输入选单号" disabled>
                            <el-button class="input-search-btn" slot="append" icon="el-icon-search"
                                @click="openDataDialog(null)"></el-button>
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="条码类型" prop="HBarCodeType">
                        <el-select v-model="form.HBarCodeType" placeholder="请选择" style="width: 100%">
                            <el-option v-for="(item, index) in HBarCodeTypeList" :key="index" :label="item"
                                :value="item">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-tabs type="border-card" v-model="barcodeName">
                <el-tab-pane label="物料信息" name="wuliao">
                    <div style="margin-bottom: 10px;">
                        <el-button type="success" plain icon="el-icon-plus" @click="handleAddSysZb()"
                            size="mini">增加一行</el-button>
                        <el-button type="success" plain icon="el-icon-plus" @click="handleCopyZbRow"
                            size="mini">复制一行</el-button>
                    </div>
                    <el-table :data="editWlxxData" style="width: 100%" height="480" width="100%" ref="wlxxzbTable"
                        @selection-change="handleTableWlxxZbEdit" :row-class-name="wlxxzbRowSysZbIndex" border>
                        <el-table-column type="selection" width="55" align="center" />
                        <el-table-column align="center" label="序号" type="index" width="80" fixed
                            show-overflow-tooltip />
                        <el-table-column align="center" label="源单单号" prop="HBillNo" width="120" show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HBillNo }} </template>
                        </el-table-column>
                        <el-table-column align="center" label="物料代码" prop="HMaterNumber" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.HMaterNumber"
                                    @keyup.native.f7="openDataDialog(3, scope.row)"
                                    @dblclick.native="openDataDialog(3, scope.row)" />
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="物料名称" prop="HMaterName" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HMaterName }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="规格型号" prop="HMaterModel" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HMaterModel }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="数量" prop="HQty" width="120" show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-input-number v-model="scope.row.HQty" :min="0" controls-position="right"
                                    style="width: 100%;" @change="editMainTable(scope.row)" />
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="最小包装数" prop="HMinQty" width="120" show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-input-number v-model="scope.row.HMinQty" :min="0" controls-position="right"
                                    style="width: 100%;" @change="editMainTable(scope.row)" />
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="箱数" prop="HBQty" width="120" show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HBQty }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="客户规格型号" prop="HCusModel" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HCusModel" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="客户物料名称" prop="HCusMaterName" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope"> <el-input v-model="scope.row.HCusMaterName" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="操作员代码" prop="HEmpNumber" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope"> <el-input v-model="scope.row.HEmpNumber" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="操作员" prop="HEmpName" width="120" show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HEmpName }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="班组代码" prop="HGroupNumber" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HGroupNumber" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="班组名称" prop="HGroupName" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HGroupName }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="检验员" prop="HCheckEmpName" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HCheckEmpName" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="批号" prop="HBatchNo" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HBatchNo" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="计划跟踪号" prop="HMTONo" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HMTONo" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="外箱数" prop="HPackQty" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HPackQty" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="钢卷捆包号" prop="HCoilNO" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HCoilNO" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="炉号" prop="HFurnaceNO" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HFurnaceNO" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="厂商" prop="HFactory" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HFactory" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="客户代码" prop="HCusNumber" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HCusNumber" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="客户名称" prop="HCusName" width="120" show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HCusName }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="销售订单号" prop="HSeOrderBillNo" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HSeOrderBillNo }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="备注" prop="HRemark" width="120" show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HRemark }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="生产日期" prop="HProduceDate" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-date-picker v-model="scope.row.HProduceDate" type="date" placeholder="选择日期"
                                    value-format="yyyy-MM-dd" style="width: 100%"> </el-date-picker>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="保质期至" prop="HExpiryDate" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-date-picker v-model="scope.row.HExpiryDate" type="date" placeholder="选择日期"
                                    value-format="yyyy-MM-dd" style="width: 100%"> </el-date-picker>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="热处理" prop="HheatNO" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HheatNO" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="辅助属性代码" prop="HAuxPropNumber" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.HAuxPropNumber"
                                    @keyup.native.f7="openDataDialog(1, scope.row)"
                                    @dblclick.native="openDataDialog(1, scope.row)" />
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="辅助属性名称" prop="HAuxPropName" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HAuxPropName }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="计量单位代码" prop="HUnitNumber" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HUnitNumber" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="计量单位名称" prop="HUnitName" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">{{ scope.row.HUnitName }}</template>
                        </el-table-column>
                        <el-table-column align="center" label="辅单位数量" prop="HAuxQty" width="120" show-overflow-tooltip>
                            <template slot-scope="scope"><el-input v-model="scope.row.HAuxQty" /></template>
                        </el-table-column>
                        <el-table-column align="center" label="是否启用保质期" prop="HExpirationDateFlag" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-checkbox v-model="scope.row.HExpirationDateFlag"></el-checkbox>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="是否赠品" prop="HGiveAwayFlag" width="120"
                            show-overflow-tooltip>
                            <template slot-scope="scope">
                                <el-checkbox v-model="scope.row.HGiveAwayFlag"></el-checkbox>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="操作" width="55" fixed="right">
                            <template slot-scope="scope">
                                <el-button type="danger" icon="el-icon-delete" size="mini" circle
                                    @click="handleDeleteSysZb(scope.row)"></el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-tab-pane>
                <el-tab-pane label="条码信息" name="tiaoma">
                    <el-table :data="editTmData" style="width: 100%" height="480" width="100%" ref="tbzbTable"
                        @selection-change="handleTableWlxxZbEdit" :row-class-name="tiaomaZbIndex" border
                        v-if="editTmData.length > 0">
                        <el-table-column align="center" label="序号" type="index" width="80" fixed />
                        <template v-for="(item, index) in tmBtList">
                            <el-table-column align="center" :prop="item.field" :label="item.title" :width="item.width"
                                :key="index" show-overflow-tooltip v-if="!item.hide" />
                        </template>
                    </el-table>
                </el-tab-pane>
                <el-tab-pane label="档案列表" name="dangan">
                    <el-table :data="editDaData" style="width: 100%" height="480" width="100%" ref="dazbTable"
                        @selection-change="handleTableDangan" :row-class-name="danganZbIndex" border
                        v-if="editDaData.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 daBtList">
                            <el-table-column align="center" :prop="item.field" :label="item.title" :width="item.width"
                                :key="index" show-overflow-tooltip 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="dialogTitle" :visible.sync="openData" width="1280px" append-to-body @close="closeBill">
            <HSourceReportHtml @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName"
                :HOrgID='this.form.HOrgID' :HSouceBillType="HSouceBillType" v-if="ScICMOBillShow" />
            <Material @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="materialShow" />
            <GyProperty @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="propertyShow" />
            <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="openPrintList" width="800px" append-to-body>
            <PrintList :linterid="rowSel.toString()" :MyMsg="rowSel.toString()" Type="HGy_BarCodeBill"
                HModName="HGy_BarCodeBill" @rowEditClose="rowSetClose" v-if="printListShow" />
            <!-- <div>111</div> -->
        </el-dialog>
    </div>
</template>
<script>
import axios from 'axios'
import HSourceReportHtml from '@/views/component/HSourceReportHtml'
import PrintList from "@/views/component/printList";
import moment from 'moment';
import GyProperty from "@/views/basic/gyProperty/gyPropertyList.vue";
import Material from '@/views/gyMaterial/GyMaterial.vue'
export default {
    name: 'Gy_BarCodeBill',
    components: { HSourceReportHtml, PrintList, GyProperty, Material },
    props: {
        OperationType: { type: Number, },
        linterid: { type: Number, },
        propsData: { type: String, },
        copyType: { type: Number, },
    },
    data() {
        return {
            rowSel: [],
            HModName: "Gy_BarCodeBill",
            danganSelList: [],
            openPrintList: false,
            printListShow: false,
            barcodeName: 'wuliao',
            HOrgSel: sessionStorage["Organization"],
            HMaterInfo: [],
            HSouceBillType: '生产订单',
            disabledToolCreate: false,
            HMinQty2: 0,
            BatchNoArray: [], //用来存储获取到的批号,在批次按钮功能中用到
            HMaterID: "",
            HBatchNo: "",
            openNum: 10,
            zbDataShow: true,
            HSourceBillTypeList: [
                { value: '1', label: '生产订单', },
                { value: '2', label: '生产汇报单', },
                { value: '3', label: '采购订单', },
                { value: '4', label: '收料通知单', },
                { value: '5', label: '委外订单', },
                { value: '6', label: '生产入库单', },
                { value: '7', label: '采购入库单', },
                { value: '8', label: '销售退货单', },
                { value: '9', label: '生产退料单', },
                { value: '10', label: '工序流转卡', },
                { value: '11', label: '销售出库单', },
                { value: '12', label: '领料出库单', }
            ],
            wlxxBtList: [{ field: 'HMainID', title: '源单主内码', width: 100, hide: true }
                , { field: 'HSubID', title: '源单子内码', width: 100, hide: true }
                , { field: 'HSourceBillSEQ', title: '源单行号', width: 100, hide: true }
                , { field: 'HBillNo', title: '源单单号', width: 200 }
                , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                , { field: 'HMaterNumber', title: '物料代码', edit: 'text', event: 'HMaterNumber', width: 200 }
                , { field: 'HMaterName', title: '物料名称', width: 200 }
                , { field: 'HMaterModel', title: '规格型号', width: 200 }
                , { field: 'HCusModel', title: '客户规格型号', edit: 'text', width: 200 }
                , { field: 'HCusMaterName', title: '客户物料名称', edit: 'text', width: 200 }
                , { field: 'HEmpID', title: '操作员ID', width: 100, hide: true }
                , { field: 'HEmpNumber', title: '操作员代码', edit: 'text', width: 200, event: 'HEmpNumber' }
                , { field: 'HEmpName', title: '操作员', width: 200 }
                , { field: 'HGroupID', title: '班组ID', width: 100, hide: true }
                , { field: 'HGroupNumber', title: '班组代码', edit: 'text', width: 200, event: 'HGroupNumber' }
                , { field: 'HGroupName', title: '班组名称', width: 200 }
                , { field: 'HCheckEmpName', title: '检验员', width: 200, edit: 'text' }
                , { field: 'HBatchNo', title: '批号', edit: 'text', width: 100 }
                , { field: 'HMTONo', title: '计划跟踪号', width: 100, edit: 'text' }
                , { field: 'HQty', title: '数量', edit: 'number', width: 100, totalRow: true }
                , { field: 'HMinQty', title: '最小包装数', edit: 'number', totalRow: true, width: 100 }
                , { field: 'HBQty', title: '箱数', width: 100, totalRow: true }
                , { field: 'HPackQty', title: '外箱数', edit: 'text', width: 100, totalRow: true }
                , { field: 'HCoilNO', title: '钢卷捆包号', edit: 'text', width: 100 }
                , { field: 'HFurnaceNO', title: '炉号', edit: 'text', width: 100 }
                , { field: 'HFactory', title: '厂商', edit: 'text', width: 100 }
                , { field: 'HCusID', title: '客户ID', width: 100, hide: true }
                , { field: 'HCusNumber', title: '客户代码', edit: 'text', event: 'HCusNumber', width: 120 }
                , { field: 'HCusName', title: '客户名称', width: 120 }
                , { field: 'HSeOrderBillNo', title: '销售订单号', width: 200 }
                , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                , { field: 'HProduceDate', title: '生产日期', edit: 'date', event: 'HProduceDate', width: 160 }
                , { field: 'HExpiryDate', title: '保质期至', edit: 'date', event: 'HExpiryDate', width: 160 }
                , { field: 'HheatNO', title: '热处理', edit: 'text', width: 100 }
                , { field: 'HAuxPropID', title: '辅助属性ID', width: 100, hide: true }
                , { field: 'HAuxPropNumber', title: '辅助属性代码', edit: 'text', event: 'HAuxPropNumber', width: 100 }
                , { field: 'HAuxPropName', title: '辅助属性名称', width: 100 }
                , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                , { field: 'HUnitNumber', title: '计量单位代码', edit: 'text', event: 'HUnitNumber', width: 100 }
                , { field: 'HUnitName', title: '计量单位', width: 100 }
                , { field: 'HAuxQty', title: '辅单位数量', edit: 'text', width: 100, totalRow: true }
                , { field: 'HExpirationDateFlag', title: '是否启用保质期', width: 120, edit: 'checkbox', templet: '#switchTp3', unresize: false }
                , { field: 'HGiveAwayFlag', title: '是否赠品', width: 100, edit: 'checkbox', templet: '#switchTpl', unresize: false }
                , { field: 'HDate', title: '条码日期', width: 100, hide: true }
            ],
            tmBtList: [
                { field: 'HBarCode2', title: '条码编号', width: 100 }
                , { field: 'HMaterNumber2', title: '物料代码', width: 100 }
                , { field: 'HMaterName2', title: '物料名称', width: 100 }
                , { field: 'HMaterModel2', title: '规格型号', width: 100 }
                , { field: 'HAuxPropNumber2', title: '辅助属性代码', width: 100 }
                , { field: 'HAuxPropName2', title: '辅助属性', event: 'HWHCode', width: 120 }
                , { field: 'HGiveAwayFlag2', title: '是否赠品', width: 120, templet: '#switchTpl', unresize: false }
                , { field: 'HUnitCode2', title: '计量单位代码', width: 120 }
                , { field: 'HUnitName2', title: '计量单位', width: 120 }
                , { field: 'HQty2', title: '数量', width: 120 }
                , { field: 'HDate2', title: '进料日期', width: 120 }
                , { field: 'HCusNumber2', title: '客户代码', width: 120 }
                , { field: 'HCusName2', title: '客户', width: 120 }
                , { field: 'HSourceBillNo2', title: '源单单号', width: 120 }
                , { field: 'HSeOrderBillNo2', title: '销售订单号', width: 120 }
                , { field: 'HRemark2', title: '备注', width: 120 }
                , { field: 'HMTONo2', title: '计划跟踪号', width: 120 }
                , { field: 'HShowDate2', title: '日期', width: 100 }
                , { field: 'HInnerBillNo2', title: '内部采购订单号', width: 100 }
                , { field: 'HMaker2', title: '制单人', width: 100 }
            ],
            daBtList: [
                { 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 }
            ],
            HBarCodeTypeList: [],
            HWorksNumberList: [],
            formShow: false,
            temp: undefined,
            formLoading: true,
            zzSelDis: false,
            rowHideShow: false,
            openRowHide: false,
            hPriceTypeList: ['成本价', '结算价'],
            addBtnShow: false,
            zbIndex: null,
            zbSelForm: {},//子表选中数据
            dialogTypeNum: null,//部门弹窗1,仓库弹窗2
            deptShow: false,//部门数据组件
            warehouseShow: false,//仓库数据组件
            materialShow: false,//物料数据组件
            gyEmployeeShow: false,//销售员数据组件
            ScICMOBillShow: false,
            propertyShow: false,
            deptform: {},//弹窗选中数据
            openData: false,//数据弹窗
            dialogTitle: '',
            organizationList: JSON.parse(sessionStorage.getItem('organizationList')),//组织列表
            subDisabled: false,//编辑页面保存按钮是否禁用(true禁用,false可用)
            // OperationType: this.$route.query.OperationType,//保存类型(新增1修改3)
            HInterID: null,
            baseURL: process.env.VUE_APP_BASE_API,
            checkedSysZb: [],
            editWlxxData: [],//子表
            editTmData: [],
            editDaData: [],
            HBarInfo: [],
            HFileList: [],
            editBtData: [],//子表表头
            activeName: 'first',
            // 弹出层标题
            title: "",
            // 是否显示弹出层
            open: false,
            // 日期范围
            dateRange: [],
            // 查询参数
            queryParams: {
                HBillNo: '',
                HInitTimeCycle: 29,
                HProjectNumber: '',
                HCusID: null,
                HMaterNumber: '',
                HMaterName: '',
                ColName1: '',
                ColName2: '',
                ColName: '',
                Comparator1: '',
                Comparator2: '',
                Comparator: '',
                ColContent1: '',
                ColContent2: '',
                ColContent: '',
            },
            // 显示搜索条件
            showSearch: true,
            // 选中数组
            ids: [],
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,
            // 遮罩层
            loading: true,
            btResList: [],
            // 表单参数
            form: {},
            // 表单校验
            rules: {
                HSupName: [
                    { required: true, message: "客户不能为空", trigger: "blur" }
                ],
                HDate: [
                    { required: true, message: "日期不能为空", trigger: "blur" }
                ],
                HExRate: [
                    { required: true, message: "汇率不能为空", trigger: "blur" }
                ]
            },
            paramsForAutoLogin:{                            //自动登录获取超链接参数
            }
        };
    },
    created() {
        this.get_ParamsForAutoLogin()                       //自动登录获取超链接参数
        this.initDataForAutoLogin()                         //自动登录
        this.get_LoginIs()                                  //判断是否登录成功,未登录成功则跳转到登录页面
        this.set_HBarCodeType()
        this.getdata()
    },
    methods: {
        closeBill() {
            this.ScICMOBillShow = false
        },
        get_PrintReport() {
            if (this.danganSelList.length == 0) {
                this.$modal.msgError("请选择数据");
            } else {
                this.rowSel = [];
                for (var i = 0; i < this.danganSelList.length; i++) {
                    this.rowSel.push(this.danganSelList[i].HItemID.toString());
                }
                this.printListShow = true;
                this.openPrintList = true;
                // axios.get(this.baseURL + "/Kf_SellOutBill/CheckSellOutBill_IsExist", {
                //     params: { HInterID: this.rowForm.hmainid },
                // })
                //     .then((response) => {
                //         var result = response.data;
                //         if (result.count == 1) {
                //             this.printListShow = true;
                //             this.openPrintList = true;
                //         } else {
                //             this.$modal.msgError(result.code + result.Message);
                //         }
                //     })
                //     .catch((error) => {
                //         this.$modal.msgError("接口请求失败!");
                //     });
            }
        },
        HOrgIDChange(val) {
            this.organizationList.map(item => {
                if (item.ID == val) {
                    this.HOrgSel = item.Name
                }
            })
        },
        ToolBatch() {
            if (this.HMinQty2 == 0 && this.HMaterID) {
                axios.get(this.baseURL + '/Sc_BarCode/Batch', {
                    params: {
                        "HMaterID": this.HMaterID, "HBatchNo": this.HBatchNo
                    },
                }).then(response => {
                    let data1 = response.data
                    if (data1.count == 1) {
                        if (data1.code == 1) {
                            this.BatchNoArray[0].HBatchNo = data1.data
                            this.BatchNoArray[0].HMinQty = HMinQty2
                            console.log(this.BatchNoArray)
                            this.$modal.msgSuccess(data1.Message, sessionStorage["HTranSlate"])
                        }
                    } else {
                        this.$modal.msgError(data1.Message);
                    }
                }).catch(error => {
                    this.$modal.msgError("请您在获取批号后在输入最小包装数 ^_^");
                })
            } else {
                this.$modal.msgError(data1.Message);
            }
        },
        ToolCreate() {
            this.disabledToolCreate = true
            for (var i = 0; i < this.editWlxxData.length; i++) {
                this.editWlxxData[i].HDate = moment(this.form.HDate).format('YYYY-MM-DD');
                if (this.editWlxxData[i].HMaterName != null && (this.editWlxxData[i].HMaterName.indexOf("\"") != -1 || this.editWlxxData[i].HMaterName.indexOf(";") != -1)) {
                    this.editWlxxData[i].HMaterName = this.editWlxxData[i].HMaterName.replaceAll("\"", "”").replaceAll(";", ";")
                }
                if (this.editWlxxData[i].HMaterModel != null && (this.editWlxxData[i].HMaterModel.indexOf("\"") != -1 || this.editWlxxData[i].HMaterModel.indexOf(";") != -1)) {
                    this.editWlxxData[i].HMaterModel = this.editWlxxData[i].HMaterModel.replaceAll("\"", "”").replaceAll(";", ";")
                }
                if (this.editWlxxData[i].HPinfan != null && ("HPinfan" in this.editWlxxData[i])) {
                    if (this.editWlxxData[i].HPinfan.indexOf("\"") != -1 || this.editWlxxData[i].HPinfan.indexOf(";") != -1) {
                        this.editWlxxData[i].HPinfan = this.editWlxxData[i].HPinfan.replaceAll("\"", "”").replaceAll(";", ";")
                    }
                }
            }
            var sSubStr = JSON.stringify(this.editWlxxData);
            this.HMaterInfo = this.editWlxxData
            if (!this.AllowLoadData(sSubStr)) {//数据验证
                this.disabledToolCreate = false//生成按钮启用
                return false
            }
            //获取选择的组织
            var HOrgType = this.HOrgSel
            console.log(HOrgType)
            //获取选择的工厂代码
            var CampanyName = this.form.HWorksNumber
            if (CampanyName == "" || CampanyName == null) {
                CampanyName = "xxx";
            }
            //获取选择的源单类型
            var HSourceBillType = this.form.HSourceBillType
            //获取选择的条码类型
            var HSelectBarCodeType = this.form.HBarCodeType
            //获取当前登录人员
            var UserName = sessionStorage["HUserName"];
            //var UserName = "Admin";
            var sMainSub = sSubStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' + CampanyName + ';' + UserName;
            this.SaveBarCodeCreate(sMainSub);
        },
        AllowLoadData(sSubStr) {
            var Result = true;
            if (typeof (sSubStr) == "undefined" || sSubStr == "") {
                this.$modal.msgError("没有物料明细记录")
                return Result = false;
            }
            if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") {
                sSubStr = JSON.parse(sSubStr);
                sSubStr.map((item, index) => {
                    if (!item.HMaterID) {
                        this.$modal.msgError("明细记录第" + (index + 1) + "行,物料信息为空!")
                        return Result = false;
                    }
                    if (!item.HQty) {
                        this.$modal.msgError("明细记录第" + (index + 1) + "行,数量为空!")
                        return Result = false;
                    }
                })
            }
            else {
                return Result = true;
            }
            return Result;
        },
        SaveBarCodeCreate(sMainSub, CampanyName) {
            axios({
                method: 'post',
                url: this.baseURL + "/Sc_BarCode/Sub_SaveBill",
                data: {
                    "msg": sMainSub, "CampanyName": CampanyName
                },
            }).then(response => {
                let result = response.data
                if (result.count == 1) { // 说明验证成功了,
                    this.editTmData = result.list // 调用table.reload 重新渲染显示加载追加了数据的表格
                    this.HBarInfo = result.list;
                    //加载档案列表
                    this.editDaData = result.data
                    this.HFileList = result.data;
                    this.barcodeName = 'dangan'
                }
                else {
                    this.disabledToolCreate = false//生成按钮启用
                    this.$modal.msgError(result.Message, sessionStorage["HTranSlate"])
                }
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        editMainTable(row) {
            row.HBQty = Math.ceil(row.HQty / row.HMinQty)
        },
        HSourceBillTypeChange(val) {
            if (val == 1) {
                this.openNum == 10
            }
        },
        set_HBarCodeType() {
            //获取条码类型代码
            axios.get(this.baseURL + '/Sc_BarCode/GetHBarCodeTypeBill').then(response => {
                let result = response.data
                if (result.count == 1) {
                    this.HBarCodeTypeList = result.list
                }
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
            axios.get(this.baseURL + '/Sc_BarCode/GetHWorksNumberBill').then(response => {
                let result = response.data
                if (result.count == 1) {
                    this.HWorksNumberList = result.list
                }
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        getdata() {
            this.formShow = false
            this.formLoading = true
            this.handleAdd()
        },
        // 获取参数_传递的JSON格式参数
        getUrlVars_JSON() {
            var datajson;
            var str = this.propsData; //获取链接中传递的参数
            var arr = str.substring(str.lastIndexOf("=") + 1);
            datajson = JSON.parse(decodeURI(arr));
            return datajson;
        },
        handleRowHide() {
            this.rowHideShow = true
            this.openRowHide = true
        },
        rowSetClose(val) {
            this.rowHideShow = false
            this.openRowHide = val
        },
        getSupType() {
            var type = this.form.HSourceBillType
            switch (type) {
                case '1':
                    return "生产订单";
                    break;
                case '2':
                    return "生产汇报单";
                    break;
                case '3':
                    return "采购订单";
                    break;
                case '4':
                    return "收料通知单";
                    break;
                case '5':
                    return "委外订单";
                    break;
                case '6':
                    return "生产入库单";
                    break;
                case '7':
                    return "采购入库单";
                    break;
                case '8':
                    return "销售退货单";
                    break;
                case '9':
                    return "生产退料单";
                    break;
                case '10':
                    return "工序流转卡";
                    break;
                case '11':
                    return '销售出库单';
                    break;
                case '12':
                    return '领料出库单';
                    break;
            }
        },
        isAllEqual(array) {
            return array.every(item => item === array[0])
        },
        //弹窗赋值
        dbEmitData(deptRow, num) {
            console.log(deptRow)
            if (num) {
                if (num == 'gyProperty') {
                    this.editWlxxData[this.zbIndex].HAuxPropID = deptRow.HItemID;
                    this.editWlxxData[this.zbIndex]["HAuxPropName"] = deptRow["辅助属性名称"];
                    this.editWlxxData[this.zbIndex]["HAuxPropNumber"] = deptRow["辅助属性代码"];
                    this.propertyShow = false;
                    this.openData = false;
                } else if (num == 3) {
                    this.editWlxxData = []
                    for (var i = 0; i < deptRow.length; i++) {
                        this.editWlxxData.push({
                            "HMaterID": deptRow[i].HItemID,
                            "HMaterNumber": deptRow[i].物料代码,
                            "HMaterName": deptRow[i].物料名称,
                            "HMaterModel": deptRow[i].规格型号,
                            "HUnitID": deptRow[i].HUnitID,
                            "HUnitNumber": deptRow[i].计量单位代码,
                            "HUnitName": deptRow[i].计量单位,
                            "HAuxQty": 0,
                        })
                    }
                    this.materialShow = false
                    this.openData = false
                }
                return
            }
            if (deptRow.length > 0) {
                this.zbDataShow = false
                this.editWlxxData = []
                var list = []
                var BillSelect = []
                for (var i = 0; i < deptRow.length; i++) {
                    if (!deptRow[i].部门) {
                        list.push(deptRow[i].部门)
                    }
                    BillSelect.push({
                        BillType: deptRow[i].HBillType,
                        BillTitle: this.getSupType(),
                        BillNo: deptRow[i].单据号,
                        BillMainID: deptRow[i].HMainID,
                        BillSubID: deptRow[i].HSubID,
                        SPID: 0,
                        BatchNo: "",
                        HAuxPropID: 0
                    });
                }
                if (this.isAllEqual(list)) { //不允许选择不同部门
                    //获取选中数据
                    var GrdSelectData = JSON.stringify(BillSelect);
                    //获取选择的源单类型
                    var HSourceBillType = this.getSupType();
                    //获取选择的条码类型
                    var HBarCodeType = this.form.HBarCodeType;
                    //获取当前登录人员
                    var UserName = sessionStorage["HUserName"];
                    var Str = GrdSelectData + ";" + HSourceBillType + ";" + HBarCodeType + ";" + UserName;
                    //通过选择的源单主子内码查找详细信息
                    axios({
                        method: 'post',
                        url: this.baseURL + "/Sc_BarCode/SelectReportFromBillList",
                        data: {
                            "msg": Str
                        },
                    }).then(response => {
                        let result = response.data
                        this.HMaterID = result.list[0].HMaterID;
                        this.HBatchNo = result.list[0].HBatchNo;
                        if (result.count == 1) { // 说明验证成功了,
                            for (let i = 0; i < result.list.length; i++) {
                                result.list[i].HQty = result.list[i].HQty.toString().match(/^\d+(?:\.\d{0,6})?/)[0]  //保留小数点后六位小数
                                if (result.list[i].HMinQty != 0) {
                                    result.list[i].HBQty = Math.ceil(result.list[i].HQty / result.list[i].HMinQty)
                                }
                                result.list[i].HEmpID = sessionStorage["HEmpID"]
                                result.list[i].HEmpNumber = sessionStorage["HEmpNumber"]
                                result.list[i].HEmpName = sessionStorage["HEmpName"]
                            }
                            this.BatchNoArray = result.list;  //获取批号,用来给批次按钮功能中的批号赋值
                            this.editWlxxData = result.list
                            this.ScICMOBillShow = false
                            this.zbDataShow = true
                            this.openData = false
                        }
                    }).catch(error => {
                        this.$modal.msgError("接口请求失败!");
                    })
                } else {
                    this.$modal.msgError("不允许选择不同的部门数据!", sessionStorage["HTranSlate"]);
                }
            } else {
                this.$modal.msgError("请选择数据!");
            }
        },
        emitData(deptRow, num) {
            this.dialogTypeNum = num
            this.deptform = deptRow
        },
        deptClickSub() {
            this.dbEmitData(this.deptform, this.dialogTypeNum)
            this.deptform = {}
        },
        deptClose() {
            this.deptform = {}
            this.openData = false
        },
        //新增编辑表单初始化
        reset() {
            this.form = {
                HOrgID: sessionStorage["OrganizationID"] - 0,
                HWorksNumber: '',
                HDate: moment(new Date()).format('YYYY-MM-DD'),
                HSourceBillType: '1',
                HSourceBillNo: '',
                HBarCodeType: '唯一条码',
            }
            this.editWlxxData = []
            this.editBtData = []
            this.ids = []
            this.subDisabled = false
            this.addBtnShow = false
            this.activeName = 'first'
            this.resetForm("form");
        },
        //退出
        close() {
            this.reset()
            if (!this.OperationType && !this.copyType) {
                const obj = { fullPath: this.$route.path, path: this.$route.path, name: this.$route.name, };
                this.$tab.closePage(obj).then(res => {
                    const latestView = res.visitedViews.slice(-1)[0]
                    if (latestView) {
                        this.$router.push(latestView.fullPath)
                    } else {
                        if (obj.name === 'Dashboard') {
                            this.$router.replace({ path: '/redirect' + obj.fullPath })
                        } else {
                            this.$router.push('/')
                        }
                    }
                });
            } else {
                this.formShow = false
                this.$emit('editClose', false)
            }
            this.$router.push({ path: this.redirect || "/" }).catch(() => { })
        },
        //根据用户获取对应职员、部门、销售主管
        getCzyglByUser() {
            axios.get(this.baseURL + '/Xs_SeOrderBill/getCzyglByUser', {
                params: { "CurUserName": sessionStorage["HUserName"] }
            }).then(response => {
                let dataForm = response.data.data[0]
                this.form.HDeptID = dataForm.HDeptID
                this.form.HDeptName = dataForm.HDeptName
                this.form.HEmpID = dataForm.HEmpID
                this.form.HEmpName = dataForm.HEmpName
                this.form.HManagerID = dataForm.HManagerID
                this.form.HManagerName = dataForm.HManagerName
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        /** 新增按钮操作 */
        handleAdd() {
            this.reset()
            this.handleAddSysZb()
            this.$nextTick(() => {
                this.formShow = true
                this.formLoading = false
            })
        },
        /** 修改按钮操作 */
        handleUpdate() {
            this.reset()
            let rowHmainid = this.linterid
            axios.get(this.baseURL + "/Kf_SellOutBill/cx", {
                params: { 'HInterID': rowHmainid }
            }).then(response => {
                if (response.data.count == 1) {
                    var result = response.data
                    var data = response.data.data[0]
                    this.form.BillType = data.HSourceBillType
                    if (this.copyType == 1) {
                        let date = new Date()
                        this.form.HDate = moment(date).format('YYYY-MM-DDTHH:mm:ss')
                    } else {
                        this.form.HBillNo = data.单据号
                        this.form.HInterID = data.hmainid
                        this.form.HDate = data.日期
                        this.form.HMaker = data.制单人
                        this.form.HUpDater = data.修改人
                        this.form.HChecker = data.审核人
                        this.form.HMakeDate = data.制单日期
                        this.form.HUpDateDate = data.修改日期
                        this.form.HCheckDate = data.审核日期
                        this.form.HCloseMan = data.关闭人
                        this.form.HDeleteMan = data.作废人
                        this.form.HCloseDate = data.关闭日期
                        this.form.HDeleteDate = data.作废日期
                    }
                    this.form.HBillSubType = data.HBillSubType
                    this.form.HMainSourceInterID = data.HMainSourceInterID
                    this.form.HMainSourceEntryID = data.HMainSourceEntryID
                    this.form.HMainSourceBillType = data.HMainSourceBillType
                    this.form.HMainSourceBillNo = data.HMainSourceBillNo
                    this.form.HEmpName = data.业务员
                    this.form.HEmpID = data.HEmpID
                    this.form.HDeptName = data.部门
                    this.form.HDeptID = data.HDeptID
                    this.form.HManagerName = data.主管
                    this.form.HManagerID = data.HManagerID
                    this.form.HSupName = data.客户
                    this.form.HSupID = data.HSupID
                    this.form.HLinkMan = data.联系人
                    this.form.HLinkPhone = data.联系电话
                    this.form.HSecManagerName = data.发货人
                    this.form.HSecManagerID = data.HSecManagerID
                    this.form.HKeeperName = data.保管员
                    this.form.HKeeperID = data.HKeeperID
                    this.form.HRemark = data.表头备注
                    this.form.HProjectNumber = data.项目编码
                    this.form.HProjectID = data.HProjectID
                    this.form.HProjectName = data.项目名称
                    this.form.HGroupName = data.班组
                    this.form.HGroupID = data.HGroupID
                    this.form.HWHName = data.主表仓库
                    this.form.HWHID = data.HWHID_Main
                    this.form.HConveyCompName = data.运输公司
                    this.form.HConveyCompID = data.HConveyCompID
                    this.form.HConveyTypeName = data.运输方式
                    this.form.HConveyTypeID = data.HConveyTypeID
                    this.form.HConveyMoney = data.HConveyMoney
                    this.form.HCarriage = data.运费
                    this.form.HSTOCKORGID = data.HSTOCKORGID
                    this.form.HOWNERID = data.HOWNERID
                    this.form.HSCWHName = data.主表调出仓库
                    this.form.HSCWHID = data.HSCWHID
                    this.form.HCheckStatusMan = data.核销人
                    this.form.HExplanation = data.摘要
                    this.form.HInnerBillNo = data.内部单据号
                    this.form.HCurName = data.币别
                    this.form.HCurID = data.HCurID
                    this.form.HExRate = data.汇率
                    this.form.HSellSName = data.销售方式
                    this.form.HSellSID = data.HSellSID
                    //  this.form.HCusBalance=data
                    //  this.form.HCreditRating_Now=HConveyMoney
                    //  this.form.HAvailableBalance=data
                    this.form.HPriceType = data.单价类型
                    this.form.HOrgID = data.HOrgID
                    for (var i = 0; i < result.data.length; i++) {
                        this.editWlxxData.push(
                            {
                                "HMaterID": result.data[i].HMaterID
                                , "物料代码": result.data[i].物料代码
                                , "物料名称": result.data[i].物料名称
                                , "规格型号": result.data[i].规格型号
                                , "HUnitID": result.data[i].HUnitID
                                , "计量单位": result.data[i].计量单位
                                , "HQtyMust": result.data[i].应发数量.toFixed(6)
                                , "HQty": result.data[i].数量.toFixed(6)
                                , "HPieceQty": result.data[i].件数.toFixed(0)
                                , "HPrice": result.data[i].单价.toFixed(4)
                                , "HTaxPrice": result.data[i].含税单价.toFixed(4)
                                , "HTaxRate": result.data[i].税率
                                , "HMoney": (result.data[i].数量 * result.data[i].单价).toFixed(2)
                                , "HTaxMoney": (result.data[i].数量 * result.data[i].含税单价, 2).toFixed(2)
                                , "HWHID": result.data[i].hwhid
                                , "发货仓库": result.data[i].发货仓库
                                , "HRemark": result.data[i].表体备注
                                , "HQty_Full": result.data[i].满车重量
                                , "HQty_Empty": result.data[i].空车重量
                                , "HQty_Back": result.data[i].回车重量
                                , "HCostPrice": result.data[i].成本单价
                                , "HCostMoney": result.data[i].成本金额
                                , "HSalePrice": result.data[i].销售单价
                                , "HSeOrderInterID": result.data[i].HSeOrderInterID
                                , "HSeOrderEntryID": result.data[i].HSeOrderEntryID
                                , "HSeOrderBillNo": result.data[i].销售订单号
                                , "HSourceInterID": result.data[i].HSourceInterID
                                , "HSourceEntryID": result.data[i].HSourceEntryID
                                , "HSourceBillNo": result.data[i].源单单号
                                , "HSourceBillType": result.data[i].HSourceBillType
                                , "HRelationQty": result.data[i].关联数量
                                , "HRelationMoney": result.data[i].关联金额
                                , 'HSPID': result.data[i].HSPID
                                , 'HSPName': result.data[i].仓位
                                , 'HSPGroupID': result.data[i].HSPGroupID
                                , "HSPGroupName": result.data[i].仓位组
                                , 'HSCWHID': result.data[i].HSCWHID
                                , 'HSCWHName': result.data[i].调出仓库
                                , 'HSCSPID': result.data[i].HSCSPID
                                , 'HSCSPName': result.data[i].调出仓位
                                , 'HBatchNo': result.data[i].批次
                                , 'HPOOrderInterID': result.data[i].采购订单内码
                                , 'HPOOrderEntryID': result.data[i].采购订单子内码
                                , 'HPOOrderBillNo': result.data[i].采购订单号
                                , 'HAuxPropID': result.data[i].HPropertyID
                                , 'HAuxPropName': result.data[i].辅助属性
                                , 'HAuxPropNumber': result.data[i].辅助属性代码
                                , 'HSecUnitID': result.data[i].HSecUnitID
                                , 'HSecUnitName': result.data[i].辅助计量单位
                                , 'HSecUnitRate': result.data[i].换算率
                                , 'HEngineNum': result.data[i].发动机号
                                , 'HUnderPanNum': result.data[i].地盘号
                                , 'HLeaveFactCard': result.data[i].出厂证
                                , 'HReqBuyQty': result.data[i].申请采购数量
                                , 'HReqOutQty': result.data[i].申请出库数量
                                , 'HCurrentInventory': result.data[i].当前库存
                            }
                        );
                    }
                    if (data.状态 != '创建' && this.copyType != 1) {
                        this.$modal.msgError("此条数据不是创建状态,不能修改");
                        this.subDisabled = true
                    }
                    this.formShow = true
                    this.formLoading = false
                }
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        //根据客户带出联系人、联系电话
        getCustomerByCusID(HCusID) {
            axios.get(this.baseURL + "/Xs_SeOrderBill/getCustomerByCusID", {
                params: {
                    HCusID: HCusID
                }
            }).then(response => {
                this.form.联系人 = response.data.data[0].HLinkMan
                this.form.联系电话 = response.data.data[0].HLinkPhone
                // this.form = response.data.data[0]
            }).catch(error => {
                this.$modal.msgError("接口请求失败!");
            });
        },
        /** 销售出库子表明细序号 */
        wlxxzbRowSysZbIndex({ row, rowIndex }) {
            row.index = rowIndex + 1;
        },
        tiaomaZbIndex({ row, rowIndex }) {
            row.index = rowIndex + 1;
        },
        danganZbIndex({ row, rowIndex }) {
            row.index = rowIndex + 1;
        },
        /** 编辑页子表添加按钮操作 */
        handleAddSysZb(index, num) {
            if (num == 1 && !index) {
                this.$modal.msgError("请选择一行数据编辑!");
            } else {
                let obj = {
                    HMainID: 0,
                    HSubID: 0,
                    HSourceBillSEQ: '',
                    HBillNo: '',
                    HMaterID: '',
                    HMaterNumber: '',
                    HMaterName: '',
                    HMaterModel: '',
                    HCusModel: '',
                    HCusMaterName: '',
                    HEmpID: 0,
                    HEmpNumber: '',
                    HEmpName: '',
                    HGroupID: 0,
                    HGroupNumber: '',
                    HGroupName: '',
                    HCheckEmpName: '',
                    HBatchNo: '',
                    HMTONo: '',
                    HQty: 0,
                    HMinQty: 0,
                    HBQty: 0,
                    HPackQty: '',
                    HCoilNO: '',
                    HFurnaceNO: '',
                    HFactory: '',
                    HCusID: 0,
                    HCusNumber: '',
                    HCusName: '',
                    HSeOrderBillNo: '',
                    HRemark: '',
                    HProduceDate: this.form.HDate,
                    HExpiryDate: this.form.HDate,
                    HheatNO: '',
                    HAuxPropID: 0,
                    HAuxPropNumber: '',
                    HAuxPropName: '',
                    HUnitID: 0,
                    HUnitNumber: '',
                    HUnitName: '',
                    HAuxQty: '',
                    HExpirationDateFlag: '',
                    HGiveAwayFlag: '',
                    HDate: this.form.HDate,
                }
                if (index) {
                    this.editWlxxData.splice(index, 0, obj);
                    this.$set(this.editWlxxData, index, obj)
                } else {
                    this.editWlxxData.push(obj);
                }
            }
        },
        handleCopyZbRow() {
            if (!this.zbIndex) {
                this.$modal.msgError("请选择一行数据")
            } else {
                let copyRow = JSON.parse(JSON.stringify(this.zbSelForm))
                this.editWlxxData.push(copyRow);
            }
        },
        /** 编辑页子表删除按钮操作 */
        handleDeleteSysZb(row) {
            this.checkedSysZb = []
            this.checkedSysZb.push(row.index)
            if (this.checkedSysZb.length == 0) {
                this.$modal.msgError("请先选择要删除的商品订单明细数据");
            } else {
                const editWlxxData = this.editWlxxData;
                const checkedSysZb = this.checkedSysZb;
                this.editWlxxData = editWlxxData.filter(function (item) {
                    return checkedSysZb.indexOf(item.index) == -1
                });
            }
        },
        /** 编辑页子表复选框选中数据 */
        handleTableWlxxZbEdit(selection) {
            this.checkedSysZb = selection.map(item => item.index)
            this.zbSelForm = selection[0]
            this.zbIndex = this.checkedSysZb[0]
            if (selection.length > 1) {
                const del_row = selection.shift()
                this.$refs.wlxxzbTable.toggleRowSelection(del_row, false) //设置这一行取消选中
            }
        },
        handleTableDangan(selection) {
            this.danganSelList = selection
        },
        showReset() {
            this.materialShow = false
            this.ScICMOBillShow = false
        },
        //  打开数据列表弹窗
        openDataDialog(num, row) {
            //num1部门,2出库仓库,3物料,4销售员
            if (row) {
                this.zbIndex = row.index - 1
            }
            if (num) {
                switch (num) {
                    case 1:
                        this.dialogTitle = '辅助属性列表'
                        this.propertyShow = true
                        this.openData = true
                            ; break;
                    case 3:
                        this.dialogTitle = '物料列表'
                        this.materialShow = true
                        this.openData = true
                        break;
                }
            } else {
                this.showReset()
                this.HSouceBillType = this.getSupType()
                this.dialogTitle = this.getSupType() + '列表'
                this.ScICMOBillShow = true
                this.openData = true
            }
        },
        //#region 自动登录
        //#region 判断是否登录 未登录则跳到登录页
        get_LoginIs() {
            if (sessionStorage["login"] != "login") {
                this.$modal.msgError("登录失效,请重新登录!!");
                this.$router.push({ path: "/" }).catch(() => { })
            }
        },
        //#endregion
        //#region 自动登录获取超链接参数
        get_ParamsForAutoLogin(){
            var params = this.get_UrlVars();
            this.paramsForAutoLogin.OperationType = params[params[0]];      //操作类型
            this.paramsForAutoLogin.HSourceInterID = params[params[1]];     //源单主id
            this.paramsForAutoLogin.HSourceEntryID = params[params[2]];     //源单子id
            this.paramsForAutoLogin.HSourceBillType = params[params[3]];    //源单类型
            this.paramsForAutoLogin.HSourceBillNo = params[params[4]];      //源单单号
            this.paramsForAutoLogin.HUserName = params[params[5]];          //登录名
            this.paramsForAutoLogin.HPwdWord = params[params[6]];           //登录密码
            this.paramsForAutoLogin.HOrgID = params[params[7]];             //组织id
        },
        //#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 自动登录
        initDataForAutoLogin(){
            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 HUserName = params[params[5]];          //登录名
            var HPwdWord = params[params[6]];           //登录密码
            var HOrgID = params[params[7]];             //组织id
            var HOrgName = "";
            if (HOrgID == 0) {
                this.$modal.msgError("请选择组织!!");
                //判断是否登录 未登录则跳到登录页
                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 = "";
            axios.get(this.baseURL + '/CommonModel/searchMethod', {
                params: {
                    "sql": sql_getHOrgName, "user": HUserName, "ModRightNameCheck": ModRightNameCheck
                },
            }).then(response => {
                let data1 = response.data
                if (data1.count == 1) {
                    if (data1.data.length > 0) {
                        HOrgName = data1.data[0]["HName"];
                    } else {
                        this.$modal.msgError("组织不存在!!");
                    }
                } else {
                    this.$modal.msgError(data1.code + data1.Message);
                }
            }).catch(error => {
                this.$modal.msgError("接口错误!!!");
            })
            var sql_login = "select * from h_v_Gy_Czygl_Login where Czybm = '" + "101" + "'";
            axios.get(this.baseURL + '/CommonModel/searchMethod', {
                params: {
                    "sql": sql_login, "user": HUserName, "ModRightNameCheck": ""
                },
            }).then(response => {
                let data1 = response.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["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";
                    } else {
                        this.$modal.msgError("加载失败!!该金蝶账号未绑定条码系统账号!!");
                        //判断是否登录 未登录则跳到登录页
                        if (sessionStorage["login"] != "login") {
                            this.$modal.msgError("登录失效,请重新登录!!");
                            this.$router.push({ path: "/" }).catch(() => { })
                        }
                    }
                } else {
                    this.$modal.msgError(result.Message);
                    //判断是否登录 未登录则跳到登录页
                    if (sessionStorage["login"] != "login") {
                        this.$modal.msgError("登录失效,请重新登录!!");
                        this.$router.push({ path: "/" }).catch(() => { })
                    }
                }
            }).catch(error => {
                this.$modal.msgError("接口错误!!!");
                //判断是否登录 未登录则跳到登录页
                if (sessionStorage["login"] != "login") {
                    this.$modal.msgError("登录失效,请重新登录!!");
                    this.$router.push({ path: "/" }).catch(() => { })
                }
            })
        },
        //#endregion
        //#endregion
    }
};
</script>
<style>
.input-search-btn {
    background-color: rgb(24, 144, 255) !important;
    color: #fff !important;
}
</style>