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 4 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;
}
/**
* 获取前几天和后几天的日期 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() {
var date = new Date();
@ -1089,5 +1150,5 @@ export function deepCopyData(target) {
}
//数组去重重复数据
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() {
// if (this.detailOptions.length == 0) {
// this.detailOptions = getDetailOption();
// }
// if (this.scanOptions.length == 0) {
// this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
// }
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
}
this.showLocation();
// this.showLocation();
},
methods: {

13
src/mycomponents/job/jobFilter.vue

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

13
src/mycomponents/scan/winScanItem.vue

@ -83,11 +83,6 @@
closeScanPopup() {
this.$refs.popup.close()
},
getfocus() {
if (this.isShow) {
this.$refs.scan.getfocus()
}
},
scanClick() {
this.$refs.scan.clickScanMsg();
},
@ -159,10 +154,14 @@
})
},
getfocus() {
this.$refs.scan.getfocus();
if(this.$refs.scan){
this.$refs.scan.getfocus();
}
},
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",
"style": {

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

@ -29,7 +29,21 @@
</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>
<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;">
<text style=" flex-shrink: 0; width: 25%;">物料代码</text>
<view class="customerBorder">
@ -45,17 +59,7 @@
</image>
</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;">
<text style=" flex-shrink: 0; width: 25%;">计划数量</text>
<view class="customerBorder">
@ -81,6 +85,17 @@
</image>
</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>
@ -111,9 +126,10 @@
import {
getCurrDate,
getBatch8,
dateFormatData
dateFormatData,
lastThreeDays
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
@ -134,9 +150,9 @@
return {
itemCode: '请选择物料信息',
uom: "",
qty:null,
qty: null,
planQty: 0,
goodQty:0,
goodQty: 0,
planNumber: "",
productLineCode: "",
showProductLineSelect: false,
@ -145,14 +161,17 @@
productionLineCode: "",
batch: "",
packUnitName: "请选择包装规格",
packUnit :"",
packUnit: "",
packUnitList: [],
packQtyHint:"",
packQty:0,
packQtyHint: "",
packQty: 0,
showPackUnitSelect: false,
itemCodeList: [],
showItemCodeSelect: false,
workStationCode:""
workStationCode: "",
planDate: '',
showDateSelect:false,
planDateList:[]
}
},
props: {
@ -166,8 +185,10 @@
},
},
methods: {
openRequestPopup() {
this.initData();
this.planDate =getCurrDate()
this.batch = getBatch8()
this.$refs.popup.open('bottom')
},
@ -175,8 +196,8 @@
this.itemCode = '请选择物料信息';
this.uom = ""
this.planQty = 0
this.goodQty =0;
this.packQty=0;
this.goodQty = 0;
this.packQty = 0;
this.planNumber = ""
this.productLineCode = ""
this.showProductLineSelect = false
@ -185,13 +206,16 @@
this.productionLineCode = ""
this.batch = ""
this.packUnitName = "请选择包装规格"
this.packUnit ="",
this.packQtyHint =""
this.packUnit = "",
this.packQtyHint = ""
this.showPackUnitSelect = false
// this.packUnitList = []
this.itemCodeList = []
this.showItemCodeSelect = false
this.workStationCode=""
this.workStationCode = ""
this.planDate=""
this.showDateSelect =false
this.planDateList=[]
},
@ -203,6 +227,11 @@
},
confirm() {
if (!this.planDate) {
this.showErrorMessage('请先选择计划日期');
return;
}
if (this.productionLineName == "请选择生产线") {
this.showErrorMessage("请选择生产线")
return
@ -234,14 +263,14 @@
uom: this.getUomInfo(this.uom),
batch: this.batch,
packUnitName: this.packUnitName,
packUnit:this.packUnit,
packQtyHint:this.packQtyHint,
packQty:this.packQty,
packUnit: this.packUnit,
packQtyHint: this.packQtyHint,
packQty: this.packQty,
planQty: this.planQty,
goodQty:this.goodQty,
goodQty: this.goodQty,
planNumber: this.planNumber,
workStationCode:this.workStationCode
workStationCode: this.workStationCode
};
this.closeRequestPopup();
this.$emit("confirm", item);
@ -257,9 +286,36 @@
},
confirmSelectLine(data) {
this.productionLineName = data[0].label+"—"+data[1].label
this.productionLineName = data[0].label + "—" + data[1].label
this.productionLineCode = data[0].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() {
@ -288,32 +344,36 @@
},
showSelectItemCode() {
if (!this.planDate) {
this.showErrorMessage('请先选择计划日期');
return;
}
if (!this.productionLineCode) {
this.showErrorMessage('请先选择生产线');
return;
}
console.log("当天", getCurrDate())
uni.showLoading({
title: "加载中",
mask: true
})
getPlaneInfoByproductLine(this.productionLineCode, getCurrDate()).then(res => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item.itemCode + "(" + item.planQty + item.uom + ")"+"("+dateFormatData(item.planDate)+")"
item.value = item
})
this.itemCodeList = res.data
this.showItemCodeSelect = true
} else {
this.showErrorMessage('未查找到物料信息');
}
uni.showLoading({
title: "加载中",
mask: true
})
getPlaneInfoByproductLine(this.productionLineCode, this.planDate).then(res => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item.itemCode + "(" + item.planQty + this.getUomInfo(item.uom) + ")" + "(" +
dateFormatData(item.planDate) + ")"
item.value = item
})
this.itemCodeList = res.data
this.showItemCodeSelect = true
} else {
this.showErrorMessage('未查找到物料信息');
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
},
confirmSelectItem(data) {
let productionPlan = data[0].value;
@ -322,46 +382,57 @@
this.planQty = productionPlan.planQty;
this.goodQty = productionPlan.goodQty
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() {
if (this.itemCode == "请选择物料信息") {
this.showErrorMessage('请先选择物料');
return;
}
if (this.itemCode == "请选择物料信息") {
this.showErrorMessage('请先选择物料');
return;
}
uni.showLoading({
title: "加载中",
mask: true
})
getPackUnitByItemCode(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
res.data.list.forEach(item => {
item.value = item.packUnit
item.label = getPackUnitName(item.packUnit) + "(" + item.packQty + this
.getUomInfo(item.uom) + ")";
})
this.packUnitList = res.data.list
this.showPackUnitSelect = true
} else {
this.showErrorMessage('未查找到包装信息');
}
uni.showLoading({
title: "加载中",
mask: true
})
getPackUnitByItemCode(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
res.data.list.forEach(item => {
item.value = item.packUnit
item.label = getPackUnitName(item.packUnit) + "(" + item.packQty + this
.getUomInfo(item.uom) + ")";
})
this.packUnitList = res.data.list
this.showPackUnitSelect = true
} else {
this.showErrorMessage('未查找到包装信息');
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
},
confirmSelectPackUnit(data) {
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);
this.packQtyHint = pack[0].packQty+"("+this
.getUomInfo(pack[0].uom)+")";
this.packQty =pack[0].packQty
this.packQtyHint = pack[0].packQty + "(" + this
.getUomInfo(pack[0].uom) + ")";
this.packQty = pack[0].packQty
},
getUomInfo(uom) {
let item = getUomInfo(uom);

44
src/pages/fg/receiptByPlan.vue

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

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

@ -1,7 +1,12 @@
<template>
<job-com-main-card :dataContent="dataContent">
<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>
<script>

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

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

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

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

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

@ -1,7 +1,12 @@
<template>
<job-com-main-card :dataContent="dataContent">
<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>
<script>

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

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

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

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

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

@ -353,13 +353,13 @@ import { Exception } from 'sass';
{
column: "status",
action: "in",
value: '1,2',
value: '1,2,3',
},
{
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
}
// {
// column: "accept_user_id",
// action: "==",
// value: this.$store.state.user.id
// }
// {
// column: "fromLocationCode",
// action: "==",
@ -384,11 +384,24 @@ import { Exception } from 'sass';
list.push(item)
}
})
if (list.length > 1) {
this.$refs.jobList.openList(list)
} else {
this.selectItem(list[0])
if(list.length==1){
//
if(list[0].status==1){
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 {
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() {
if (this.$refs.scanPopup != undefined) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
@ -425,14 +425,18 @@
},
confirm(locationCode, status) {
this.locationCode = locationCode;
if(status.length>0){
var arrayItems = status.join(',')
this.inventoryStatus = arrayItems
if(this.itemCode){
this.locationCode = locationCode;
if(status.length>0){
var arrayItems = status.join(',')
this.inventoryStatus = arrayItems
}else {
this.inventoryStatus=""
}
this.tabChange(this.tabIndex)
}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