Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_online_20240829
niexiting 2 months ago
parent
commit
0a7efcc351
  1. 63
      src/common/basic.js
  2. 14
      src/mycomponents/detail/comDetailCard.vue
  3. 13
      src/mycomponents/job/jobFilter.vue
  4. 13
      src/mycomponents/scan/winScanItem.vue
  5. 30
      src/pages.json
  6. 235
      src/pages/fg/coms/comReceiptPopup.vue
  7. 44
      src/pages/fg/receiptByPlan.vue
  8. 7
      src/pages/issue/coms/comIssueJobCard.vue
  9. 57
      src/pages/issue/job/issueJob.vue
  10. 13
      src/pages/package/record/overPackageRecord.vue
  11. 7
      src/pages/productionReceipt/coms/comProductionJobCard.vue
  12. 103
      src/pages/productionReceipt/job/productionReceiptJob.vue
  13. 6
      src/pages/putaway/job/putawayDetail.vue
  14. 33
      src/pages/putaway/job/putawayJob.vue
  15. 101
      src/pages/query/coms/comPackDetailCard.vue
  16. 18
      src/pages/query/item.vue
  17. 456
      src/pages/query/pack.vue

63
src/common/basic.js

@ -878,6 +878,67 @@ export function getBatch8() {
return year + month + day; return year + month + day;
} }
/**
* 获取前几天和后几天的日期 2024-07-07
*/
export function lastThreeDays(grapDay) {
let dates = [];
for (let i = grapDay; i >= 0; i--) {
// 创建新的Date对象,并减去i天
let date = new Date();
date.setDate(date.getDate() - i);
// 将格式化的日期字符串添加到数组中
dates.push(formatDate(date));
}
for (let i = 0; i <grapDay; i++) {
// 创建新的Date对象,并减去i天
let date = new Date();
date.setDate(date.getDate() + (i+1));
// 将格式化的日期字符串添加到数组中
dates.push(formatDate(date));
}
return dates;
}
//20240702
export function formatDate(date) {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
}
export function getBeforeDayDate(grapDay) {
const today = new Date();
var resultList = []
//获取前几天
var beforeList = []
var afterList = []
for (var i = 0; i < grapDay; i++) {
beforeList.push(today.getDate() - (i + 1))
}
//获取后几天
var afterList = []
for (var i = 0; i < grapDay; i++) {
afterList.push(today.getDate() + (i + 1))
}
resultList.concat(beforeList)
resultList.push(today)
resultList.concat(afterList)
return resultList;
}
export function getCurrDate() { export function getCurrDate() {
var date = new Date(); var date = new Date();
@ -1089,5 +1150,5 @@ export function deepCopyData(target) {
} }
//数组去重重复数据 //数组去重重复数据
export function uniqueArray(arr) { export function uniqueArray(arr) {
return arr.filter((item, index, self) => self.indexOf(item) === index); return arr.filter((item, index, self) => self.indexOf(item) === index);
} }

14
src/mycomponents/detail/comDetailCard.vue

@ -107,14 +107,14 @@
}, },
mounted() { mounted() {
// if (this.detailOptions.length == 0) { if (this.detailOptions.length == 0) {
// this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
// } }
// if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
// this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
// } }
this.showLocation(); // this.showLocation();
}, },
methods: { methods: {

13
src/mycomponents/job/jobFilter.vue

@ -59,7 +59,7 @@
import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue" import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue"
export default { export default {
emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber","productionLineCode","fromLocationCode"], emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber","productionLineCode","fromLocationCode","fromLocationCodeConfirm"],
components: { components: {
winScanJobNumber, winScanJobNumber,
winScanAsnNumber winScanAsnNumber
@ -128,13 +128,8 @@
}, },
methods: { methods: {
// 线 // 线
productionLineCodeConfirm(){ productionLineCodeConfirm(e){
var lineCode="" var lineCode=e
this.productionline.forEach(item=>{
if(item.text==this.productionLineCode){
lineCode=item.value
}
})
this.$emit("productionLineCode", lineCode) this.$emit("productionLineCode", lineCode)
}, },
@ -174,10 +169,12 @@
scanNumberClick() { scanNumberClick() {
this.$refs.scanNumber.openScanPopup(); this.$refs.scanNumber.openScanPopup();
this.closeScanPopup();
}, },
scanOtherClick() { scanOtherClick() {
this.$refs.scanAsnNumber.openScanPopup(); this.$refs.scanAsnNumber.openScanPopup();
this.closeScanPopup();
}, },
getScanAsNumber(val) { getScanAsNumber(val) {

13
src/mycomponents/scan/winScanItem.vue

@ -83,11 +83,6 @@
closeScanPopup() { closeScanPopup() {
this.$refs.popup.close() this.$refs.popup.close()
}, },
getfocus() {
if (this.isShow) {
this.$refs.scan.getfocus()
}
},
scanClick() { scanClick() {
this.$refs.scan.clickScanMsg(); this.$refs.scan.clickScanMsg();
}, },
@ -159,10 +154,14 @@
}) })
}, },
getfocus() { getfocus() {
this.$refs.scan.getfocus(); if(this.$refs.scan){
this.$refs.scan.getfocus();
}
}, },
losefocus() { losefocus() {
this.$refs.scan.losefocus(); if(this.$refs.scan){
this.$refs.scan.losefocus();
}
}, },
} }

