|
@ -29,7 +29,21 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class='split_line'></view> |
|
|
<view class='split_line'></view> |
|
|
|
|
|
<view class="title " style="display: flex; align-items: center;padding: 10rpx;"> |
|
|
|
|
|
<text style=" flex-shrink: 0;width: 25%;">计划日期:</text> |
|
|
|
|
|
<view class="customerBorder" @click="showSelectDate"> |
|
|
|
|
|
{{planDate}} |
|
|
|
|
|
</view> |
|
|
|
|
|
<u-select v-model="showDateSelect" mode="mutil-column-auto" |
|
|
|
|
|
:list="planDateList" @confirm="confirmSelectDate"></u-select> |
|
|
|
|
|
|
|
|
|
|
|
<view class=""> |
|
|
|
|
|
<image src="/static/icons/down.svg" mode="" |
|
|
|
|
|
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showSelectDate"> |
|
|
|
|
|
</image> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class='split_line'></view> |
|
|
<view class="title " style="display: flex;align-items: center;padding: 10rpx;"> |
|
|
<view class="title " style="display: flex;align-items: center;padding: 10rpx;"> |
|
|
<text style=" flex-shrink: 0; width: 25%;">物料代码:</text> |
|
|
<text style=" flex-shrink: 0; width: 25%;">物料代码:</text> |
|
|
<view class="customerBorder"> |
|
|
<view class="customerBorder"> |
|
@ -45,17 +59,7 @@ |
|
|
</image> |
|
|
</image> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class='split_line'></view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="title " style="display: flex;align-items: center;padding: 10rpx;"> |
|
|
|
|
|
<text style=" flex-shrink: 0; width: 25%;">批次:</text> |
|
|
|
|
|
<uni-easyinput v-model="batch" ></uni-easyinput> |
|
|
|
|
|
<view class=""> |
|
|
|
|
|
<image src="" mode="" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" |
|
|
|
|
|
@click="showSelectLine"> |
|
|
|
|
|
</image> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<!-- <view class="title " style="display: flex;align-items: center;padding: 10rpx;"> |
|
|
<!-- <view class="title " style="display: flex;align-items: center;padding: 10rpx;"> |
|
|
<text style=" flex-shrink: 0; width: 25%;">计划数量:</text> |
|
|
<text style=" flex-shrink: 0; width: 25%;">计划数量:</text> |
|
|
<view class="customerBorder"> |
|
|
<view class="customerBorder"> |
|
@ -81,6 +85,17 @@ |
|
|
</image> |
|
|
</image> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class='split_line'></view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="title " style="display: flex;align-items: center;padding: 10rpx;"> |
|
|
|
|
|
<text style=" flex-shrink: 0; width: 25%;">批次:</text> |
|
|
|
|
|
<uni-easyinput v-model="batch"></uni-easyinput> |
|
|
|
|
|
<view class=""> |
|
|
|
|
|
<image src="" mode="" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" |
|
|
|
|
|
@click="showSelectLine"> |
|
|
|
|
|
</image> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view class='split_line'></view> |
|
|
<view class='split_line'></view> |
|
|
</view> |
|
|
</view> |
|
@ -111,7 +126,8 @@ |
|
|
import { |
|
|
import { |
|
|
getCurrDate, |
|
|
getCurrDate, |
|
|
getBatch8, |
|
|
getBatch8, |
|
|
dateFormatData |
|
|
dateFormatData, |
|
|
|
|
|
lastThreeDays |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -134,9 +150,9 @@ |
|
|
return { |
|
|
return { |
|
|
itemCode: '请选择物料信息', |
|
|
itemCode: '请选择物料信息', |
|
|
uom: "", |
|
|
uom: "", |
|
|
qty:null, |
|
|
qty: null, |
|
|
planQty: 0, |
|
|
planQty: 0, |
|
|
goodQty:0, |
|
|
goodQty: 0, |
|
|
planNumber: "", |
|
|
planNumber: "", |
|
|
productLineCode: "", |
|
|
productLineCode: "", |
|
|
showProductLineSelect: false, |
|
|
showProductLineSelect: false, |
|
@ -145,14 +161,17 @@ |
|
|
productionLineCode: "", |
|
|
productionLineCode: "", |
|
|
batch: "", |
|
|
batch: "", |
|
|
packUnitName: "请选择包装规格", |
|
|
packUnitName: "请选择包装规格", |
|
|
packUnit :"", |
|
|
packUnit: "", |
|
|
packUnitList: [], |
|
|
packUnitList: [], |
|
|
packQtyHint:"", |
|
|
packQtyHint: "", |
|
|
packQty:0, |
|
|
packQty: 0, |
|
|
showPackUnitSelect: false, |
|
|
showPackUnitSelect: false, |
|
|
itemCodeList: [], |
|
|
itemCodeList: [], |
|
|
showItemCodeSelect: false, |
|
|
showItemCodeSelect: false, |
|
|
workStationCode:"" |
|
|
workStationCode: "", |
|
|
|
|
|
planDate: '', |
|
|
|
|
|
showDateSelect:false, |
|
|
|
|
|
planDateList:[] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
@ -166,8 +185,10 @@ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
|
|
|
openRequestPopup() { |
|
|
openRequestPopup() { |
|
|
this.initData(); |
|
|
this.initData(); |
|
|
|
|
|
this.planDate =getCurrDate() |
|
|
this.batch = getBatch8() |
|
|
this.batch = getBatch8() |
|
|
this.$refs.popup.open('bottom') |
|
|
this.$refs.popup.open('bottom') |
|
|
}, |
|
|
}, |
|
@ -175,8 +196,8 @@ |
|
|
this.itemCode = '请选择物料信息'; |
|
|
this.itemCode = '请选择物料信息'; |
|
|
this.uom = "" |
|
|
this.uom = "" |
|
|
this.planQty = 0 |
|
|
this.planQty = 0 |
|
|
this.goodQty =0; |
|
|
this.goodQty = 0; |
|
|
this.packQty=0; |
|
|
this.packQty = 0; |
|
|
this.planNumber = "" |
|
|
this.planNumber = "" |
|
|
this.productLineCode = "" |
|
|
this.productLineCode = "" |
|
|
this.showProductLineSelect = false |
|
|
this.showProductLineSelect = false |
|
@ -185,13 +206,16 @@ |
|
|
this.productionLineCode = "" |
|
|
this.productionLineCode = "" |
|
|
this.batch = "" |
|
|
this.batch = "" |
|
|
this.packUnitName = "请选择包装规格" |
|
|
this.packUnitName = "请选择包装规格" |
|
|
this.packUnit ="", |
|
|
this.packUnit = "", |
|
|
this.packQtyHint ="" |
|
|
this.packQtyHint = "" |
|
|
this.showPackUnitSelect = false |
|
|
this.showPackUnitSelect = false |
|
|
// this.packUnitList = [] |
|
|
// this.packUnitList = [] |
|
|
this.itemCodeList = [] |
|
|
this.itemCodeList = [] |
|
|
this.showItemCodeSelect = false |
|
|
this.showItemCodeSelect = false |
|
|
this.workStationCode="" |
|
|
this.workStationCode = "" |
|
|
|
|
|
this.planDate="" |
|
|
|
|
|
this.showDateSelect =false |
|
|
|
|
|
this.planDateList=[] |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -203,6 +227,11 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
confirm() { |
|
|
confirm() { |
|
|
|
|
|
if (!this.planDate) { |
|
|
|
|
|
this.showErrorMessage('请先选择计划日期'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (this.productionLineName == "请选择生产线") { |
|
|
if (this.productionLineName == "请选择生产线") { |
|
|
this.showErrorMessage("请选择生产线") |
|
|
this.showErrorMessage("请选择生产线") |
|
|
return |
|
|
return |
|
@ -234,13 +263,13 @@ |
|
|
uom: this.getUomInfo(this.uom), |
|
|
uom: this.getUomInfo(this.uom), |
|
|
batch: this.batch, |
|
|
batch: this.batch, |
|
|
packUnitName: this.packUnitName, |
|
|
packUnitName: this.packUnitName, |
|
|
packUnit:this.packUnit, |
|
|
packUnit: this.packUnit, |
|
|
packQtyHint:this.packQtyHint, |
|
|
packQtyHint: this.packQtyHint, |
|
|
packQty:this.packQty, |
|
|
packQty: this.packQty, |
|
|
planQty: this.planQty, |
|
|
planQty: this.planQty, |
|
|
goodQty:this.goodQty, |
|
|
goodQty: this.goodQty, |
|
|
planNumber: this.planNumber, |
|
|
planNumber: this.planNumber, |
|
|
workStationCode:this.workStationCode |
|
|
workStationCode: this.workStationCode |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
this.closeRequestPopup(); |
|
|
this.closeRequestPopup(); |
|
@ -257,9 +286,36 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
confirmSelectLine(data) { |
|
|
confirmSelectLine(data) { |
|
|
this.productionLineName = data[0].label+"—"+data[1].label |
|
|
this.productionLineName = data[0].label + "—" + data[1].label |
|
|
this.productionLineCode = data[0].value |
|
|
this.productionLineCode = data[0].value |
|
|
this.workStationCode = data[1].value |
|
|
this.workStationCode = data[1].value |
|
|
|
|
|
this.clearItemCode() |
|
|
|
|
|
this.clearPackUnit() |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
clearItemCode(){ |
|
|
|
|
|
this.planDate =getCurrDate() |
|
|
|
|
|
this.itemCode ="请选择物料信息" |
|
|
|
|
|
this.uom = "" |
|
|
|
|
|
this.planQty = 0; |
|
|
|
|
|
this.goodQty = 0 |
|
|
|
|
|
this.planNumber = "" |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
confirmSelectDate(data) { |
|
|
|
|
|
this.planDate=data[0].label |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showSelectDate(){ |
|
|
|
|
|
this.showDateSelect =true; |
|
|
|
|
|
var list =lastThreeDays(3); |
|
|
|
|
|
this.planDateList=[] |
|
|
|
|
|
list.forEach(res=>{ |
|
|
|
|
|
this.planDateList.push({ |
|
|
|
|
|
label :res, |
|
|
|
|
|
value:"" |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showSelectLine() { |
|
|
showSelectLine() { |
|
@ -288,32 +344,36 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
showSelectItemCode() { |
|
|
showSelectItemCode() { |
|
|
|
|
|
if (!this.planDate) { |
|
|
|
|
|
this.showErrorMessage('请先选择计划日期'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
if (!this.productionLineCode) { |
|
|
if (!this.productionLineCode) { |
|
|
this.showErrorMessage('请先选择生产线'); |
|
|
this.showErrorMessage('请先选择生产线'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
console.log("当天", getCurrDate()) |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中", |
|
|
title: "加载中", |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
getPlaneInfoByproductLine(this.productionLineCode, this.planDate).then(res => { |
|
|
getPlaneInfoByproductLine(this.productionLineCode, getCurrDate()).then(res => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if (res.data && res.data.length > 0) { |
|
|
if (res.data && res.data.length > 0) { |
|
|
res.data.forEach(item => { |
|
|
res.data.forEach(item => { |
|
|
item.label = item.itemCode + "(" + item.planQty + item.uom + ")" + "(" + |
|
|
item.label = item.itemCode + "(" + item.planQty + item.uom + ")"+"("+dateFormatData(item.planDate)+")" |
|
|
dateFormatData(item.planDate) + ")" |
|
|
item.value = item |
|
|
item.value = item |
|
|
}) |
|
|
}) |
|
|
this.itemCodeList = res.data |
|
|
this.itemCodeList = res.data |
|
|
this.showItemCodeSelect = true |
|
|
this.showItemCodeSelect = true |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage('未查找到物料信息'); |
|
|
this.showErrorMessage('未查找到物料信息'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
this.showErrorMessage(error); |
|
|
this.showErrorMessage(error); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
confirmSelectItem(data) { |
|
|
confirmSelectItem(data) { |
|
|
let productionPlan = data[0].value; |
|
|
let productionPlan = data[0].value; |
|
@ -322,46 +382,57 @@ |
|
|
this.planQty = productionPlan.planQty; |
|
|
this.planQty = productionPlan.planQty; |
|
|
this.goodQty = productionPlan.goodQty |
|
|
this.goodQty = productionPlan.goodQty |
|
|
this.planNumber = productionPlan.number |
|
|
this.planNumber = productionPlan.number |
|
|
|
|
|
|
|
|
|
|
|
//清除其他数据 |
|
|
|
|
|
this.clearPackUnit(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
clearPackUnit(){ |
|
|
|
|
|
this.packUnitName = "请选择包装规格" |
|
|
|
|
|
this.packUnit = "" |
|
|
|
|
|
let pack = this.packUnitList.filter(r => r.packUnit == this.packUnit); |
|
|
|
|
|
this.packQtyHint = ""; |
|
|
|
|
|
this.packQty = 0 |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showSelectPackUnit() { |
|
|
showSelectPackUnit() { |
|
|
if (this.itemCode == "请选择物料信息") { |
|
|
if (this.itemCode == "请选择物料信息") { |
|
|
this.showErrorMessage('请先选择物料'); |
|
|
this.showErrorMessage('请先选择物料'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中", |
|
|
title: "加载中", |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
getPackUnitByItemCode(this.itemCode).then(res => { |
|
|
getPackUnitByItemCode(this.itemCode).then(res => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
res.data.list.forEach(item => { |
|
|
res.data.list.forEach(item => { |
|
|
item.value = item.packUnit |
|
|
item.value = item.packUnit |
|
|
item.label = getPackUnitName(item.packUnit) + "(" + item.packQty + this |
|
|
item.label = getPackUnitName(item.packUnit) + "(" + item.packQty + this |
|
|
.getUomInfo(item.uom) + ")"; |
|
|
.getUomInfo(item.uom) + ")"; |
|
|
}) |
|
|
}) |
|
|
this.packUnitList = res.data.list |
|
|
this.packUnitList = res.data.list |
|
|
this.showPackUnitSelect = true |
|
|
this.showPackUnitSelect = true |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage('未查找到包装信息'); |
|
|
this.showErrorMessage('未查找到包装信息'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
this.showErrorMessage(error); |
|
|
this.showErrorMessage(error); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
confirmSelectPackUnit(data) { |
|
|
confirmSelectPackUnit(data) { |
|
|
this.packUnitName = data[0].label |
|
|
this.packUnitName = data[0].label |
|
|
this.packUnit =data[0].value |
|
|
this.packUnit = data[0].value |
|
|
let pack = this.packUnitList.filter(r => r.packUnit == this.packUnit); |
|
|
let pack = this.packUnitList.filter(r => r.packUnit == this.packUnit); |
|
|
this.packQtyHint = pack[0].packQty+"("+this |
|
|
this.packQtyHint = pack[0].packQty + "(" + this |
|
|
.getUomInfo(pack[0].uom)+")"; |
|
|
.getUomInfo(pack[0].uom) + ")"; |
|
|
this.packQty =pack[0].packQty |
|
|
this.packQty = pack[0].packQty |
|
|
}, |
|
|
}, |
|
|
getUomInfo(uom) { |
|
|
getUomInfo(uom) { |
|
|
let item = getUomInfo(uom); |
|
|
let item = getUomInfo(uom); |
|
|