|
|
|
@ -60,8 +60,9 @@ |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="25"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="物料编码"> |
|
|
|
<el-input v-model="dataForm.partNo" ></el-input> |
|
|
|
<el-form-item > |
|
|
|
<span slot="label" style="" @click="getBaseList(133,1)" ><a herf="#">物料编码</a></span> |
|
|
|
<el-input v-model="dataForm.partNo" @change="getPartDesc" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
@ -71,12 +72,14 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="库位"> |
|
|
|
<el-input v-model="dataForm.locationId" ></el-input> |
|
|
|
<el-select v-model="dataForm.locationId" style="width: 100%;"> |
|
|
|
<el-option :value="i.locationId" :label="i.locationName" v-for="i in locationList" :key="i.locationId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="dataFormSubmit()">{{'扫描条码入库'}}</el-button> |
|
|
|
<el-button type="primary" @click="scanModel()">{{'扫描条码入库'}}</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -133,7 +136,7 @@ |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="dataFormSubmit()">{{'最终保存'}}</el-button> |
|
|
|
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button> |
|
|
|
<!-- <el-button type="primary" @click="visible = false">{{'关闭'}}</el-button>--> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -144,6 +147,16 @@ |
|
|
|
border |
|
|
|
v-loading="false" |
|
|
|
style="width: 100%; "> |
|
|
|
<el-table-column |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="60" |
|
|
|
fixed="left" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="deleteCach(scope.row)">删除</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
@ -162,16 +175,113 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="扫描入库" :close-on-click-modal="false" v-drag :visible.sync="scanModalFlag" width="620px" > |
|
|
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-row :gutter="25"> |
|
|
|
<el-col :span="12" > |
|
|
|
<el-form-item label="请扫描标签"> |
|
|
|
<el-input ref="scan" v-model="scanSerial" @keyup.enter.native="scanSaveCach()" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="25"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item > |
|
|
|
<span slot="label" style="" @click="getBaseList(133,1)" ><a herf="#">物料编码</a></span> |
|
|
|
<el-input v-model="dataForm.partNo" @change="getPartDesc" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="物料描述"> |
|
|
|
<el-input v-model="dataForm.partDesc" disabled ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="库位"> |
|
|
|
<el-select v-model="dataForm.locationId" style="width: 100%;"> |
|
|
|
<el-option :value="i.locationId" :label="i.locationName" v-for="i in locationList" :key="i.locationId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="25"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="批号"> |
|
|
|
<el-input v-model="dataForm.batchNo" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="W/D/R"> |
|
|
|
<el-input v-model="dataForm.wdrNo" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="生产日期"> |
|
|
|
<el-date-picker |
|
|
|
style="width: 120px" |
|
|
|
v-model="dataForm.manufactureDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="失效日期"> |
|
|
|
<el-date-picker |
|
|
|
style="width: 120px" |
|
|
|
v-model="dataForm.expiredDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="25"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="每卷数量"> |
|
|
|
<el-input v-model="rollData.perQty" type="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="卷数"> |
|
|
|
<el-input v-model="rollData.rollNumber" type="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="createNewRoll()">{{'创建分卷'}}</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="scanModalFlag = false">{{'关闭'}}</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:30px;margin-top: 50px;text-align:center"> |
|
|
|
<el-button type="primary" @click="dataFormSubmit()" >最终保存</el-button> |
|
|
|
<el-button type="primary" @click="scanModalFlag = false">取消</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getLocationListForSearch |
|
|
|
,getPartListForSearch |
|
|
|
} from "@/api/base/normalSearch.js" |
|
|
|
import { |
|
|
|
searchTransDetailAndSubCach |
|
|
|
,createNewCachRoll |
|
|
|
,finalSaveTransHeaderDetail |
|
|
|
,deleteSubCach |
|
|
|
|
|
|
|
} from "@/api/material/poReceive.js" |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist' |
|
|
|
import {searchTransDetail} from "../../../api/material/poReceive"; |
|
|
|
@ -211,11 +321,13 @@ |
|
|
|
manufactureDate:'', |
|
|
|
expiredDate:'', |
|
|
|
}, |
|
|
|
scanModalFlag:false, |
|
|
|
rollData:{ |
|
|
|
perQty:'', |
|
|
|
rollNumber:'', |
|
|
|
}, |
|
|
|
dataList:[], |
|
|
|
scanSerial:'', |
|
|
|
columnList:[ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
@ -259,7 +371,7 @@ |
|
|
|
tableName: "入库单已扫卷", |
|
|
|
columnProp: "rollNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
align: "left", |
|
|
|
columnLabel: "卷号", |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -267,7 +379,7 @@ |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 80 |
|
|
|
columnWidth: 100 |
|
|
|
},{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 200001, |
|
|
|
@ -406,6 +518,7 @@ |
|
|
|
columnWidth: 130 |
|
|
|
}, |
|
|
|
], |
|
|
|
locationList:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
@ -418,22 +531,22 @@ |
|
|
|
this.tagNo1 = type |
|
|
|
this.$nextTick(() => { |
|
|
|
let strVal = '' |
|
|
|
// if (val === 1010) { |
|
|
|
// if(type==1) { |
|
|
|
// strVal = this.dataForm.projectTypeDb |
|
|
|
// } |
|
|
|
// } |
|
|
|
if (val === 133) { |
|
|
|
if(type==1) { |
|
|
|
strVal = this.dataForm.partNo |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.$refs.baseList.init(val, strVal) |
|
|
|
}) |
|
|
|
}, |
|
|
|
/* 列表方法的回调 */ |
|
|
|
getBaseData (val) { |
|
|
|
if (this.tagNo === 1010) { |
|
|
|
// if(this.tagNo1==1) { |
|
|
|
// this.dataForm.projectTypeDb = val.Base_id |
|
|
|
// this.dataForm.projectType = val.Base_desc |
|
|
|
// } |
|
|
|
if (this.tagNo === 133) { |
|
|
|
if(this.tagNo1==1) { |
|
|
|
this.dataForm.partNo = val.part_no |
|
|
|
this.dataForm.partDesc = val.part_desc |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
@ -450,7 +563,7 @@ |
|
|
|
this.dataList = data.rows |
|
|
|
this.dataForm={ |
|
|
|
site:row.site, |
|
|
|
warehouseID:row.warehouseID, |
|
|
|
warehouseID:data.row.warehouseID, |
|
|
|
transNo:row.transNo, |
|
|
|
partnerID:row.partnerID, |
|
|
|
partnerName:row.partnerName, |
|
|
|
@ -465,11 +578,22 @@ |
|
|
|
manufactureDate:'', |
|
|
|
expiredDate:'', |
|
|
|
} |
|
|
|
let inData2={ |
|
|
|
site:row.site, |
|
|
|
warehouseId:data.row.warehouseID, |
|
|
|
active:'Y' |
|
|
|
} |
|
|
|
getLocationListForSearch(inData2).then(({data})=>{ |
|
|
|
if(data.rows.length>0){ |
|
|
|
this.locationList=data.rows |
|
|
|
this.dataForm.locationId=data.rows[0].locationId |
|
|
|
} |
|
|
|
}) |
|
|
|
this.visible = true |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.visible = true |
|
|
|
}, |
|
|
|
createNewRoll(){ |
|
|
|
if(this.dataForm.partNo===''){ |
|
|
|
@ -571,6 +695,99 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getPartDesc(){ |
|
|
|
let data={ |
|
|
|
site:this.dataForm.site, |
|
|
|
partNo:this.dataForm.partNo, |
|
|
|
active:'Y' |
|
|
|
} |
|
|
|
getPartListForSearch(data).then(({data})=>{ |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code == 0) { |
|
|
|
if(data.rows.length>0){ |
|
|
|
this.dataForm.partDesc=data.rows[0].partDesc |
|
|
|
}else { |
|
|
|
this.dataForm.partDesc="" |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteCach(row){ |
|
|
|
this.$confirm('确定要删除这条数据?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteSubCach(row).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.$message.success( '操作成功') |
|
|
|
searchTransDetailAndSubCach(this.dataForm).then(({data})=>{ |
|
|
|
this.dataList = data.rows |
|
|
|
}) |
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
scanModel(){ |
|
|
|
this.scanSerial=''; |
|
|
|
this.scanModalFlag=true; |
|
|
|
}, |
|
|
|
scanSaveCach(){ |
|
|
|
debugger; |
|
|
|
let str=this.scanSerial; |
|
|
|
let arr = str.split(",") |
|
|
|
if(arr.length<7){ |
|
|
|
this.$message.error("二维码格式不对") |
|
|
|
return false |
|
|
|
} |
|
|
|
let batchNo=arr[2] |
|
|
|
if(batchNo.length<4){ |
|
|
|
this.$message.error("二维码格式不对") |
|
|
|
return false |
|
|
|
} |
|
|
|
let yearPrefix = '202'; // 假设年份的前缀是20,如果需要可以调整 |
|
|
|
let year = yearPrefix + batchNo[0]; // 解析年份 |
|
|
|
let month = ""; // 解析月份 |
|
|
|
switch (batchNo[1]) { |
|
|
|
case "x": |
|
|
|
month = "10"; |
|
|
|
break; |
|
|
|
case "y": |
|
|
|
month = "11"; |
|
|
|
break; |
|
|
|
case "z": |
|
|
|
month = "12"; |
|
|
|
break; |
|
|
|
default: |
|
|
|
month = '0'+batchNo[1]; |
|
|
|
} |
|
|
|
let day = batchNo.substring(2,4); // 解析日期 |
|
|
|
let manufactureDate = this.dayjs(year+month+day, 'YYYYDDDHH').toDate(); |
|
|
|
console.log(year) |
|
|
|
console.log(month) |
|
|
|
console.log(day) |
|
|
|
console.log(year+month+day) |
|
|
|
if (isNaN(manufactureDate.getTime())) { |
|
|
|
this.$message.error("生产日期的日期格式不正确") |
|
|
|
return false |
|
|
|
} |
|
|
|
let expiredDate = this.dayjs(arr[6], 'YYYYDDDHH').toDate(); |
|
|
|
if (isNaN(expiredDate.getTime())) { |
|
|
|
this.$message.error("失效日期的日期格式不正确") |
|
|
|
return false |
|
|
|
} |
|
|
|
this.dataForm.manufactureDate=manufactureDate |
|
|
|
this.dataForm.expiredDate=expiredDate |
|
|
|
this.dataForm.batchNo=batchNo; |
|
|
|
this.scanSerial='' |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|