<template>
|
<div style="margin: 10px;">
|
<div style=" margin-bottom: 10px; border-bottom: 1px solid #f6f6f6;">
|
<el-button type="primary" @click="onClickMethod_BarCodeProduce" :disabled="disabledFlag_BarCodeProduce">生成</el-button>
|
<el-button type="primary" @click="get_PrintReport">打印</el-button>
|
<!-- <el-button type="primary" @click="close">退 出</el-button> -->
|
</div>
|
<div style="margin: 10px; font-size: 28px; font-weight: bold; text-align: center;">条码生成</div>
|
<el-form :model="initMainData" label-width="80px">
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="日期">
|
<el-date-picker v-model="initMainData.HDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 100%"> </el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="源单单号">
|
<el-input v-model="initMainData.HMainSourceBillNo" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="采购订单号">
|
<el-input v-model="initMainData.HPOOrderBillNo" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="物料代码">
|
<el-input v-model="initMainData.HMaterNumber" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="物料名称">
|
<el-input v-model="initMainData.HMaterName" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="规格型号">
|
<el-input v-model="initMainData.HMaterModel" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="计量单位">
|
<el-input v-model="initMainData.HUnitName" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="辅助属性代码">
|
<el-input v-model="initMainData.HAuxPropNumber" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="辅助属性名称">
|
<el-input v-model="initMainData.HAuxPropName" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="供应商代码">
|
<el-input v-model="initMainData.HSupNumber" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="供应商名称">
|
<el-input v-model="initMainData.HSupName" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="批号">
|
<el-input v-model="initMainData.HBatchNo"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="源单数量">
|
<el-input-number v-model="initMainData.HQty_SourceBill" @change="onChangeForHQty_SourceBill" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="标准包装数">
|
<el-input-number v-model="initMainData.HMinQty" @change="onChangeForHMinQty" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="包数">
|
<el-input-number v-model="initMainData.HBQty" disabled />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="尾包数量">
|
<el-input-number v-model="initMainData.HEndQty" disabled />
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="采购跟踪号">
|
<el-input v-model="initMainData.HPOOrderBillMTO" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="复检启用">
|
<el-checkbox v-model="initMainData.HReInspectionFlag" disabled>复检启用</el-checkbox>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="生产日期">
|
<el-date-picker v-model="initMainData.HInspectionDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 100%"> </el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="复检周期">
|
<el-input-number v-model="initMainData.HInspectionCycle" disabled/>天
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="复检日期">
|
<el-date-picker v-model="initMainData.HReInspectionDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 100%" disabled> </el-date-picker>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="客户订单号">
|
<el-input v-model="initMainData.HSeOrderBillNo" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="产品型号">
|
<el-input v-model="initMainData.HCusModel" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="组织" @change="onChangeMethod_HOrganization">
|
<el-select v-model="initMainData.HOrganizationID" placeholder="请选择组织" style="width: 100%">
|
<el-option v-for="(item, index) in HOrganizationList" :key="index" :value="item.ID" :label="item.Name"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-tabs type="border-card" v-model="SelectedTabName" style="height:400px;">
|
<!-- 条码列表 -->
|
<el-tab-pane label="条码列表" name="BarCode">
|
<el-table :data="tableData_BarCode" @selection-change="onSelectionChange_BarCode" :row-class-name="RowIndex_BarCode" style="width: 100%" height="900" width="100%" border v-if="tableData_BarCode.length > 0">
|
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column align="center" label="序号" type="index" width="80" fixed />
|
<template v-for="(item, index) in tableColumns_BarCode">
|
<el-table-column :prop="item.field" :label="item.title" :key="index" show-overflow-tooltip :width="item.width" align="center" v-if="!item.hide">
|
<template slot-scope="{row, column }">
|
<div :style="item.style"><span>{{ row[column.label] }}</span> </div>
|
</template>
|
</el-table-column>
|
</template>
|
</el-table>
|
</el-tab-pane>
|
</el-tabs>
|
</el-form>
|
|
<!-- 打印弹窗 -->
|
<el-dialog title="打印模板选择" :visible.sync="openPrintList" width="800px" append-to-body>
|
<PrintList :linterid="rowSel.toString()" :MyMsg="rowSel.toString()" Type="HGy_BarCodeBill"
|
HModName="HGy_BarCodeBill" @rowEditClose="rowSetClose" v-if="printListShow" />
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
import axios from 'axios' //axios请求方法库
|
import moment from 'moment'; //moment.js库
|
import PrintList from "@/views/component/printList"; //打印
|
|
import HSourceReportHtml from '@/views/component/HSourceReportHtml'
|
import GyProperty from "@/views/basic/gyProperty/gyPropertyList.vue";
|
import Material from '@/views/gyMaterial/GyMaterial.vue'
|
|
export default {
|
name: 'Gy_BarCodeBill_JinLong',
|
components: { HSourceReportHtml, PrintList, GyProperty, Material },
|
data() {
|
return {
|
baseURL: process.env.VUE_APP_BASE_API, //后端接口访问前缀
|
HModName: "Gy_BarCodeBill_JinLong", //模块名称
|
disabledFlag_BarCodeProduce:false, //禁用标记-生成 按钮
|
rules:{ //表头form 校验
|
|
},
|
HOrganizationList:[], //组织下拉列表数据
|
initMainData:{ //表头数据初始化
|
HDate: moment().format('YYYY-MM-DD') //日期
|
,HMainSourceInterID:0 //源单主ID
|
,HMainSourceEntryID:0 //源单子ID
|
,HMainSourceBillNo:"" //源单单号
|
,HMainSourceBillType:"" //源单类型
|
,HPOOrderBillNo:"" //采购订单号
|
,HMaterID:0 //物料ID
|
,HMaterNumber:"" //物料代码
|
,HMaterName:"" //物料名称
|
,HMaterModel:"" //规格型号
|
,HUnitID:"" //计量单位ID
|
,HUnitName:"" //计量单位名称
|
,HAuxPropID:0 //辅助属性ID
|
,HAuxPropNumber:"" //辅助属性代码
|
,HAuxPropName:"" //辅助属性
|
,HBatchNo:"" //批号
|
,HSupID:0 //供应商ID
|
,HSupNumber:"" //供应商代码
|
,HSupName:"" //供应商
|
,HQty_SourceBill:0 //源单数量
|
,HMinQty:0 //标准包装数
|
,HBQty:0 //包数
|
,HEndQty:0 //尾包数量
|
,HReInspectionFlag:false //复检启用
|
,HInspectionDate:null //生产日期
|
,HInspectionCycle:0 //复检周期(天)
|
,HReInspectionDate:null //复检日期
|
,HPOOrderBillMTO:"" //采购跟踪号
|
,HSeOrderBillNo:"" //客户订单号
|
,HCusModel:"" //产品型号
|
|
,HOrganizationID:0 //组织ID
|
,HOrganization:"" //组织名称
|
},
|
|
SelectedTabName:"BarCode", //表格页签-当前选择页面name
|
tableColumns_BarCode: [ //条码列表table 列数据
|
{ field: 'HItemID', title: 'HItemID', width: 100, hide: true }
|
, { field: 'hmainid', title: 'hmainid', width: 100, hide: true }
|
, { field: 'hsubid', title: 'hsubid', width: 100, hide: true }
|
, { field: 'HinterID', title: 'HinterID', width: 100, hide: true }
|
, { field: '条码类型', title: '条码类型', width: 100 }
|
, { field: '条码编号', title: '条码编号', width: 120 }
|
, { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
|
, { field: '物料代码', title: '物料代码', width: 120 }
|
, { field: '物料名称', title: '物料名称', width: 120 }
|
, { field: '规格型号', title: '规格型号', width: 120 }
|
, { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
|
, { field: '计量单位代码', title: '计量单位代码', width: 120 }
|
, { field: '计量单位', title: '计量单位', width: 120 }
|
, { field: 'HAuxPropID', title: '辅助属性ID', width: 100, hide: true }
|
, { field: '辅助属性代码', title: '辅助属性代码', width: 120 }
|
, { field: '辅助属性', title: '辅助属性', width: 120 }
|
, { field: '批号', title: '批号', width: 120 }
|
, { field: '数量', title: '数量', width: 100 }
|
, { field: '源单单号', title: '源单单号', width: 120 }
|
, { field: '计划跟踪号', title: '计划跟踪号', width: 120 }
|
, { field: '是否赠品', title: '是否赠品', width: 100 }
|
, { field: 'DeptID', title: '车间ID', width: 100, hide: true }
|
, { field: '车间', title: '车间', width: 120 }
|
, { field: 'HSupID', title: '供应商ID', width: 100, hide: true }
|
, { field: '供应商代码', title: '供应商代码', width: 120 }
|
, { field: '供应商', title: '供应商', width: 120 }
|
, { field: '客户条码编号', title: '客户条码编号', width: 120 }
|
, { field: '客户型号', title: '客户型号', width: 120 }
|
, { field: '往来单位', title: '往来单位', width: 120 }
|
, { field: '销售订单号', title: '销售订单号', width: 120 }
|
, { field: '销售订单行号', title: '销售订单行号', width: 120 }
|
, { field: '托号', title: '托号', width: 120 }
|
, { field: '总托数', title: '总托数', width: 100 }
|
, { field: '条码日期', title: '条码日期', width: 120 }
|
, { field: '生产入库日期', title: '生产入库日期', width: 120 }
|
, { field: '生产入库单号', title: '生产入库单号', width: 120 }
|
, { field: '生产入库次数', title: '生产入库次数', width: 100 }
|
, { field: '销售出库日期', title: '销售出库日期', width: 120 }
|
, { field: '销售出库单号', title: '销售出库单号', width: 120 }
|
, { field: '销售出库次数', title: '销售出库次数', width: 100 }
|
, { field: '作废标记', title: '作废标记', width: 100 }
|
, { field: '作废人', title: '作废人', width: 100 }
|
, { field: '备注', title: '备注', width: 120 }
|
, { field: '制作人', title: '制作人', width: 100 }
|
, { field: '日期', title: '日期', width: 120 }
|
, { field: '计划完工日期', title: '计划完工日期', width: 120 }
|
, { field: '打印次数', title: '打印次数', width: 100 }
|
, { field: 'HSTOCKORGID', title: 'HSTOCKORGID', width: 100, hide: true }
|
, { field: '生成组织', title: '生成组织', width: 120 }
|
],
|
tableData_BarCode:[], //条码列表table 数据
|
RowIndex_BarCode:0, //条码列表table 行索引
|
|
openPrintList:false, //打印弹窗显示标记
|
printListShow:false, //打印模板数据显示标记
|
selectedData_BarCode:0, //条码列表table 选中数据集合
|
};
|
},
|
async created() {
|
this.judgeIsLoging(); //判断是否登录,未登录则跳转回登录页面
|
await this.get_OrganizationList(); //页面初始化 获取组织下拉列表数据
|
await this.initPageData(); //页面初始化
|
},
|
methods: {
|
//#region 判断是否登录,未登录则跳转回登录页面
|
judgeIsLoging(){
|
if (sessionStorage["login"] != "login") {
|
this.$modal.msgError("登录失效,请重新登录!!");
|
this.$router.push({ path: "/" }).catch(() => { })
|
}
|
},
|
//#endregion
|
|
//#region 页面初始化
|
initPageData(){
|
var params = this.get_UrlVars();
|
var OperationType = params[params[0]]; //操作类型
|
|
if (OperationType == "1" || typeof(OperationType)=="undefined") { //
|
|
}
|
else if (OperationType == "4") { //下推
|
this.setInit_PushBill();
|
}
|
else {
|
layer.alert("未知操作类型!", { icon: 5 });
|
}
|
},
|
//#endregion
|
|
//#region 获取组织下拉列表数据
|
async get_OrganizationList() {
|
axios.get(this.baseURL + '/Web/GetOrganizations',{async:false}).then(response => {
|
let result = response.data
|
if (result.count == 1) {
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
this.HOrganizationList.push(
|
{
|
ID:data[i].ID,
|
Name:data[i].Name,
|
}
|
)
|
}
|
|
this.initMainData.HOrganizationID = sessionStorage["OrganizationID"] * 1;
|
}else{
|
this.$modal.msgError(result.message);
|
}
|
}).catch(error => {
|
this.$modal.msgError("接口请求失败!" + error);
|
});
|
},
|
//#endregion
|
|
//#region 组织下拉列表变更事件
|
onChangeMethod_HOrganization(){
|
|
},
|
//#endregion
|
|
//#region 源单数量数据变更事件
|
onChangeForHQty_SourceBill(){
|
if(this.initMainData.HMinQty>0){
|
this.initMainData.HBQty = Math.floor((this.initMainData.HQty_SourceBill / this.initMainData.HMinQty) + (this.initMainData.HQty_SourceBill%this.initMainData.HMinQty == 0?0:1));
|
}else{
|
this.initMainData.HBQty = 0;
|
}
|
if(this.initMainData.HMinQty>0){
|
this.initMainData.HEndQty = this.initMainData.HQty_SourceBill%this.initMainData.HMinQty;
|
}
|
},
|
//#endregion
|
|
//#region 标准包装数数据变更事件
|
onChangeForHMinQty(){
|
if(this.initMainData.HMinQty>0){
|
this.initMainData.HBQty = Math.floor((this.initMainData.HQty_SourceBill / this.initMainData.HMinQty) + (this.initMainData.HQty_SourceBill%this.initMainData.HMinQty == 0?0:1));
|
}else{
|
this.initMainData.HBQty = 0;
|
}
|
if(this.initMainData.HMinQty>0){
|
this.initMainData.HEndQty = this.initMainData.HQty_SourceBill%this.initMainData.HMinQty;
|
}
|
},
|
//#endregion
|
|
//#region 生产按钮点击事件数据校验
|
AllowLoadData(sSubStr) {
|
var Result = true;
|
//数值格式校验工具
|
var ref = /^\d+(\.\d+)?$/; //非负数正则表达式
|
var ref1 = /^[1-9]\d*$/; //正整数正则表达式
|
var temp = "";
|
sSubStr = JSON.parse(sSubStr);
|
|
if (sSubStr[0].HDate == "") {
|
this.$modal.msgError("日期未设置!!");
|
return Result = false;
|
}
|
if (sSubStr[0].HSourceInterID == "0" || sSubStr[0].HSourceEntryID == "0" || sSubStr[0].HSourceBillNo == "") {
|
this.$modal.msgError("源单信息有误!!【主内码:" + sSubStr[0].HSourceInterID + ";子内码:" + sSubStr[0].HSourceEntryID + ";源单号:" + sSubStr[0].HSourceBillNo + ";】");
|
return Result = false;
|
}
|
if (sSubStr[0].HMaterID == "0") {
|
this.$modal.msgError("物料信息有误!!【物料ID:" + sSubStr[0].HMaterID + ";物料代码:" + sSubStr[0].HMaterNumber + ";物料名称:" + sSubStr[0].HMaterName + ";规格型号:" + sSubStr[0].HMaterModel + ";】");
|
return Result = false;
|
}
|
if (sSubStr[0].HSupID == "0") {
|
this.$modal.msgError("供应商信息有误!!【供应商ID:" + sSubStr[0].HMaterID + ";供应商代码:" + sSubStr[0].HMaterNumber + ";供应商名称:" + sSubStr[0].HMaterName + ";】");
|
return Result = false;
|
}
|
|
temp = sSubStr[0].HQty + "";
|
if (temp == "0" || temp == "") {
|
this.$modal.msgError("源单数量不能为0或空!!");
|
return Result = false;
|
} else if (!ref.test(temp)) {
|
this.$modal.msgError("源单数量请输入大于0的数字!!");
|
return Result = false;
|
}
|
|
temp = sSubStr[0].HMinQty + "";
|
if (temp == "0" || temp == "") {
|
this.$modal.msgError("标准包装数不能为0或空!!");
|
return Result = false;
|
} else if (!ref.test(temp)) {
|
this.$modal.msgError("标准包装数请输入大于0的数字!!");
|
return Result = false;
|
}
|
|
temp = sSubStr[0].HBQty + "";
|
if (!ref1.test(temp)) {
|
this.$modal.msgError("包数请输入大于0的整数数字!!");
|
return Result = false;
|
}
|
|
// var HEndQty = this.initMainData.HEndQty;
|
// if (HEndQty == "") {
|
// this.$modal.msgError("尾包数量不能为空!!");
|
// return Result = false;
|
// } else if (!ref.test(HEndQty)) {
|
// this.$modal.msgError("尾包数量请输入不小于0的数字!!");
|
// return Result = false;
|
// }
|
|
return Result;
|
},
|
//#endregion
|
|
//#region 生成按钮点击事件
|
async onClickMethod_BarCodeProduce(){
|
this.disabledFlag_BarCodeProduce = true; //禁用生成按钮
|
|
if (this.initMainData.HMaterName != null && (this.initMainData.HMaterName.indexOf("\"") != -1 || this.initMainData.HMaterName.indexOf(";") != -1)) {
|
this.initMainData.HMaterName = this.initMainData.HMaterName.replaceAll("\"", "”").replaceAll(";", ";")
|
}
|
if (this.initMainData.HMaterModel != null && (this.initMainData.HMaterModel.indexOf("\"") != -1 || this.initMainData.HMaterModel.indexOf(";") != -1)) {
|
this.initMainData.HMaterModel = this.initMainData.HMaterModel.replaceAll("\"", "”").replaceAll(";", ";")
|
}
|
|
//判断生成条码数量是否超过可生成条码数量
|
var temp = await this.getPushSource_POInStockBillInit(this.initMainData.HMainSourceInterID, this.initMainData.HMainSourceEntryID);
|
var dataArray = [];
|
dataArray.push(temp);
|
var HQty_SourceBill = this.initMainData.HQty_SourceBill * 1;
|
if (HQty_SourceBill > ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1))) {
|
this.$modal.msgError("条码生成数量大于最大可生成数量【" + ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1)) + "】!!");
|
return false;
|
}
|
|
var sMainData_temp = [
|
{
|
"HMainID": this.initMainData.HMainSourceInterID
|
, "HSubID": this.initMainData.HMainSourceEntryID
|
, "HBillNo": this.initMainData.HMainSourceBillNo
|
, "HBillType": this.initMainData.HMainSourceBillType
|
, "HMaterID": this.initMainData.HMaterID
|
, "HMaterNumber": this.initMainData.HMaterNumber
|
, "HMaterName": this.initMainData.HMaterName
|
, "HMaterModel": this.initMainData.HMaterModel
|
, "HCusModel": this.initMainData.HCusModel
|
, "HCusMaterName": ""
|
, "HEmpID": 0
|
, "HEmpNumber": ""
|
, "HEmpName": ""
|
, "HGroupID": 0
|
, "HGroupNumber": ""
|
, "HGroupName": ""
|
, "HCheckEmpName": ""
|
, "HBatchNo": this.initMainData.HBatchNo
|
, "HQty": this.initMainData.HQty_SourceBill
|
, "HMinQty": this.initMainData.HMinQty
|
, "HBQty": this.initMainData.HBQty
|
, "HPackQty": 0
|
, "HCoilNO": ""
|
, "HFurnaceNO": ""
|
, "HFactory": ""
|
, "HCusID": 0
|
, "HCusNumber": ""
|
, "HCusName": ""
|
, "HSeOrderBillNo": ""
|
, "HRemark": ""
|
, "HProduceDate": this.initMainData.HDate
|
, "HExpiryDate": this.initMainData.HDate
|
, "HheatNO": ""
|
, "HAuxPropID": this.initMainData.HAuxPropID
|
, "HAuxPropNumber": this.initMainData.HAuxPropNumber
|
, "HAuxPropName": this.initMainData.HAuxPropName
|
, "HUnitID": this.initMainData.HUnitID
|
, "HUnitNumber": ""
|
, "HUnitName": this.initMainData.HUnitName
|
, "HAuxQty": 0
|
, "HExpirationDateFlag": 0
|
, "HGiveAwayFlag": 0
|
, "HDate": this.initMainData.HDate
|
, "HMTONo": ""
|
, "HBarCodeType": "唯一条码"
|
, "HSupID": this.initMainData.HSupID
|
, "HSupNumber": this.initMainData.HSupNumber
|
, "HSupName": this.initMainData.HSupName
|
, "HInnerBillNo": this.initMainData.HPOOrderBillNo
|
, "HReInspectionFlag": this.initMainData.HReInspectionFlag
|
, "HInspectionDate": this.initMainData.HInspectionDate
|
, "HInspectionCycle": this.initMainData.HInspectionCycle
|
, "HReInspectionDate": this.initMainData.HReInspectionDate
|
, "HPOOrderBillMTO": this.initMainData.HPOOrderBillMTO
|
, "HSeOrderBillNo": this.initMainData.HSeOrderBillNo
|
}
|
]
|
|
var sSubStr = JSON.stringify(sMainData_temp);
|
//物料明细信息不为空判断
|
if (!this.AllowLoadData(sSubStr))//数据验证
|
{
|
this.disabledFlag_BarCodeProduce = false; //生成按钮启用
|
return;
|
}
|
var HOrgType = sessionStorage["Organization"]; //获取选择的组织
|
var HSourceBillType = this.initMainData.HMainSourceBillType; //获取选择的源单类型
|
var CampanyName = "xxx"; //获取选择的工厂代码
|
var UserName = sessionStorage["HUserName"]; //获取当前登录人员
|
var sMainSub = sSubStr + ';' + HOrgType + ';' + HSourceBillType + ';' + CampanyName + ';' + UserName;
|
this.SaveBarCodeCreate(sMainSub); //条码生成
|
},
|
//#endregion
|
|
//#region 打印按钮点击事件
|
get_PrintReport() {
|
if (this.selectedData_BarCode.length == 0) {
|
this.$modal.msgError("请选择数据");
|
} else {
|
this.rowSel = [];
|
for (var i = 0; i < this.selectedData_BarCode.length; i++) {
|
this.rowSel.push(this.selectedData_BarCode[i].HItemID.toString());
|
}
|
this.printListShow = true;
|
this.openPrintList = true;
|
}
|
},
|
//#endregion
|
|
//#region 条码列表复选框选择状态变更监听事件
|
onSelectionChange_BarCode(selection){
|
this.selectedData_BarCode = selection;
|
},
|
//#endregion
|
|
//#region 获取参数
|
get_UrlVars() {
|
var vars = [], hash;
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
for (var i = 0; i < hashes.length; i++) {
|
hash = hashes[i].split('=');
|
vars.push(hash[0]);
|
vars[hash[0]] = hash[1];
|
}
|
return vars;
|
},
|
//#endregion
|
|
//#region 根据主内码与子内码获取源单收料通知单数据
|
async getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID) {
|
var res = "none";
|
var sql = "select * from h_v_IF_POInStockBillList_Source where 1=1 and HMainID = " + HSourceInterID + " and HSubID = " + HSourceEntryID;
|
var ModRightNameCheck = "";
|
return axios.get(this.baseURL + '/CommonModel/searchMethod', {
|
async:false,
|
params: {
|
"sql": sql
|
, "user": sessionStorage["HUserName"]
|
, "ModRightNameCheck": ModRightNameCheck
|
},
|
})
|
},
|
//#endregion
|
|
//#region 下推页面初始化
|
async setInit_PushBill(HSourceInterID,HSourceEntryID) {
|
//获取参数
|
var params = this.get_UrlVars();
|
var OperationType = params[params[0]]; //操作类型
|
var HSourceInterID = params[params[1]]; //源单主id
|
var HSourceEntryID = params[params[2]]; //源单子id
|
var HSourceBillType = params[params[3]]; //源单类型
|
var HSourceBillNo = params[params[4]]; //源单单号
|
|
//获取源单信息
|
var temp = null;
|
var res = "none"
|
try{
|
res = await this.getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
|
if(res.data.code=="1"){
|
if(res.data.data.length>0){
|
res = await this.getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
|
}else{
|
res = "none";
|
this.$modal.msgError("未查询到当前单据!!!");
|
}
|
}
|
else{
|
res = "none";
|
this.$modal.msgError(res.data.Message);
|
}
|
}catch(error){
|
res = "none";
|
this.$modal.msgError("接口请求失败!" + error);
|
}
|
if(res != "none"){
|
temp = res.data.data[0];
|
}else{
|
return;
|
}
|
|
var dataArray = [];
|
dataArray.push(temp);
|
|
this.initMainData.HDate = moment().format('YYYY-MM-DD');
|
this.initMainData.HMainSourceInterID = HSourceInterID;
|
this.initMainData.HMainSourceEntryID = HSourceEntryID;
|
this.initMainData.HMainSourceBillNo = HSourceBillNo;
|
this.initMainData.HMainSourceBillType = HSourceBillType;
|
this.initMainData.HPOOrderBillNo = dataArray[0].源单单号==null?"":dataArray[0].源单单号;
|
this.initMainData.HMaterID = dataArray[0].HMaterID==null?0:dataArray[0].HMaterID;
|
this.initMainData.HMaterNumber = dataArray[0].物料代码==null?"":dataArray[0].物料代码;
|
this.initMainData.HMaterName = dataArray[0].物料名称==null?"":dataArray[0].物料名称;
|
this.initMainData.HMaterModel = dataArray[0].规格型号==null?"":dataArray[0].规格型号;
|
this.initMainData.HUnitID = dataArray[0].HUnitID==null?0:dataArray[0].HUnitID;
|
this.initMainData.HUnitName = dataArray[0].计量单位==null?"":dataArray[0].计量单位;
|
this.initMainData.HAuxPropID = dataArray[0].HAuxPropID==null?0:dataArray[0].HAuxPropID;
|
this.initMainData.HAuxPropNumber = dataArray[0].辅助属性代码==null?"":dataArray[0].辅助属性代码;
|
this.initMainData.HAuxPropName = dataArray[0].辅助属性==null?"":dataArray[0].辅助属性;
|
this.initMainData.HSupID = dataArray[0].HSupID==null?0:dataArray[0].HSupID;
|
this.initMainData.HSupNumber = dataArray[0].供应商代码==null?"":dataArray[0].供应商代码;
|
this.initMainData.HSupName = dataArray[0].供应商==null?"":dataArray[0].供应商;
|
this.initMainData.HBatchNo = dataArray[0].批号==null?"":dataArray[0].批号;
|
this.initMainData.HQty_SourceBill = ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1))<0?0:((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1));
|
this.initMainData.HReInspectionFlag = dataArray[0].复检标记==1?true:false;
|
this.initMainData.HInspectionCycle = dataArray[0].复检标记==1?dataArray[0].复检周期:0;
|
this.initMainData.HInspectionDate = dataArray[0].复检标记==1?moment(dataArray[0].检验日期).format('YYYY-MM-DD'):null;
|
this.initMainData.HReInspectionDate = dataArray[0].复检标记==1?moment(dataArray[0].检验日期).add(dataArray[0].复检周期,"days").format('YYYY-MM-DD') :null;
|
this.initMainData.HPOOrderBillMTO = dataArray[0].采购跟踪号;
|
this.initMainData.HSeOrderBillNo = dataArray[0].客户订单号;
|
this.initMainData.HCusModel = dataArray[0].产品型号;
|
this.initMainData.HMinQty = 0;
|
if(this.initMainData.HMinQty>0){
|
this.initMainData.HBQty = (this.initMainData.HQty_SourceBill / this.initMainData.HMinQty) + (this.initMainData.HQty_SourceBill%this.initMainData.HMinQty == 0?0:1);
|
}else{
|
this.initMainData.HBQty = 0;
|
}
|
if(this.initMainData.HMinQty>0){
|
this.initMainData.HEndQty = this.initMainData.HQty_SourceBill%this.initMainData.HMinQty;
|
}
|
},
|
//#endregion
|
|
//#region 条码生成
|
SaveBarCodeCreate(sMainSub, CampanyName) {
|
axios({
|
method: 'post',
|
url: this.baseURL + "/Sc_BarCode/Sub_SaveBill_JinLong",
|
data: {
|
"msg": sMainSub, "CampanyName": CampanyName
|
},
|
}).then(response => {
|
let result = response.data
|
if (result.count == 1) { // 说明验证成功了,
|
this.tableData_BarCode = result.data;
|
console.log(this.tableData_BarCode);
|
}
|
else {
|
this.disabledFlag_BarCodeProduce = false //生成按钮启用
|
this.$modal.msgError(result.Message);
|
}
|
}).catch(error => {
|
this.disabledFlag_BarCodeProduce = false //生成按钮启用
|
this.$modal.msgError("接口请求失败!");
|
});
|
}
|
//#endregion
|
}
|
};
|
</script>
|
<style>
|
.input-search-btn {
|
background-color: rgb(24, 144, 255) !important;
|
color: #fff !important;
|
}
|
</style>
|