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
fe797443b0
  1. 41
      src/api/request2.js
  2. 14
      src/common/basic.js
  3. 29
      src/common/scan.js
  4. 10
      src/common/style/new_style.css
  5. 1
      src/mycomponents/scan/winComScanFg.vue
  6. 90
      src/pages/fg/coms/comReceiptPopup.vue
  7. 438
      src/pages/fg/receiptByPlan.vue
  8. 6
      src/pages/issue/coms/comScanIssuePack.vue
  9. 2
      src/pages/repleinsh/coms/comRepleinshJobCard.vue
  10. 32
      src/pages/repleinsh/coms/comScanReplishPack.vue
  11. 10
      src/pages/repleinsh/job/repleinshJob.vue
  12. 4
      src/pages/stockUp/coms/comScanStockUpPack.vue
  13. 11
      src/pages/stockUp/job/stockUpJobDetail.vue

41
src/api/request2.js

@ -4251,18 +4251,55 @@ export function getPlaneInfoByproductLine(productionLine,planDate) {
} }
/** /**
* * 计划完工提交
* @param {*} * @param {*}
*/ */
export function planReceiptSubmit(params) { export function planReceiptSubmit(params) {
return request({ return request({
url: baseApi + "/wms/production-main/getPlanProductionByProductionLineAndPlanDate", url: baseApi + "/wms/productreceipt-record-main/createByPlan",
method: "post", method: "post",
data:params data:params
}); });
} }
/**
* @param {Object} params 创建计划完工后调用上架申请 number
*/
export function createPutawayRequestByPlan(number) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createPutawayRequest?number="+number,
method: "post",
data:{}
});
}
/**
* @param {Object} params 创建检验申请 number
*/
export function createInspectRequestByPlan(number) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createInspectRequest?number="+number,
method: "post",
data:{}
});
}
/**
* @param {Object} params 查询计划报工单号 number
*/
export function getPlanByNumber(params) {
return request({
url: baseApi + "/wms/production-detail/senior",
method: "post",
data:params
});
}
//查询生产线
export function getProductionlineAndWorkStation() { export function getProductionlineAndWorkStation() {
return request({ return request({
url: baseApi + "/wms/production-main/getProductionlineAndWorkStation", url: baseApi + "/wms/production-main/getProductionlineAndWorkStation",

14
src/common/basic.js

@ -904,6 +904,16 @@ export function dateFormat(time) {
return result; return result;
} }
//2024-07-19
export function dateFormatData(time) {
var result = ""
if (time != null) {
let date = new Date(time);
result = getDate(date);
}
return result;
}
//获取日期部分 //获取日期部分
export function getDate(date) { export function getDate(date) {
@ -1077,3 +1087,7 @@ export function deepCopyData(target) {
return cloneTarget; return cloneTarget;
} }
//数组去重重复数据
export function uniqueArray(arr) {
return arr.filter((item, index, self) => self.indexOf(item) === index);
}

29
src/common/scan.js

@ -0,0 +1,29 @@
import {
getLabelInfo
} from '@/common/label.js';
// export function getLabelInfoResult(scanMsg, headerType callBackInfo) {
// let index = scanMsg.indexOf('\n');
// if (index >= 0) {
// // let content = uni.$u.trim(scanMsg)
// let content = scanMsg
// if (content == "") {
// return ""
// }
// getLabelInfo(content, headerType, callback => {
// let scanResult = callback;
// scanResult.scanMessage = content
// if (scanResult.success) {
// return scanResult
// } else {
// return ""
// }
// });
// }
// }
export function getLabelInfoResult(){
}

10
src/common/style/new_style.css

@ -2463,6 +2463,16 @@ button[disabled] {
width: 180rpx; width: 180rpx;
} }
.btn_single_clear {
background-color: #EBEEF0;
font-size: 30rpx;
color: #000;
text-align: center;
width: 180rpx;
}
.btn_single_reject { .btn_single_reject {
background-color: #F56C6C; background-color: #F56C6C;
font-size: 30rpx; font-size: 30rpx;

1
src/mycomponents/scan/winComScanFg.vue

@ -188,6 +188,7 @@
getMesPackInfo(this.itemCode).then(res => { getMesPackInfo(this.itemCode).then(res => {
try { try {
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
that.clear();
throw new Error("没有查找到物料号【" + this.itemCode + "】对应的生产条码配置") throw new Error("没有查找到物料号【" + this.itemCode + "】对应的生产条码配置")
} }
var result = res.data.list[0] //Mes var result = res.data.list[0] //Mes

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

@ -49,14 +49,13 @@
<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>
<uni-easyinput v-model="batch"></uni-easyinput> <uni-easyinput v-model="batch" ></uni-easyinput>
<view class=""> <view class="">
<image src="" mode="" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" <image src="" mode="" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="showSelectLine"> @click="showSelectLine">
</image> </image>
</view> </view>
</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">
@ -71,9 +70,9 @@
<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">
{{packUnit}} {{packUnitName}}
</view> </view>
<u-select v-model="showPackUnitSelect" mode="mutil-column" :list="packUnitList" <u-select v-model="showPackUnitSelect" mode="single-column" :list="packUnitList"
@confirm="confirmSelectPackUnit"></u-select> @confirm="confirmSelectPackUnit"></u-select>
<view class=""> <view class="">
<image src="/static/icons/down.svg" mode="" <image src="/static/icons/down.svg" mode=""
@ -111,9 +110,14 @@
import { import {
getCurrDate, getCurrDate,
getBatch8 getBatch8,
dateFormatData
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import uom from '@/mycomponents/qty/uom.vue' import uom from '@/mycomponents/qty/uom.vue'
import packQty from '@/mycomponents/qty/packQty.vue' import packQty from '@/mycomponents/qty/packQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
@ -130,19 +134,25 @@
return { return {
itemCode: '请选择物料信息', itemCode: '请选择物料信息',
uom: "", uom: "",
qty:null,
planQty: 0, planQty: 0,
number: "", goodQty:0,
planNumber: "",
productLineCode: "", productLineCode: "",
showProductLineSelect: false, showProductLineSelect: false,
productLineList: [], productLineList: [],
productionLineName: "请选择生产线", productionLineName: "请选择生产线",
productionLineCode: "", productionLineCode: "",
batch: "", batch: "",
packUnit: "请选择包装规格", packUnitName: "请选择包装规格",
packUnit :"",
packUnitList: [],
packQtyHint:"",
packQty:0,
showPackUnitSelect: false, showPackUnitSelect: false,
itemCodeList: [], itemCodeList: [],
showItemCodeSelect: false, showItemCodeSelect: false,
packUnitList: [], workStationCode:""
} }
}, },
props: { props: {
@ -165,18 +175,23 @@
this.itemCode = '请选择物料信息'; this.itemCode = '请选择物料信息';
this.uom = "" this.uom = ""
this.planQty = 0 this.planQty = 0
this.number = "" this.goodQty =0;
this.packQty=0;
this.planNumber = ""
this.productLineCode = "" this.productLineCode = ""
this.showProductLineSelect = false this.showProductLineSelect = false
this.productLineList = [] this.productLineList = []
this.productionLineName = "请选择生产线" this.productionLineName = "请选择生产线"
this.productionLineCode = "" this.productionLineCode = ""
this.batch = "" this.batch = ""
this.packUnit = "请选择包装规格" this.packUnitName = "请选择包装规格"
this.packUnit ="",
this.packQtyHint =""
this.showPackUnitSelect = false this.showPackUnitSelect = false
// this.packUnitList = [] // this.packUnitList = []
this.itemCodeList = [] this.itemCodeList = []
this.showItemCodeSelect = false this.showItemCodeSelect = false
this.workStationCode=""
}, },
@ -203,7 +218,7 @@
return return
} }
if (this.itemCode == "请选择包装规格") { if (this.packUnitName == "请选择包装规格") {
this.showErrorMessage("请选择包装规格") this.showErrorMessage("请选择包装规格")
return return
} }
@ -216,11 +231,16 @@
productionLineName: this.productionLineName, productionLineName: this.productionLineName,
productionLineCode: this.productionLineCode, //线 productionLineCode: this.productionLineCode, //线
itemCode: this.itemCode, itemCode: this.itemCode,
uom: this.uom, uom: this.getUomInfo(this.uom),
batch: this.batch, batch: this.batch,
packUnit: "packUnit", packUnitName: this.packUnitName,
packUnit:this.packUnit,
packQtyHint:this.packQtyHint,
packQty:this.packQty,
planQty: this.planQty, planQty: this.planQty,
number: this.number goodQty:this.goodQty,
planNumber: this.planNumber,
workStationCode:this.workStationCode
}; };
this.closeRequestPopup(); this.closeRequestPopup();
@ -237,8 +257,9 @@
}, },
confirmSelectLine(data) { confirmSelectLine(data) {
this.productionLineName = data[0].label this.productionLineName = data[0].label+"—"+data[1].label
this.productionLineCode = data[0].value this.productionLineCode = data[0].value
this.workStationCode = data[1].value
}, },
showSelectLine() { showSelectLine() {
@ -250,9 +271,6 @@
getProductionlineAndWorkStation().then(res => { getProductionlineAndWorkStation().then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
// res.data.forEach(item => {
// item.label = item.name
// })
this.productLineList = res.data this.productLineList = res.data
this.showProductLineSelect = true this.showProductLineSelect = true
} else { } else {
@ -274,8 +292,6 @@
this.showErrorMessage('请先选择生产线'); this.showErrorMessage('请先选择生产线');
return; return;
} }
if (this.itemCodeList.length == 0) {
console.log("当天", getCurrDate()) console.log("当天", getCurrDate())
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
@ -285,7 +301,7 @@
uni.hideLoading() uni.hideLoading()
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
res.data.forEach(item => { res.data.forEach(item => {
item.label = item.itemCode + "(" + item.planQty + item.uom + ")" item.label = item.itemCode + "(" + item.planQty + item.uom + ")"+"("+dateFormatData(item.planDate)+")"
item.value = item item.value = item
}) })
this.itemCodeList = res.data this.itemCodeList = res.data
@ -298,27 +314,17 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error); this.showErrorMessage(error);
}) })
} else {
this.showItemCodeSelect = true
}
}, },
confirmSelectItem(data) { confirmSelectItem(data) {
let productionPlan = data[0].value; let productionPlan = data[0].value;
this.itemCode = productionPlan.itemCode; this.itemCode = productionPlan.itemCode;
// var item = this.itemCodeList.find(res => res.itemCode == this.itemCode)
this.uom = productionPlan.uom this.uom = productionPlan.uom
this.planQty = productionPlan.planQty this.planQty = productionPlan.planQty;
this.number = productionPlan.number this.goodQty = productionPlan.goodQty
// this.itemCode = data[0].label this.planNumber = productionPlan.number
// var item = this.itemCodeList.find(res => res.itemCode == this.itemCode)
// this.uom = item.uom
// this.planQty = item.planQty
// this.number = item.number
}, },
showSelectPackUnit() { showSelectPackUnit() {
if (this.packUnitList.length == 0) {
if (this.itemCode == "请选择物料信息") { if (this.itemCode == "请选择物料信息") {
this.showErrorMessage('请先选择物料'); this.showErrorMessage('请先选择物料');
return; return;
@ -336,7 +342,7 @@
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('未查找到包装信息');
@ -346,18 +352,16 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error); this.showErrorMessage(error);
}) })
} else {
this.showPackUnitSelect = true
}
}, },
confirmSelectPackUnit(data) { confirmSelectPackUnit(data) {
this.packUnitName = data[0].label
let pack = this.packUnitList.filter(r => r.packUnit == data[0].value)[0]; this.packUnit =data[0].value
// this.packUnit = pack.packQty; let pack = this.packUnitList.filter(r => r.packUnit == this.packUnit);
this.packUnit = data[0].label this.packQtyHint = pack[0].packQty+"("+this
.getUomInfo(pack[0].uom)+")";
this.packQty =pack[0].packQty
}, },
getUomInfo(uom) { getUomInfo(uom) {
let item = getUomInfo(uom); let item = getUomInfo(uom);

438
src/pages/fg/receiptByPlan.vue

@ -1,57 +1,95 @@
<template> <template>
<view class="page-wraper" style="background-color: #fff;"> <view class="page-wraper" style="background-color: #fff;">
<view class="header">
<view class=""> <view class="">
<com-blank-view @goScan='openFg' v-if="!dataContent"></com-blank-view> <com-blank-view @goScan='openFg' v-if="!dataContent"></com-blank-view>
</view> </view>
<view class="" v-if="dataContent">
<view class="page-wraper" v-if="dataContent">
<view class="" style="font-size: 35rpx;padding: 10rpx; padding-left: 15rpx;"> <view class="" style="font-size: 35rpx;padding: 10rpx; padding-left: 15rpx;">
生产计划{{dataContent.number}} 生产计划{{dataContent.planNumber}}
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
<view class="">
<item-qty :dataContent="dataContent" :isShowBalanceQty="false"></item-qty> <view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">计划数</view>
<view>{{dataContent.planQty}}{{dataContent.uom}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">已完工</view>
<view>{{ dataContent.goodQty }}{{dataContent.uom}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">未完工</view>
<view>{{dataContent.noGoodQty}}{{dataContent.uom}}</view>
</view>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
<view class="" style="margin-left: 20rpx;">
<view class="" style="padding-top: 10rpx; padding-bottom: 10rpx; margin-left: 10rpx;">
<item :dataContent="dataContent"></item>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row space-between" style="align-items: center">
<view style="word-break: break-all;">
<batch :batch="dataContent.batch"></batch> <batch :batch="dataContent.batch"></batch>
<view class="card_view "> <view class="card_view ">
<text style="color: #FFA500;padding: 5px;font-size: 35rpx;">包装规格</text> <text style="color: #FFA500;padding: 5px;font-size: 30rpx;">包装规格</text>
<text class="card_content ">{{dataContent.packUnit}}</text> <text class="card_content ">{{dataContent.packUnit}} </text>
</view> </view>
</view> </view>
<view class='split_line'></view> <view style="word-break: break-all; font-size: 35rpx; font-weight: bold;">
<view class="page-main"> <text v-if="dataContent.handleQty>0" style="color: #FFA500;">{{dataContent.handleQty}}/</text>
{{dataContent.packQtyHint}}
</view>
</view>
<view class='split_line' v-if="dataContent"></view>
</view>
</view>
<view style="margin-top: 480rpx; padding-bottom: 160rpx;" v-if="dataContent">
<scroll-view scroll-y="true" class="">
<view class="scan_view" v-for="(item, index) in showList" :key="index">
<uni-swipe-action> <uni-swipe-action>
<view class="scan_view" v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item :right-options="options" @click="swipeClick($event,item,index)"> <uni-swipe-action-item :right-options="options" @click="swipeClick($event,item,index)">
<view class="" style="margin-left: 40rpx; padding-top: 10rpx; padding-bottom: 10rpx;"> <view class="uni-flex uni-row "
<text style="font-size: 35rpx;color: #B66463;">唯一码</text> style="margin-left: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx;">
<text style="font-size: 35rpx;"> {{item.code}}</text> <view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
<text style="font-size: 30rpx;color: #B66463;">唯一码 </text>
{{item.content}}
</view> </view>
</uni-swipe-action-item>
</view> </view>
</uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</scroll-view>
<uni-load-more :status="loadingType" v-if="showList.length>0" />
</view> </view>
<view class="page-footer"> <view class="page-footer" v-if="dataContent">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between " style="background-color:ghostwhite; width: 100%; ">
style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
</view> </view>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_clear" style="margin-right: 50rpx;" hover-class="btn_clear_after" <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="commit">提交</button>
</view> </view>
</view> </view>
</view> </view>
</view>
<comReceiptPopup ref="comReceiptPopup" @confirm='requestConfirm'></comReceiptPopup> <comReceiptPopup ref="comReceiptPopup" @confirm='requestConfirm'></comReceiptPopup>
<win-scan-button v-if="dataContent" @goScan='openScanPopup'></win-scan-button> <win-scan-button v-if="dataContent" @goScan='openScanPopup'></win-scan-button>
<win-scan-fg-label ref="scanPopup" @getResult='getScanResult' title='制品标签'></win-scan-fg-label> <win-scan-fg-label ref="scanPopup" @getResult='getScanResult' title='制品标签'></win-scan-fg-label>
@ -62,32 +100,53 @@
<script> <script>
import { import {
isCheckMesCode, isCheckMesCode,
planReceiptSubmit planReceiptSubmit,
createPutawayRequestByPlan,
createInspectRequestByPlan,
getPlanByNumber
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
getRemoveOption calc
} from '@/common/calc.js';
import {
getRemoveOption,
deepCopyData,
getCurrDateTime,
compare
} from '@/common/basic.js'; } from '@/common/basic.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comReceiptPopup from '@/pages/fg/coms/comReceiptPopup.vue' import comReceiptPopup from '@/pages/fg/coms/comReceiptPopup.vue'
import itemQty from '@/mycomponents/item/itemQty.vue' import item from '@/mycomponents/item/item.vue'
import batch from '@/mycomponents/balance/batch.vue' import batch from '@/mycomponents/balance/batch.vue'
import pack from '@/mycomponents/balance/pack.vue' import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue" import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import {
Exception
} from 'sass';
export default { export default {
components: { components: {
comBlankView, comBlankView,
comReceiptPopup, comReceiptPopup,
itemQty, item,
batch, batch,
pack, pack,
winScanButton, winScanButton,
winScanFgLabel winScanFgLabel,
comFgCard
}, },
data() { data() {
return { return {
dataContent: null, dataContent: null,
options: [] options: [],
showList: [],
allList: [],
index: 1,
loadingType: "",
pageSize: 20
}; };
}, },
@ -97,11 +156,29 @@
this.options = getRemoveOption() this.options = getRemoveOption()
this.openFg(); this.openFg();
}, },
onReachBottom() {
console.log("onReachBottom")
//
if (this.loadingType == 'nomore') {
return;
}
this.index++;
var list = this.getDataPage(this.index, this.pageSize)
if (list.length > 0) {
// this.showList=list
this.showList = this.showList.concat(list)
} else {
//
this.loadingType = "nomore";
}
},
mounted() { mounted() {
}, },
methods: { methods: {
openFg() { openFg() {
setTimeout(res => { setTimeout(res => {
if (this.$refs.comReceiptPopup) { if (this.$refs.comReceiptPopup) {
@ -113,49 +190,173 @@
requestConfirm(result) { requestConfirm(result) {
this.dataContent = { this.dataContent = {
itemCode: result.itemCode, itemCode: result.itemCode,
number: result.number, // planNumber: result.planNumber, //
handleQty: 0, handleQty: 0,
qty: result.planQty, qty: 0,
batch: result.batch, planQty: result.planQty,
packUnit: "3031", goodQty: result.goodQty,
noGoodQty: calc.sub(result.planQty, result.goodQty),
packQtyHint: result.packQtyHint,
packQty: result.packQty,
uom: result.uom, uom: result.uom,
subList: [{ batch: result.batch,
code: "1234" packUnit: result.packUnit,
workStationCode: result.workStationCode,
subList: []
}
},
initList() {
this.index = 1;
this.showList = []
this.loadingType = "";
this.showList = this.getDataPage(this.index, this.pageSize)
},
getDataPage(pageNo, pageSize) {
//
var totalPages = Math.ceil(this.allList.length / pageSize);
//
const start = (pageNo - 1) * pageSize;
const end = start + pageSize; //
return this.allList.slice(start, end)
}, },
{
code: "12345"
swipeClick(e, dataContent, index) {
if (e.content.text == "移除") {
this.$refs.comMessage.showQuestionMessage("是否要移除", res => {
if (res) {
this.allList.splice(index, 1);
this.initList()
} }
] })
} }
}, },
swipeClick(e, dataContent,index) { async commit() {
if (e.content.text == "移除") {
this.dataContent.subList.splice(index,1); if (this.allList.length == 0) {
this.showErrorMessage("请先扫描唯一码")
return;
}
try {
let params = this.setParams()
console.log(JSON.stringify(params))
uni.showLoading({
title: "提交中...",
mask: true
})
let list = []
var planData = await planReceiptSubmit(params)
if (planData.data) {
planData.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
requestNumber: item.requestNumber
})
})
} else {
throw new Error("提交失败")
} }
createPutawayRequestByPlan(list[0].requestNumber).then(res=>{
createInspectRequestByPlan(list[0].requestNumber)
})
var queryParams = {
filters: [{
column: "plan_type",
action: "==",
value: "assemble"
}, },
commit() { {
planReceiptSubmit(params).then(res => { column: "number",
uni.hideLoading() action: "==",
if (res.data) { value: this.dataContent.planNumber
this.showCommitSuccessMessage(res.data) }
],
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) {
this.clear();
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.dataContent.planNumber = planeInfo.data.list[0].number;
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
}
} else {
throw new Error("未查找到单据信息")
} }
}).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showCommitSuccessMessage("提交成功<br>生成报工记录<br>", list)
} catch (error) {
uni.hideLoading()
var hint = error.message ? error.message : error
this.showErrorMessage(hint)
}
},
setParams() {
this.allList.forEach(res => {
res.outsideItemCode = res.itemCode
res.outsideProduceDate = null
res.outsideSerialNumber = res.order
}) })
this.dataContent.subList = this.allList
return this.dataContent
}, },
clear() { clear() {
this.$refs.comMessage.showQuestionMessage("是否要清空?", res => {
if (res) {
this.clearData()
this.openFg();
}
})
}, },
clearData() {
this.dataContent = null
this.showList = []
this.allList = []
this.index = 1;
},
openScanPopup() { openScanPopup() {
var itemCode = this.dataContent.itemCode var itemCode = this.dataContent.itemCode
// itemCode = "015553147"
console.log("物料", itemCode) console.log("物料", itemCode)
this.$refs.scanPopup.openScanPopup(itemCode); this.$refs.scanPopup.openScanPopup(itemCode);
}, },
@ -163,41 +364,51 @@
let that = this; let that = this;
//TODO //TODO
//mes //mes
isCheckMesCode(result.content).then(res=>{ isCheckMesCode(result.content).then(res => {
if(res.data){ if (res.data) {
if (that.dataContent) { if (that.dataContent) {
let list = that.dataContent.subList; //
var itemIndex = list.findIndex(r => var itemIndex = this.allList.findIndex(r =>
r.itemCode == result.itemCode && r.itemCode == result.itemCode &&
// r.productDate == result.productDate &&
r.order == result.order); r.order == result.order);
// //
if (itemIndex == -1) { if (itemIndex == -1) {
list.push(result); // if (this.allList.length > this.dataContent.packQty) {
that.calcFgQty(); // this.showErrorMessage("")
// return;
// }
result.countTime = new Date();
this.allList.push(result);
this.allList.sort(compare('countTime')); //
this.initList()
this.scanPopupGetFocus();
this.calcFgQty();
} else { } else {
this.showErrorMessage("标签【" + result.content + '】已经扫描,是否移除', confirm => { this.$refs.comMessage.showQuestionMessage("唯一码【" + result.content +
list.splice(itemIndex, 1) '】已经扫描,是否移除',
res => {
if (res) {
this.allList.splice(itemIndex, 1)
this.allList.sort(compare('countTime')); //
this.initList()
that.calcFgQty(); that.calcFgQty();
}
}) })
} }
setTimeout(r => {
this.scanPopupGetFocus();
}, 500)
} }
} }
}).catch(error=>{ }).catch(error => {
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
calcFgQty() { calcFgQty() {
this.dataContent.handleQty =this.dataContent.subList.length; this.dataContent.handleQty = this.allList.length;
if (this.dataContent.handleQty == this.dataContent.qty) { if (this.dataContent.handleQty == this.dataContent.packQty) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup();
}
this.commit() this.commit()
} }
}, },
@ -208,20 +419,103 @@
} }
}, },
scanPopupLoseFocus() { scanPopupLoseFocus() {
if (this.$refs.scanPopup ) { if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus(); this.$refs.scanPopup.losefocus();
} }
}, },
showCommitSuccessMessage(hint) {
showCommitSuccessMessage(hint, pointData) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.dataContent=null; if (pointData.length > 0) {
this.openFg(); uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
}
}) })
}, },
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
}
});
}
} }
} }
</script> </script>
<style> <style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.header {
position: fixed;
/* #ifdef H5 */
top: 88rpx;
/* #endif */
left: 0;
width: 100%;
background-color: #fff;
z-index: 10;
padding: 10rpx;
/* 确保头部在内容之上 */
}
.page-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
.item {
background-color: #fff;
}
.item_scaned {
background-color: antiquewhite;
}
.auto-wrap {
white-space: normal;
word-break: break-all;
overflow-wrap: break-word;
/* 对于兼容性更好的情况 */
}
</style> </style>

