Browse Source

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

# Conflicts:
#	src/common/style/new_style.css
hella_online_20240829
niexiting 4 months ago
parent
commit
1ba0c24325
  1. 29
      src/api/request2.js
  2. 33
      src/common/basic.js
  3. 518
      src/pages/fg/coms/comReceiptPopup.vue
  4. 207
      src/pages/fg/receiptByPlan.vue
  5. 10
      src/pages/productReceipt/job/ccProductReceiptDetail.vue
  6. 39
      src/pages/productReceipt/job/ccProductReceiptJob.vue
  7. 1
      src/static/icons/down.svg

29
src/api/request2.js

@ -4236,3 +4236,32 @@ export function getBusinessType() {
data:{} data:{}
}); });
} }
/**
* 获取生产计划信息通过生产线和日期
* @param {*}
*/
export function getPlaneInfoByproductLine(productionLine,planDate) {
return request({
url: baseApi + "/wms/production-main/getPlanProductionByProductionLineAndPlanDate?productionLine="+productionLine+"&planDate="+planDate,
method: "get",
data:{}
});
}
/**
*
* @param {*}
*/
export function planReceiptSubmit(params) {
return request({
url: baseApi + "/wms/production-main/getPlanProductionByProductionLineAndPlanDate",
method: "post",
data:params
});
}

33
src/common/basic.js