30
src/pages.json

@ -82,6 +82,36 @@
} }
} }
}, },
{
"path": "pages/query/pack",
"style": {
"enablePullDownRefresh": true, //
"navigationBarTitleText": "按包装号查询库存",
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{ {
"path": "pages/query/location", "path": "pages/query/location",
"style": { "style": {

235
src/pages/fg/coms/comReceiptPopup.vue

@ -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,9 +126,10 @@
import { import {
getCurrDate, getCurrDate,
getBatch8, getBatch8,
dateFormatData dateFormatData,
lastThreeDays
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
@ -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,14 +263,14 @@
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();
this.$emit("confirm", item); this.$emit("confirm", item);
@ -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 + this.getUomInfo(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);

44
src/pages/fg/receiptByPlan.vue

@ -86,7 +86,7 @@
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_clear" hover-class="btn_commit_after" style="margin-right: 50rpx;" <button class="btn_single_clear" hover-class="btn_commit_after" style="margin-right: 50rpx;"
@click="clear">清空</button> @click="clear">清空</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button>
</view> </view>
</view> </view>
</view> </view>
@ -235,22 +235,35 @@
} }
}, },
async commit() {
submit() {
if (this.allList.length == 0) { if (this.allList.length == 0) {
this.showErrorMessage("请先扫描唯一码") this.showErrorMessage("请先扫描唯一码")
return; return;
} }
if (this.allList.length < this.dataContent.packQty) {
this.$refs.comMessage.showQuestionMessage("扫描数量小于包装规格数量,是否提交?", res => {
if (res) {
this.commit()
}
});
} else {
this.commit();
}
try { },
let params = this.setParams() async commit() {
console.log(JSON.stringify(params))
try {
uni.showLoading({ uni.showLoading({
title: "提交中...", title: "提交中...",
mask: true mask: true
}) })
let params = this.setParams()
console.log(JSON.stringify(params))
let list = [] let list = []
var planData = await planReceiptSubmit(params) var planData = await planReceiptSubmit(params)
if (planData.data) { if (planData.data) {
@ -278,9 +291,9 @@
throw new Error("提交失败") throw new Error("提交失败")
} }
createPutawayRequestByPlan(list[0].requestNumber).then(res=>{ createPutawayRequestByPlan(list[0].requestNumber).then(res => {
createInspectRequestByPlan(list[0].requestNumber) createInspectRequestByPlan(list[0].requestNumber)
}) })
var queryParams = { var queryParams = {
filters: [{ filters: [{
@ -297,7 +310,7 @@
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
} }
var planeInfo = await getPlanByNumber(queryParams); var planeInfo = await getPlanByNumber(queryParams);
if (planeInfo.data && planeInfo.data.list.length > 0) { if (planeInfo.data && planeInfo.data.list.length > 0) {
if (planeInfo.data.list[0].goodQty >= planeInfo.data.list[0].planQty) { if (planeInfo.data.list[0].goodQty >= planeInfo.data.list[0].planQty) {
@ -307,18 +320,19 @@
this.dataContent.handleQty = 0; this.dataContent.handleQty = 0;
this.dataContent.planQty = planeInfo.data.list[0].planQty this.dataContent.planQty = planeInfo.data.list[0].planQty
this.dataContent.goodQty = planeInfo.data.list[0].goodQty this.dataContent.goodQty = planeInfo.data.list[0].goodQty
this.dataContent.noGoodQty = calc.sub(planeInfo.data.list[0].planQty, planeInfo.data.list[0].goodQty), this.dataContent.noGoodQty = calc.sub(planeInfo.data.list[0].planQty, planeInfo.data.list[
this.dataContent.subList = [] 0].goodQty),
this.showList=[]; this.dataContent.subList = []
this.allList=[] this.showList = [];
this.index=1 this.allList = []
this.index = 1
} }
} else { } else {
throw new Error("未查找到单据信息") throw new Error("未查找到单据信息")
} }
uni.hideLoading() uni.hideLoading()
this.showCommitSuccessMessage("提交成功<br>生成报工记录<br>", list) this.showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>"+list[0].requestNumber, list)
} catch (error) { } catch (error) {
uni.hideLoading() uni.hideLoading()

7
src/pages/issue/coms/comIssueJobCard.vue

@ -1,7 +1,12 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
</job-com-main-card> <view class="" >
<text style="font-size: 32rpx; margin-left: 35rpx;">生产线</text>
<text style="font-size: 35rpx; margin-left: 10rpx; font-weight: bold;" >{{dataContent.productionLineCode}}</text>
</view>
</job-com-main-card>
</template> </template>
<script> <script>

57
src/pages/issue/job/issueJob.vue

@ -1,7 +1,7 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionline" <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList"
ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait"
@onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"
@productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode">
@ -11,7 +11,9 @@
<view v-for="(item, index) in jobList" :key="index"> <view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions" <uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card> <com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card>
</uni-swipe-action-item> </uni-swipe-action-item>
</view> </view>
</uni-swipe-action> </uni-swipe-action>
@ -78,8 +80,10 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
productionline: [], productionlineList: [],
title:'' title:'',
productionLine:"",
fromLocation:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -87,7 +91,7 @@
this.getIssueJobByProductionline() this.getIssueJobByProductionline()
}, },
onShow() { onShow() {
this.getList('refresh'); this.getList('refresh',this.fromLocation,this.productionLine);
}, },
onReady() { onReady() {
@ -99,11 +103,11 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList("more"); this.getList("more",this.productionLine);
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh',this.productionLine);
}, },
//退 //退
@ -130,16 +134,20 @@
getIssueJobByProductionline().then(res => { getIssueJobByProductionline().then(res => {
console.log('生产线', res) console.log('生产线', res)
if (res.code == 0) { if (res.code == 0) {
this.productionline = res.data.map(item => ({ this.productionlineList = res.data.map(item => ({
value: item.value, value: item.value,
text: item.name text: item.name
})) }))
this.productionlineList.unshift({
value: "",
text: "全部"
})
} else { } else {
this.productionline = [] this.productionlineList = []
} }
}) })
}, },
getList(type, fromLocationCode = '', productionLineCode = '') { getList(type, fromLocation = '', productionLine = '') {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
@ -172,20 +180,20 @@
value: this.$store.state.user.id value: this.$store.state.user.id
}) })
if (fromLocationCode != '') { if (fromLocation) {
// //
filters.push({ filters.push({
column: "fromLocationCode", column: "fromLocationCode",
action: "==", action: "==",
value: fromLocationCode value: fromLocation
}) })
} }
if (productionLineCode != '') { if (productionLine) {
// 线 // 线
filters.push({ filters.push({
column: "productionLineCode", column: "productionLineCode",
action: "==", action: "==",
value: productionLineCode value: productionLine
}) })
} }
@ -202,6 +210,7 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title+"(" + this.totalCount + ")");
this.loadingType = "loadmore"; this.loadingType = "loadmore";
@ -223,13 +232,13 @@
that.showMessage(error) that.showMessage(error)
}) })
}, },
fromLocationCode(fromLocationCode) { fromLocationCode(fromLocation) {
console.log('fromLocationCode', fromLocationCode) this.fromLocation =fromLocation;
this.getList('refresh', fromLocationCode, '') this.getList('refresh', this.fromLocation, this.productionLine)
}, },
productionLineCode(productionLineCode) { productionLineCode(productionLineCode) {
console.log('productionLineCode', productionLineCode) this.productionLine =productionLineCode
this.getList('refresh', '', productionLineCode) this.getList('refresh', this.fromLocation,this.productionLine)
}, },
getByAsnNumber(code) { getByAsnNumber(code) {
let that = this; let that = this;
@ -296,7 +305,7 @@
cancleJob(id) { cancleJob(id) {
cancleTakeIssueJob(id).then(res => { cancleTakeIssueJob(id).then(res => {
if (res.data) { if (res.data) {
this.getList("refresh") this.getList("refresh",this.fromLocation,this.productionLine)
uni.showToast({ uni.showToast({
title: "放弃任务成功" title: "放弃任务成功"
}) })
@ -311,13 +320,13 @@
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;
this.todayTime = creationTime; this.todayTime = creationTime;
this.getList("refresh"); this.getList("refresh",this.fromLocation,this.productionLine);
}, },
switchChangeWait(state, jobStatus) { switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state; this.checkedWaitTask = state;
this.status = jobStatus; this.status = jobStatus;
this.getList("refresh"); this.getList("refresh",this.fromLocation,this.productionLine);
}, },
getScanNumber(code) { getScanNumber(code) {
@ -340,6 +349,12 @@
action: "==", action: "==",
value: code value: code
}) })
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = { var params = {
filters: filters, filters: filters,

13
src/pages/package/record/overPackageRecord.vue

@ -78,6 +78,7 @@
getBalanceByParams getBalanceByParams
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
deepCopyData,
goHome goHome
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -262,6 +263,8 @@
if(balance.lableQty){ if(balance.lableQty){
newDetail.handleQty =balance.lableQty newDetail.handleQty =balance.lableQty
} }
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.itemCode = balance.itemCode; this.itemCode = balance.itemCode;
@ -281,6 +284,8 @@
if(balance.lableQty){ if(balance.lableQty){
newDetail.handleQty =balance.lableQty newDetail.handleQty =balance.lableQty
} }
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
item.subList.push(newDetail); item.subList.push(newDetail);
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
@ -415,15 +420,15 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var subItem = {}; var subItem = deepCopyData(detail);
Object.assign(subItem, detail)
subItem.itemCode = detail.itemCode; subItem.itemCode = detail.itemCode;
subItem.itemName = detail.package.itemName; subItem.itemName = detail.package.itemName;
subItem.itemDesc1 = detail.package.itemDesc1; subItem.itemDesc1 = detail.package.itemDesc1;
subItem.itemDesc2 = detail.package.itemDesc2; subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = detail.inventoryStatus; subItem.fromInventoryStatus = detail.inventoryStatus;
subItem.fromQty = detail.handleQty subItem.fromQty = detail.handleQty
subItem.fromParentPackingNumber =detail.parentNumber;
subItem.fromPackingNumber = detail.packingNumber; subItem.fromPackingNumber = detail.packingNumber;
subItem.fromBatch = detail.batch; subItem.fromBatch = detail.batch;
subItem.fromLocationCode = detail.locationCode; subItem.fromLocationCode = detail.locationCode;
@ -469,6 +474,8 @@
this.fromLocationCode = ''; this.fromLocationCode = '';
this.dataContent = {} this.dataContent = {}
this.itemCode="" this.itemCode=""
this.toPackUnitShow ="请选择"
this.toPackQty = ""
if (pointData.length > 0) { if (pointData.length > 0) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}` url: `/pages/point/index?points=${JSON.stringify(pointData)}`

7
src/pages/productionReceipt/coms/comProductionJobCard.vue

@ -1,7 +1,12 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
</job-com-main-card> <view class="" >
<text style="font-size: 32rpx; margin-left: 35rpx;">生产线</text>
<text style="font-size: 35rpx; margin-left: 10rpx; font-weight: bold;" >{{dataContent.productionLineCode}}</text>
</view>
</job-com-main-card>
</template> </template>
<script> <script>

103
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -3,13 +3,14 @@
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask"> :checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true"
@productionLineCode="productionLineCode"
:productionline="productionLineList">
</job-filter> </job-filter>
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index"> <view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item <uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-production-job-card :dataContent="item" @click='openJobDetail(item)'> <com-production-job-card :dataContent="item" @click='openJobDetail(item)'>
</com-production-job-card> </com-production-job-card>
@ -23,7 +24,7 @@
<uni-load-more :status="loadingType" /> <uni-load-more :status="loadingType" />
</view> </view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> <win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList> <jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -32,7 +33,8 @@
<script> <script>
import { import {
getProductionReceiptJobList, getProductionReceiptJobList,
cancleTakeProductionReceiptJob cancleTakeProductionReceiptJob,
getIssueJobByProductionline
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -80,16 +82,19 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
title:'', title: '',
scanMessage:"" scanMessage: "",
productionLineList: [],
productionLine:""
}; };
}, },
onLoad(option){ onLoad(option) {
this.title = option.title this.title = option.title
this.getIssueJobByProductionline()
}, },
onShow() { onShow() {
this.getList('refresh'); this.getList('refresh', this.productionLine);
}, },
onReady() { onReady() {
@ -102,11 +107,11 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList("more"); this.getList("more", this.productionLine);
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh', this.productionLine);
}, },
//退 //退
@ -129,7 +134,28 @@
}, },
methods: { methods: {
getList(type) { productionLineCode(productionLineCode) {
this.productionLine = productionLineCode
this.getList('refresh', this.productionLine)
},
getIssueJobByProductionline() {
getIssueJobByProductionline().then(res => {
console.log('生产线', res)
if (res.code == 0) {
this.productionLineList = res.data.map(item => ({
value: item.value,
text: item.name
}))
this.productionLineList.unshift({
value: "",
text: "全部"
})
} else {
this.productionLineList = []
}
})
},
getList(type, productionLine = '') {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
@ -149,18 +175,28 @@
value: this.todayTime value: this.todayTime
}) })
} }
filters.push({ filters.push({
column: "status", column: "status",
action: "in", action: "in",
value: this.status value: this.status
}) })
filters.push({ filters.push({
column: "accept_user_id", column: "accept_user_id",
action: "==", action: "==",
value: this.$store.state.user.id value: this.$store.state.user.id
}) })
if (productionLine) {
// 线
filters.push({
column: "productionLineCode",
action: "==",
value: productionLine
})
}
var params = { var params = {
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
@ -175,7 +211,7 @@
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore"; this.loadingType = "loadmore";
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
this.loadingType = "nomore"; this.loadingType = "nomore";
@ -183,7 +219,7 @@
} }
this.jobList = type === "refresh" ? list : this.jobList.concat(list); this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++; this.pageNo++;
}).catch(error => { }).catch(error => {
if (type === "refresh") { if (type === "refresh") {
@ -198,9 +234,10 @@
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ uni.navigateTo({
url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' + scanMessage +'&title='+this.title url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
}); });
this.scanMessage="" this.scanMessage = ""
}, },
showItemList(itemList) { showItemList(itemList) {
@ -230,12 +267,12 @@
cancleJob(id) { cancleJob(id) {
cancleTakeProductionReceiptJob(id).then(res => { cancleTakeProductionReceiptJob(id).then(res => {
if(res.data){ if (res.data) {
this.getList("refresh") this.getList("refresh", this.productionLine)
uni.showToast({ uni.showToast({
title:"放弃任务成功" title: "放弃任务成功"
}) })
}else { } else {
this.showMessage("放弃任务失败") this.showMessage("放弃任务失败")
} }
}).catch(error => { }).catch(error => {
@ -246,13 +283,13 @@
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;
this.todayTime = creationTime; this.todayTime = creationTime;
this.getList("refresh"); this.getList("refresh", this.productionLine);
}, },
switchChangeWait(state, jobStatus) { switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state; this.checkedWaitTask = state;
this.status = jobStatus; this.status = jobStatus;
this.getList("refresh"); this.getList("refresh"), this.productionLine;
}, },
getScanNumber(code) { getScanNumber(code) {
this.getDataListByType(code) this.getDataListByType(code)
@ -279,7 +316,7 @@
action: "==", action: "==",
value: this.$store.state.user.id value: this.$store.state.user.id
}) })
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
@ -310,11 +347,11 @@
}, },
selectItem(item) { selectItem(item) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item,this.scanMessage); this.openJobDetail(item, this.scanMessage);
}, },
getScanResult(result) { getScanResult(result) {
try { try {
this.scanMessage="" this.scanMessage = ""
var filters = [{ var filters = [{
column: "packingNumber", column: "packingNumber",
action: "==", action: "==",
@ -349,8 +386,8 @@
item.selected = false item.selected = false
}) })
let list = [] let list = []
resultList.forEach(item=>{ resultList.forEach(item => {
if(!list.find(subItem=>subItem.title==item.title)){ if (!list.find(subItem => subItem.title == item.title)) {
list.push(item) list.push(item)
} }
}) })
@ -360,12 +397,12 @@
this.selectItem(list[0]) this.selectItem(list[0])
} }
} else { } else {
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]") this.showMessage("未查找到任务<br>" + "扫描[" + result.scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]") this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
}) })
} catch (e) { } catch (e) {
this.showMessage(e.message) this.showMessage(e.message)
} }
@ -376,4 +413,4 @@
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>

6
src/pages/putaway/job/putawayDetail.vue

@ -305,6 +305,11 @@
var qty = result.label.qty; var qty = result.label.qty;
var itemCode = result.label.itemCode; var itemCode = result.label.itemCode;
var locationCode = result.fromLocationCode; var locationCode = result.fromLocationCode;
if(!result.balance){
this.showMessage("箱码【" + packingNumber + "】没有库存余额")
return;
}
// var inventoryStatus = "OK"; // var inventoryStatus = "OK";
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
@ -364,6 +369,7 @@
scanedLength++; scanedLength++;
} }
}) })
// //
itemDetail.fromInventoryStatus = result.balance.inventoryStatus; itemDetail.fromInventoryStatus = result.balance.inventoryStatus;

33
src/pages/putaway/job/putawayJob.vue

@ -353,13 +353,13 @@ import { Exception } from 'sass';
{ {
column: "status", column: "status",
action: "in", action: "in",
value: '1,2', value: '1,2,3',
}, },
{ // {
column: "accept_user_id", // column: "accept_user_id",
action: "==", // action: "==",
value: this.$store.state.user.id // value: this.$store.state.user.id
} // }
// { // {
// column: "fromLocationCode", // column: "fromLocationCode",
// action: "==", // action: "==",
@ -384,11 +384,24 @@ import { Exception } from 'sass';
list.push(item) list.push(item)
} }
}) })
if (list.length > 1) { if(list.length==1){
this.$refs.jobList.openList(list) //
} else { if(list[0].status==1){
this.selectItem(list[0]) this.selectItem(list[0])
}else if(list[0].status==2){
//
if(list[0].acceptUserId==this.$store.state.user.id){
this.selectItem(list[0])
}else {
this.showMessage("该任务已经被["+list[0].acceptUserName+"]承接"+"<br>任务号["+list[0].number+"]扫描["+result.scanMessage+"]")
}
}else if(list[0].status==3){
this.showMessage("该任务已经完成<br>承接人["+list[0].acceptUserName+"]<br>任务号["+list[0].number+"]扫描["+result.scanMessage+"]")
}
}else {
this.showMessage("查询到多条任务<br>"+"扫描["+result.scanMessage+"]")
} }
} else { } else {
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]") this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]")
} }

101
src/pages/query/coms/comPackDetailCard.vue

@ -0,0 +1,101 @@
<template>
<view class="" style="width: 100%; background-color: #fff; border-radius: 10rpx;">
<view class="uni-flex uni-row space-between" style="align-items: center;">
<view>
<view class="uni-flex uni-row" style="align-items: center;">
<text style="font-size: 30rpx; margin-left: 15rpx;">物料</text>
<item :dataContent="dataContent" style="padding-top: 10rpx; margin-left: 20rpx;"></item>
</view>
<pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<pack v-if=" dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location :locationCode="dataContent.locationCode"></location>
<view class="" v-if="dataContent.jobNumber"
style="font-size: 30rpx; padding-left: 10rpx ; padding-bottom: 10rpx;">
<text style="color: coral; ">任务号</text>
{{dataContent.jobNumber}}
</view>
<view class="" v-if="dataContent.businessType"
style="font-size: 30rpx; padding-left: 10rpx ; padding-bottom: 10rpx;">
<text style="color:green; ">业务类型</text>
{{businessTypeDesc(dataContent.businessType)}}
</view>
</view>
<view class="uni-flex" style="flex-direction: column;">
<view class="uni-flex uni-row center">
<qty :dataContent="dataContent" :isShowStdPack="isShowStdPack" :isShowStatus="true"></qty>
</view>
</view>
</view>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import item from '@/mycomponents/item/item.vue'
import pack from '@/mycomponents/balance/pack.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qty from '@/mycomponents/qty/qty.vue'
import status from '@/mycomponents/status/status.vue'
import location from '@/mycomponents/balance/location.vue'
import {
getBusinessTypeName,
} from '@/common/directory.js';
export default {
components: {
itemQty,
item,
pack,
batch,
qty,
status,
location,
},
data() {
return {
};
},
props: {
dataContent: {
type: Object,
default: null,
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
},
},
methods: {
businessTypeDesc(type) {
return getBusinessTypeName(type)
},
}
}
</script>
<style>
</style>

18
src/pages/query/item.vue

@ -415,7 +415,7 @@
}); });
}, },
afterCloseMessage() { afterCloseMessage() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();
} }
}, },
@ -425,14 +425,18 @@
}, },
confirm(locationCode, status) { confirm(locationCode, status) {
this.locationCode = locationCode; if(this.itemCode){
if(status.length>0){ this.locationCode = locationCode;
var arrayItems = status.join(',') if(status.length>0){
this.inventoryStatus = arrayItems var arrayItems = status.join(',')
this.inventoryStatus = arrayItems
}else {
this.inventoryStatus=""
}
this.tabChange(this.tabIndex)
}else { }else {
this.inventoryStatus="" this.showMessage("请先扫描物料")
} }
this.tabChange(this.tabIndex)
} }
} }
} }

456
src/pages/query/pack.vue

@ -0,0 +1,456 @@
<!-- 基于z-paging封装个性化分页组件演示(vue) -->
<template>
<view class="uni-flex" style="flex-direction: column">
<itemFilter ref="filter" @onConfirmClick="confirm">
</itemFilter>
<view class="top" style="">
<com-blank-view @goScan='openScanPopup' v-if="packingNumber==''"></com-blank-view>
<z-tabs v-if="packingNumber" :list="tabList" @change="tabChange" />
</view>
<view style="padding-top: 100rpx;width:100%">
<view v-if="totalCount>0" style="margin:10rpx; font-size:35rpx; font-weight:bold">总数 : {{totalCount}}
</view>
<view v-for="(item, index) in dataList" style="width:100%" :key="index">
<view class="uni-flex uni-row"
style=" align-items: center; background-color: #fff; border-radius:10rpx;margin:10rpx; ">
<view class="" style="font-size:35rpx; ">
({{index+1}})
</view>
<comPackDetailCard :isShowPack="false" :dataContent="item" style='margin: 10rpx;'>
</comPackDetailCard>
</view>
</view>
<uni-load-more :status="loadingType" v-if="dataList.length>0" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="packingNumber!=''"></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"></win-scan-pack>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getExpectoutByItemcode,
getExpectinByItemcode,
getBalanceByItemCode,
getBasicItemByCode,
getBalanceSummary
} from '@/api/request2.js';
import {
goHome
} from '@/common/basic.js';
import itemInfo from '@/mycomponents/item/itemInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comPackDetailCard from '@/pages/query/coms/comPackDetailCard.vue'
import itemFilter from '@/mycomponents/item/itemFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
export default {
components: {
itemInfo,
comBlankView,
winScanPack,
winScanButton,
comPackDetailCard,
itemFilter,
comEmptyView
},
data() {
return {
//v-model
dataList: [],
tabList: ['明细', '预计出'],
tabIndex: 0,
itemDetail: undefined,
packingNumber: '',
balances: [],
loadingType: "nomore",
totalCount: 0,
locationCode: "",
inventoryStatus: "",
pageSize:10
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
onReachBottom() {
console.log("底部")
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getContentByTab(this.tabIndex, this.pageNo, this.pageSize, "more");
},
onLoad(option){
uni.setNavigationBarTitle({
title: option.title
})
},
mounted() {
this.openScanPopup();
},
onPullDownRefresh() {
this.getContentByTab(this.tabIndex, this.pageNo, this.pageSize, "refresh");
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
getScanResult(result) {
if (!result.label.packingNumber ) {
this.showMessage('包装号不能为空')
return;
}
this.packingNumber =result.label.packingNumber ;
this.tabChange(0)
},
getItemInfo(code) {
uni.showLoading({
title: "正在查询物料信息...",
mask: true
});
getBasicItemByCode(code).then(res => {
uni.hideLoading();
if (res.data.list.length > 0) {
this.closeScanPopup();
this.packingNumber = res.data.list[0].code;
this.itemDetail = res.data.list[0];
this.tabChange(0)
} else {
this.showMessage('未查找到物料【' + code + '】');
}
}).catch(error => {
uni.hideLoading();
this.packingNumber = "";
this.showMessage(error);
})
},
//
getSummary(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getBalanceByItemCode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
this.$refs.paging.complete(false);
uni.hideLoading();
this.showMessage(error);
})
},
//
getDetailList(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getBalanceByItemCode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
uni.hideLoading();
this.showMessage(error);
})
},
getContentByTab(index, pageNo, pageSize, type) {
if (index === 0) this.getDetailList(pageNo, pageSize, type);
else if (index === 1) this.getExpectout(pageNo, pageSize, type);
else if (index === 2) {
// this.getExpectout(pageNo, pageSize, type);
}
},
//
getExpectin(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getExpectinByItemcode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
uni.hideLoading();
this.showMessage(error);
})
},
//
getExpectout(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getExpectoutByItemcode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
uni.hideLoading();
this.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
afterCloseMessage() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
tabChange(index) {
this.tabIndex = index;
this.getContentByTab(index, this.pageNo, this.pageSize, "refresh")
},
confirm(locationCode, status) {
if(this.packingNumber){
this.locationCode = locationCode;
if(status.length>0){
var arrayItems = status.join(',')
this.inventoryStatus = arrayItems
}else {
this.inventoryStatus=""
}
this.tabChange(this.tabIndex)
}else {
this.showMessage("请先扫描物料")
}
}
}
}
</script>
<style scoped lang="scss">
page {
height: 100%;
}
.top{
width: 100%;
position: fixed;
/* #ifdef APP */
top: 0rpx;
/* #endif */
/* #ifdef H5 */
top: 80rpx;
/* #endif */
right: 0;
}
</style>
Loading…
Cancel
Save