6
src/pages/issue/coms/comScanIssuePack.vue

@ -116,6 +116,9 @@
getWorkShopLineStation, getWorkShopLineStation,
getBalanceByFilter getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
uniqueArray
} from '@/common/basic.js';
import { import {
calc calc
@ -242,7 +245,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
}) })
}) })
}); });
//
list = uniqueArray(list);
this.fromLocationCode = list[0]; this.fromLocationCode = list[0];
return list; return list;
}, },

2
src/pages/repleinsh/coms/comRepleinshJobCard.vue

@ -1,6 +1,6 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<job-com-main-card :dataContent="dataContent"></job-com-main-card> <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
</job-com-main-card> </job-com-main-card>
</template> </template>

32
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -110,6 +110,10 @@
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import {
uniqueArray
} from '@/common/basic.js';
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -153,7 +157,7 @@
defaultValueList: [], defaultValueList: [],
label: {}, label: {},
fromInventoryStatuses: "", fromInventoryStatuses: "",
packageInfo:{} packageInfo: {}
} }
}, },
created() { created() {
@ -208,7 +212,10 @@
list.push(f.fromLocationCode) list.push(f.fromLocationCode)
}) })
}) })
//
list = uniqueArray(list);
this.fromLocationCode = list[0]; this.fromLocationCode = list[0];
return list; return list;
} else { } else {
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => { this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => {
@ -253,7 +260,7 @@
}) })
this.getBalance(result.label, packageInfo, balances => { this.getBalance(result.label, packageInfo, balances => {
this.packageInfo =packageInfo; this.packageInfo = packageInfo;
// //
let s = ''; let s = '';
if (!result.package.parentNumber) { if (!result.package.parentNumber) {
@ -282,7 +289,7 @@
// //
let subParentPackitems = balances.list.filter(r => r.packingNumber == let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo packageInfo
.parentNumber&&r.locationCode==this.fromLocationCode) .parentNumber && r.locationCode == this.fromLocationCode)
// //
@ -290,11 +297,11 @@
// //
if (subParentPackitems.length > 0) { if (subParentPackitems.length > 0) {
if(subParentPackitems.length==1){ if (subParentPackitems.length == 1) {
let balance = subParentPackitems[0]; let balance = subParentPackitems[0];
balance.qty=packageInfo.qty; balance.qty = packageInfo.qty;
this.afterGetBalance(result.label, balance, packageInfo); this.afterGetBalance(result.label, balance, packageInfo);
}else { } else {
this.showBalanceSelect(subParentPackitems); this.showBalanceSelect(subParentPackitems);
} }
@ -304,11 +311,12 @@
} }
} else { } else {
var locationCode = this.fromLocationCode var locationCode = this.fromLocationCode
if(balances.list==1){ if (balances.list == 1) {
locationCode=balances.list[0].locationCode locationCode = balances.list[0].locationCode
}else { } else {
var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode) var manyBlances = balances.list.filter(r => r.locationCode != this
if(manyBlances.length>0){ .fromLocationCode)
if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode; locationCode = manyBlances[0].locationCode;
} }
@ -411,7 +419,7 @@
}, },
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance,this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}, },
afterGetBalance(label, balance, packageInfo) { afterGetBalance(label, balance, packageInfo) {

10
src/pages/repleinsh/job/repleinshJob.vue

@ -169,8 +169,8 @@
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
sort: 'fromLocationCode', sort: 'number',
by: 'asc' by: 'desc'
} }
getRepleinshJobList(params).then(res => { getRepleinshJobList(params).then(res => {
@ -287,13 +287,13 @@
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
sort: 'fromLocationCode', sort: 'number',
by: 'asc' by: 'desc'
} }
getRepleinshJobList(params).then(res => { getRepleinshJobList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务'); that.showMessage('未查找到' + '【' + code + '】的补料任务');
} else if (res.data.list.length == 1) { } else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]); that.openJobDetail(res.data.list[0]);
} }