@ -3,7 +3,9 @@ export {
maxPageSize maxPageSize
} }
import { calc } from '@/common/calc' import {
calc
} from '@/common/calc'
let jobStatusList = []; let jobStatusList = [];
let itemStatusList = []; let itemStatusList = [];
@ -17,8 +19,8 @@ let unplannedReceiptReasonList = [];
let unplannedIissueReason = []; let unplannedIissueReason = [];
let scrapReasonList = []; let scrapReasonList = [];
let inspectFailedReasonList = []; let inspectFailedReasonList = [];
let switchList=[] let switchList = []
let businessList=[] let businessList = []
//获取字典信息 //获取字典信息
@ -35,8 +37,8 @@ export function clearCacheData() {
unplannedIissueReason = []; unplannedIissueReason = [];
scrapReasonList = []; scrapReasonList = [];
inspectFailedReasonList = []; inspectFailedReasonList = [];
switchList=[] switchList = []
businessList=[] businessList = []
} }
@ -352,7 +354,7 @@ export function getSwitchInfoByCode(code) {
break; break;
} }
} }
isCheck =resultInfo.effectiveSetValue=="TRUE"?true:false isCheck = resultInfo.effectiveSetValue == "TRUE" ? true : false
return isCheck; return isCheck;
} }
@ -854,7 +856,7 @@ export function getCurrDateTimes() {
var time = (new Date()).getTime(); var time = (new Date()).getTime();
return time; return time;
} }
//2024717
export function getBatch() { export function getBatch() {
var date = new Date(); var date = new Date();
var year = date.getFullYear(); //年 var year = date.getFullYear(); //年
@ -863,6 +865,19 @@ export function getBatch() {
var batch = year.toString() + month.toString() + day.toString() var batch = year.toString() + month.toString() + day.toString()
return batch; return batch;
} }
//20270717
export function getBatch8() {
var date = new Date();
//获取日期部分
var year = date.getFullYear(); //年
var month = date.getMonth() + 1; //月
var day = date.getDate(); //日
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
return year + month + day;
}
export function getCurrDate() { export function getCurrDate() {
var date = new Date(); var date = new Date();
@ -995,7 +1010,7 @@ export function getDataSource(subList) {
item.subList.push(newDetail); item.subList.push(newDetail);
items.push(item) items.push(item)
} else { } else {
item.qty = calc.add(item.qty,detail.qty) item.qty = calc.add(item.qty, detail.qty)
let newDetail = createDetailInfo(detail); // let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail); item.subList.push(newDetail);
} }
@ -1048,7 +1063,7 @@ export function navigateBack(backIndex) {
* 深度克隆对象 * 深度克隆对象
* @param {*} target * @param {*} target
*/ */
export function deepCopyData(target) { export function deepCopyData(target) {
// 克隆原始类型和null // 克隆原始类型和null
if (!(target !== null && (typeof target === 'object' || typeof target === 'function'))) { if (!(target !== null && (typeof target === 'object' || typeof target === 'function'))) {
return target; return target;

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

@ -12,50 +12,80 @@
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
<view class="uni-flex uni-column" style="background-color: white; "> <view class="uni-flex uni-column" style="background-color: white; ">
<view class="uni-flex uni-column "> <view class="uni-flex uni-column">
<view class="uni-flex uni-row padding title u-col-center" style="width: 100%;">
<view class="" style="width:25% ">
<text>生产线</text>
</view>
<view class="" > <view class="title " style="display: flex; align-items: center;padding: 10rpx;">
<uni-combox :candidates="productLineList" v-model="productLineCode" placeholder="请扫描来源库位" <text style=" flex-shrink: 0;width: 25%;">生产线</text>
@confirm="handleConfirm" style='height: 30rpx;border:1px solid #fff ;'></uni-combox> <view class="customerBorder" @click="showSelectLine">
{{productionLineName}}
</view> </view>
<u-select v-model="showProductLineSelect" mode="single-column" :list="productLineList"
@confirm="confirmSelectLine"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showSelectLine">
</image>
</view>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
<view class="title padding" style="display: flex;"> <view class="title " style="display: flex;align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0;">物料</text> <text style=" flex-shrink: 0; width: 25%;">物料代码</text>
<view class="" style="width: 100% ;"> <view class="customerBorder">
{{itemCode}} {{itemCode}}
</view> </view>
<u-select v-model="showItemCodeSelect" mode="single-column" :list="itemCodeList"
@confirm="confirmSelectItem"></u-select>
<view class=""> <view class="">
<image src="/static/search.svg" mode="" <image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="itemCodeClick"> style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="showSelectItemCode">
</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="title " style="display: flex;align-items: center;padding: 10rpx;">
<text style=" flex-shrink: 0; width: 25%;">计划数量</text>
<view class="customerBorder">
{{planQty}}
</view>
<view class="">
<image src="" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
>
</image>
</view>
</view>
<view class='split_line'></view> <view class='split_line'></view>
<view class="uni-flex uni-row padding title u-col-center"> <view class="title " style="display: flex;align-items: center;padding: 10rpx;">
<text>数量 </text> <text style=" flex-shrink: 0; width: 25%;">包装规格</text>
<view class="uni-flex uni-row uni-center" <view class="customerBorder">
style="display: flex; align-items: center;margin-left: 20rpx;justify-content: center;"> {{packUnit}}
</view>
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number" <u-select v-model="showPackUnitSelect" mode="mutil-column-auto" :list="packUnitList"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" @confirm="confirmSelectPackUnit"></u-select>
:maxlength="maxlength" /> <view class="">
<image src="/static/icons/down.svg" mode=""
<uom :uom="uom"></uom> style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
<view class="" v-if="stdPackInfo!=undefined" @click="showSelectPackUnit">
style="display: flex;flex-direction: row;margin-left: 10rpx;"> </image>
(<packQty :dataContent="stdPackInfo"></packQty>)
</view>
</view> </view>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
</view> </view>
</view> </view>
@ -66,25 +96,26 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getItemScanResult'
:itemCodeTypeList="itemCodeTypeList">
</win-scan-item>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import { import {
getBasicItemByCode, getIssueJobByProductionline,
getProductionlineItem, getPlaneInfoByproductLine,
getWorkShopLineStation, getPackUnitByItemCode
getWarehouseCodeList
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
getLocationTypeName, getPackUnitName,
getListLocationTypeDesc, getUomInfo
checkDirectoryItemExist
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
getCurrDate,
getBatch8
} from '@/common/basic.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'
@ -99,42 +130,58 @@
}, },
data() { data() {
return { return {
workshopCode: "", // itemCode: '请选择物料信息',
workShopName: "",
productionLineCode: "", //线
productionLineName: "",
workStationCode: "", //
workStationName: "",
itemCode: '请扫描物料信息',
fromWarehouseCode: "请选择仓库代码",
itemName: "",
qty: 0,
rawLocationCode: "",
fgLocationCode: "",
itemCodeFocus: false,
requestInfo: null,
itemCodeList: [],
counQty: undefined,
editPosition: true,
numberFocus: false,
uom: "", uom: "",
positionInfo: "请选择位置", planQty: 0,
show: false, number: "",
isModifiedPosition: true, productLineCode: "",
positionList: [], showProductLineSelect: false,
stdQty: 0, // productLineList: [],
maxlength: 10, productionLineName: "请选择生产线",
stdPackInfo: undefined, productionLineCode: "",
wareHouseList: [], batch: "",
showWareHouse: false, packUnit: "请选择包装规格",
productLineList:[], showPackUnitSelect: false,
productLineCode:"" itemCodeList: [],
showItemCodeSelect: false,
packUnitList: [{
value: 1,
label: '中国',
children: [{
value: 2,
label: '广东',
},
{
value: 5,
label: '广西',
}
]
},
{
value: 8,
label: '美国',
children: [{
value: 9,
label: '纽约',
},
{
value: 10,
label: '华盛顿',
}
]
}
]
} }
}, },
props: { props: {
title: { title: {
type: String, type: String,
default: '完工信息' default: '开工阶段'
}, },
itemCodeTypeList: { itemCodeTypeList: {
type: Array, type: Array,
@ -142,247 +189,211 @@
}, },
}, },
methods: { methods: {
checkNum(e) { openRequestPopup() {
let value = e.detail.value; this.initData();
let dot = value.indexOf('.'); // this.batch = getBatch8()
let reg = /^[0-9]+$/; // this.$refs.popup.open('bottom')
if (dot > -1) {
this.maxlength = dot + 7; //
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //
this.maxlength = 10;
}
this.change(value)
},
openRequestPopup(editPosition) {
if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => {
if (res.data != null && res.data.length > 0) {
this.positionList = res.data
} else {
this.showErrorMessage('未查找到位置信息');
}
}).catch(error => {
this.showErrorMessage(error);
})
}
this.editPosition = editPosition;
if (this.isModifiedPosition) {
this.isModifiedPosition = false
} else {
this.itemCode = "请扫描物料信息";
this.show = false
this.showWareHouse = false
this.uom = ""
this.qty = 0;
this.stdPackInfo = undefined;
this.counQty = undefined;
this.numberFocus = false
this.itemCodeGetFocus();
}
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)
}, },
initData() { initData() {
this.positionList = []; this.itemCode = '请选择物料信息';
this.wareHouseList= [],
this.showWareHouse = false
this.editPosition =true;
this.itemCode = "请扫描物料信息";
this.rawLocationCode = ""
this.positionInfo = "请选择位置"
this.fromWarehouseCode = "请选择仓库代码"
this.workshopCode = "" //
this.workShopName = ""
this.productionLineCode = "" //线
this.productionLineName = ""
this.workStationCode = "" //
this.workStationName = ""
this.show = false
this.uom = "" this.uom = ""
this.qty = 0; this.planQty = 0
this.stdPackInfo = undefined; this.number = ""
this.counQty = undefined; this.productLineCode = ""
this.numberFocus = false this.showProductLineSelect = false
this.productLineList = []
this.productionLineName = "请选择生产线"
this.productionLineCode = ""
this.batch = ""
this.packUnit = "请选择包装规格"
this.showPackUnitSelect = false
// this.packUnitList = []
this.itemCodeList = []
this.showItemCodeSelect = false
}, },
closeRequestPopup() { closeRequestPopup() {
this.$refs.popup.close() this.$refs.popup.close()
}, },
locationConfirm() {
//
this.checkLocatioCode();
},
itemCodeClick() {
this.$refs.scanPopup.openScanPopup();
},
itemCodeGetFocus() {
this.itemCodeFocus = true;
},
itemCodeLoseFocus() { itemCodeLoseFocus() {
this.itemCodeFocus = false; this.itemCodeFocus = false;
}, },
confirm() { confirm() {
if (this.positionInfo == "请选择位置") { if (this.productionLineName == "请选择生产线") {
this.showErrorMessage("请选择位置") this.showErrorMessage("请选择生产线")
return return
} }
if (this.fromWarehouseCode == "请选择仓库代码") { if (!this.batch) {
this.showErrorMessage("请选择仓库代码") this.showErrorMessage("请输入批次例如:20200101")
return return
} }
if (this.itemCode == "请选择物料信息") {
if (this.itemCode == "请扫描物料信息") { this.showErrorMessage("请选择物料信息")
this.showErrorMessage("请输入物料", "itemCode")
return
}
if (this.counQty == undefined) {
this.showErrorMessage("请输入数量")
return return
} }
if (this.qty == 0) { if (this.itemCode == "请选择包装规格") {
this.showErrorMessage("数量必须大于0") this.showErrorMessage("请选择包装规格")
return return
} }
if (this.rawLocationCode == '') { this.callback();
this.showErrorMessage(this.workStationName + "的原材料库位为空")
return
}
this.callback('add');
}, },
callback(action) { callback() {
let item = { let item = {
positionInfo: this.positionInfo,
workshopCode: this.workshopCode, //
workShopName: this.workShopName,
productionLineCode: this.productionLineCode, //线
productionLineName: this.productionLineName, productionLineName: this.productionLineName,
workStationCode: this.workStationCode, // productionLineCode: this.productionLineCode, //线
workStationName: this.workStationName,
rawLocationCode: this.rawLocationCode,
fgLocationCode: this.fgLocationCode,
fromWarehouseCode: this.fromWarehouseCode,
toWarehouseCode: this.fromWarehouseCode,
itemCode: this.itemCode, itemCode: this.itemCode,
itemName: this.itemName,
uom: this.uom, uom: this.uom,
qty: this.qty batch: this.batch,
packUnit: "packUnit",
planQty: this.planQty,
number: this.number
}; };
this.closeRequestPopup(); this.closeRequestPopup();
this.$emit("confirm", action, item); this.$emit("confirm", item);
}, },
showErrorMessage(message, type) { showErrorMessage(message, type) {
setTimeout(r => { setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {})
if (type == "itemCode") {
this.itemCodeGetFocus();
} else {
this.numberFocus = true;
}
})
if (type == "itemCode") {
this.itemCode = "请扫描物料信息"
}
}) })
}, },
change(value) {
this.qty = value;
},
cancel(e) { cancel(e) {
this.closeRequestPopup(); this.closeRequestPopup();
}, },
showSelect() {
if (this.editPosition) { confirmSelectLine(data) {
this.show = true this.productionLineName = data[0].label
} this.productionLineCode = data[0].value
}, },
showWarseHouseSelect() { showSelectLine() {
if (this.editPosition) { if (this.productLineList.length == 0) {
this.wareHouseClick(); uni.showLoading({
title: "加载中",
mask: true
})
getIssueJobByProductionline().then(res => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item.name
})
this.productLineList = res.data
this.showProductLineSelect = true
} else {
this.showErrorMessage('未查找到生产线信息');
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
} else {
this.showProductLineSelect = true
} }
}, },
showSelectItemCode() {
if (!this.productionLineCode) {
this.showErrorMessage('请先选择生产线');
return;
}
confirmSelect(e) { if (this.itemCodeList.length == 0) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label console.log("当天", getCurrDate())
console.log("位置", this.positionInfo) uni.showLoading({
this.workshopCode = e[0].value title: "加载中",
this.productionLineCode = e[1].value mask: true
this.workStationCode = e[2].value })
this.workShopName = e[0].label getPlaneInfoByproductLine(this.productionLineCode, getCurrDate()).then(res => {
this.productionLineName = e[1].label uni.hideLoading()
this.workStationName = e[2].label if (res.data && res.data.length > 0) {
res.data.forEach(item => {
let shop = this.positionList.find(shop => shop.value == this.workshopCode); item.label = item.itemCode
if (shop != undefined && shop.children != undefined) { })
let prodLine = shop.children.find(line => line.value == this.productionLineCode); this.itemCodeList = res.data
if (prodLine != undefined && prodLine.children != undefined) { this.showItemCodeSelect = true
let station = prodLine.children.find(r => r.value == this.workStationCode);
if (station.rawLocationCode == '' && station.rawLocationCode == null) {
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择")
return;
} else { } else {
this.rawLocationCode = station.rawLocationCode; this.showErrorMessage('未查找到物料信息');
this.fgLocationCode = station.fgLocationCode;
} }
} else {
this.showErrorMessage("生产线-工位基础信息维护错误") }).catch(error => {
} uni.hideLoading()
this.showErrorMessage(error);
})
} else { } else {
this.showErrorMessage("车间-生产线基础信息维护错误") this.showItemCodeSelect = true
} }
},
getItemScanResult(code, scanResult) {
this.itemCode = code;
this.itemName = scanResult.name
this.uom = scanResult.uom
this.stdPackInfo = scanResult.package;
this.numberFocus = true
}, },
wareHouseClick() { confirmSelectItem(data) {
uni.showLoading({ this.itemCode = data[0].label
title: "查询中....", var item = this.itemCodeList.find(res => res.itemCode == this.itemCode)
mask: true this.uom = item.uom
}); this.planQty = item.planQty
getWarehouseCodeList(1, 100).then(res => { this.number = item.number
uni.hideLoading() },
if (res.data != null && res.data.list.length > 0) {
res.data.list.forEach(item => { showSelectPackUnit() {
item.value = item.code; if (this.packUnitList.length == 0) {
item.label = item.name; if (this.itemCode == "请选择物料信息") {
}) this.showErrorMessage('请先选择物料');
this.wareHouseList = res.data.list return;
this.showWareHouse = true
} else {
this.showErrorMessage('未查找到仓库代码');
} }
}).catch(error => {
uni.hideLoading() uni.showLoading({
this.showErrorMessage(error); 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);
})
} else {
this.showPackUnitSelect = true
}
}, },
confirmSelectPackUnit(data) {
let pack = this.packUnitList.filter(r => r.packUnit == data[0].value)[0];
// this.packUnit = pack.packQty;
this.packUnit = data[0].label
confirmWareHouse(e) {
this.fromWarehouseCode = e[0].value;
}, },
getUomInfo(uom) {
let item = getUomInfo(uom);
if (item == '') {
return uom;
} else {
return item.label
}
},
@ -394,4 +405,11 @@
.title { .title {
font-size: 30rpx; font-size: 30rpx;
} }
.customerBorder {
width: 100%;
border: 1rpx solid lightgray;
border-radius: 5rpx;
padding: 15rpx;
}
</style> </style>

207
src/pages/fg/receiptByPlan.vue

@ -1,37 +1,224 @@
<template> <template>
<view class=""> <view class="page-wraper" style="background-color: #fff;">
<view class=""> <view class="">
<com-blank-view @goScan='openFg' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='openFg' v-if="!dataContent"></com-blank-view>
</view> </view>
<comReceiptPopup ref="comReceiptPopup" @confirm='requestConfirm' ></comReceiptPopup>
<view class="page-wraper" v-if="dataContent">
<view class="" style="font-size: 35rpx;padding: 10rpx; padding-left: 15rpx;">
生产计划{{dataContent.number}}
</view>
<view class='split_line'></view>
<view class="">
<item-qty :dataContent="dataContent" :isShowBalanceQty="false"></item-qty>
</view>
<view class='split_line'></view>
<view class="" style="margin-left: 20rpx;">
<batch :batch="dataContent.batch"></batch>
<view class="card_view ">
<text style="color: #FFA500;padding: 5px;font-size: 35rpx;">包装规格</text>
<text class="card_content ">{{dataContent.packUnit}}</text>
</view>
</view>
<view class='split_line'></view>
<view class="page-main">
<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)">
<view class="" style="margin-left: 40rpx; padding-top: 10rpx; padding-bottom: 10rpx;">
<text style="font-size: 35rpx;color: #B66463;">唯一码</text>
<text style="font-size: 35rpx;"> {{item.code}}</text>
</view>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<view class="uni-flex uni-row">
</view>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_clear" style="margin-right: 50rpx;" hover-class="btn_clear_after"
@click="clear">清空</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
</view>
<comReceiptPopup ref="comReceiptPopup" @confirm='requestConfirm'></comReceiptPopup>
<win-scan-button v-if="dataContent" @goScan='openScanPopup'></win-scan-button>
<win-scan-fg-label ref="scanPopup" @getResult='getScanResult' title='制品标签'></win-scan-fg-label>
<comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import {
isCheckMesCode,
planReceiptSubmit
} from '@/api/request2.js';
import {
getRemoveOption
} from '@/common/basic.js';
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 batch from '@/mycomponents/balance/batch.vue'
import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
export default { export default {
components: { components: {
comBlankView, comBlankView,
comReceiptPopup comReceiptPopup,
itemQty,
batch,
pack,
winScanButton,
winScanFgLabel
}, },
data() { data() {
return { return {
detailSource:[] dataContent: null,
options: []
}; };
}, },
onShow() { onShow() {},
onLoad() {
this.options = getRemoveOption()
this.openFg();
}, },
mounted() { mounted() {
}, },
methods: { methods: {
openFg(){ openFg() {
this.$refs.comReceiptPopup.openRequestPopup(""); setTimeout(res => {
} if (this.$refs.comReceiptPopup) {
} this.$refs.comReceiptPopup.openRequestPopup();
}
}, 600)
},
requestConfirm(result) {
this.dataContent = {
itemCode: result.itemCode,
number: result.number, //
handleQty: 0,
qty: result.planQty,
batch: result.batch,
packUnit: "3031",
uom: result.uom,
subList: [{
code: "1234"
},
{
code: "12345"
}
]
}
},
swipeClick(e, dataContent,index) {
if (e.content.text == "移除") {
this.dataContent.subList.splice(index,1);
}
},
commit() {
planReceiptSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage(res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
clear() {
},
openScanPopup() {
var itemCode = this.dataContent.itemCode
// itemCode = "015553147"
console.log("物料", itemCode)
this.$refs.scanPopup.openScanPopup(itemCode);
},
getScanResult(result) {
let that = this;
//TODO
//mes
isCheckMesCode(result.content).then(res=>{
if(res.data){
if (that.dataContent) {
let list = that.dataContent.subList; //
var itemIndex = list.findIndex(r =>
r.itemCode == result.itemCode &&
// r.productDate == result.productDate &&
r.order == result.order);
//
if (itemIndex == -1) {
list.push(result);
that.calcFgQty();
} else {
this.showErrorMessage("标签【" + result.content + '】已经扫描,是否移除', confirm => {
list.splice(itemIndex, 1)
that.calcFgQty();
})
}
setTimeout(r => {
this.scanPopupGetFocus();
}, 500)
}
}
}).catch(error=>{
this.showErrorMessage(error)
})
},
calcFgQty() {
this.dataContent.handleQty =this.dataContent.subList.length;
if (this.dataContent.handleQty == this.dataContent.qty) {
this.commit()
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup ) {
this.$refs.scanPopup.losefocus();
}
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.dataContent=null;
this.openFg();
})
},
}
} }
</script> </script>

10
src/pages/productReceipt/job/ccProductReceiptDetail.vue

@ -139,9 +139,11 @@
}; };
}, },
onLoad(option) { onLoad(option) {
uni.setNavigationBarTitle({ setTimeout(res=>{
title: option.title+'详情' uni.setNavigationBarTitle({
}) title: option.title+'详情'
})
},50)
this.id = option.id; this.id = option.id;
this.scanedPackingNumber = option.scaned || ''; this.scanedPackingNumber = option.scaned || '';
@ -419,7 +421,7 @@
ccProductReceiptJobsubmit(params).then(res => { ccProductReceiptJobsubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成预生产收货记录<br>" + res.data, ) this.showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + res.data )
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }

39
src/pages/productReceipt/job/ccProductReceiptJob.vue

@ -80,25 +80,28 @@
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
type: 'assemble', type: 'assemble',
title:""
}; };
}, },
// type = 'assemble' // type = 'assemble'
// type = 'predict' // type = 'predict'
props: { // props: {
title: { // title: {
type: String, // type: String,
default: '' // default: ''
}, // },
// },
onLoad(option){
this.title = option.title
}, },
mounted() { onShow(){
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption(); this.detailGiveupOptions = getDetailGiveupOption();
this.getList('refresh'); this.getList('refresh');
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh');
}, },
@ -123,18 +126,16 @@
} }
}, },
onReachBottom() {
console.log('onReachBottom', this.loadingType)
//
if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
return;
}
this.getList("more");
},
methods: { methods: {
onReachBottom() {
console.log('onReachBottom', this.loadingType)
//
if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
return;
}
this.getList("more");
},
refresh() {
this.getList('refresh');
},
getList(type) { getList(type) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({

1
src/static/icons/down.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1721183536347" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1545" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M76.4 290.3c-17.5 17.5-17.5 45.8 0 63.3l370.2 370.2c35 35 91.7 35 126.6 0l372.9-372.9c17.3-17.3 17.5-45.3 0.5-62.8-17.4-17.9-46.1-18.1-63.8-0.5L541.6 628.9c-17.5 17.5-45.8 17.5-63.3 0L139.8 290.3c-17.5-17.4-45.9-17.4-63.4 0z" p-id="1546" fill="#8a8a8a"></path></svg>

After

Width:  |  Height:  |  Size: 599 B

Loading…
Cancel
Save