4
src/pages/stockUp/coms/comScanStockUpPack.vue

@ -345,6 +345,10 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
'】的发货明细,是否要继续发货?', res => { '】的发货明细,是否要继续发货?', res => {
if (res) { if (res) {
let batch = that.createBatchInfo(label, balance,packageInfo); let batch = that.createBatchInfo(label, balance,packageInfo);
//details
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch); fromLocation.Batchs.unshift(batch);
} }
}) })

11
src/pages/stockUp/job/stockUpJobDetail.vue

@ -80,6 +80,7 @@
getCurrDateTime, getCurrDateTime,
getDirectoryItemArray, getDirectoryItemArray,
getPackingNumberAndBatch, getPackingNumberAndBatch,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -274,6 +275,11 @@
submitJob() { submitJob() {
var params = this.setParams() var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的备货任务")
return
}
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
stockUpJobsubmit(params).then(res => { stockUpJobsubmit(params).then(res => {
@ -298,6 +304,7 @@
item.Locations.forEach(fromLocation => { item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => { fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail; let subItem = batch.detail;
if (subItem != undefined) {
subItem.recordList = []; subItem.recordList = [];
if (batch.Records.length > 0) { if (batch.Records.length > 0) {
batch.Records.forEach(r => { batch.Records.forEach(r => {
@ -328,8 +335,10 @@
} }
subItem.recordList.push(record); subItem.recordList.push(record);
}) })
subList.push(subItem); subList.push(deepCopyData(subItem));
} }
}
}) })
}) })
}) })

Loading…
Cancel
Save