Browse Source

page/fg 文件迁移 8/8-10/25

hella_vue3
王志国 4 weeks ago
parent
commit
b3d5a0aae1
  1. 59
      src/pages/fg/coms/comNoReceiptPopup.vue
  2. 55
      src/pages/fg/coms/comReceiptPopup.vue
  3. 159
      src/pages/fg/receiptByPlan.vue
  4. 93
      src/pages/fg/receiptNoPlan.vue

59
src/pages/fg/coms/comNoReceiptPopup.vue

@ -99,6 +99,28 @@
</view>
</view>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx;justify-content: space-between;">
<view class="title" >
创建上架申请
</view>
<view class="" style="margin-right: 20rpx;">
<u-switch v-model="putAwayRequestSwitch" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchPutAwayRequest"></u-switch>
</view>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; justify-content: space-between;" v-if="EnableQms">
<view class="title" >
创建检验申请
</view>
<view class="" style="margin-right: 20rpx;">
<u-switch v-model="putAwayInspectSwitch" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchPutAwayInspect"></u-switch>
</view>
</view>
</view>
<view class="uni-flex uni-row hide_border">
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button>
@ -127,7 +149,8 @@ import {
getCurrDate,
getBatch8,
dateFormatData,
lastThreeDays
lastThreeDays,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
@ -176,6 +199,9 @@ export default {
rawLocationCode: "",
workshop: "",
bomVersion: "",
putAwayRequestSwitch:true,
putAwayInspectSwitch:true,
EnableQms:true
}
},
props: {
@ -188,8 +214,10 @@ export default {
default: []
},
},
mounted() {
this.EnableQms = getSwitchInfoByCode('EnableQms')
},
methods: {
openRequestPopup() {
this.initData();
this.planDate = getCurrDate()
@ -210,8 +238,8 @@ export default {
this.productLineCode = ""
this.batch = ""
this.packUnitName = "请选择包装规格"
this.packUnit = "",
this.packQtyHint = ""
this.packUnit = ""
this.packQtyHint = ""
this.showPackUnitSelect = false
// this.packUnitList = []
this.itemCodeList = []
@ -223,7 +251,9 @@ export default {
this.fgLocationCode = ""
this.rawLocationCode = ""
this.workshop = ""
this.bomVersion = ""
this.putAwayRequestSwitch = true
this.putAwayInspectSwitch = true
},
closeRequestPopup() {
@ -263,7 +293,9 @@ export default {
this.showErrorMessage("请选择包装规格")
return
}
if (!this.EnableQms) {
this.putAwayInspectSwitch = false
}
this.callback();
},
@ -285,7 +317,10 @@ export default {
workStationCode: this.workStationCode,
fgLocationCode: this.fgLocationCode,
rawLocationCode: this.rawLocationCode,
workshop: this.workshop
workshop: this.workshop,
bomVersion: this.bomVersion,
putAwayRequestSwitch: this.putAwayRequestSwitch,
putAwayInspectSwitch: this.putAwayInspectSwitch
};
this.closeRequestPopup();
this.$emit("confirm", item);
@ -474,6 +509,16 @@ export default {
return item.label
}
},
switchPutAwayRequest(value){
console.log(value)
console.log("打印"+this.putAwayRequestSwitch)
this.putAwayRequestSwitch = value;
},
switchPutAwayInspect(value){
console.log(value)
this.putAwayInspectSwitch = value;
}
}
}
</script>

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

@ -78,6 +78,27 @@
<image src="" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectLine"> </image>
</view>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx;justify-content: space-between;">
<view class="title" >
创建上架申请
</view>
<view class="" style="margin-right: 20rpx;">
<u-switch v-model="putAwayRequestSwitch" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchPutAwayRequest"></u-switch>
</view>
</view>
<view class='split_line'></view>
<view class="uni-flex uni-row" style="align-items: center; margin-top: 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; justify-content: space-between;" v-if="EnableQms">
<view class="title" >
创建检验申请
</view>
<view class="" style="margin-right: 20rpx;">
<u-switch v-model="putAwayInspectSwitch" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchPutAwayInspect"></u-switch>
</view>
</view>
</view>
</view>
</view>
@ -95,7 +116,7 @@
import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode, getProductionlineAndWorkStation } from '@/api/request2.js'
import { getPackUnitName, getUomInfo } from '@/common/directory.js'
import { getCurrDate, getBatch8, dateFormatData, lastThreeDays } from '@/common/basic.js'
import { getCurrDate, getBatch8, dateFormatData, lastThreeDay, getSwitchInfoByCode } from '@/common/basic.js'
import { calc } from '@/common/calc.js'
@ -138,7 +159,10 @@ export default {
showDateSelect: false,
planDateList: [],
fgLocationCode: '',
rawLocationCode: ''
rawLocationCode: '',
putAwayRequestSwitch:true,
putAwayInspectSwitch:true,
EnableQms:true
}
},
props: {
@ -151,6 +175,10 @@ export default {
default: []
}
},
mounted() {
this.EnableQms = getSwitchInfoByCode('EnableQms')
console.log(777,this.EnableQms)
},
methods: {
openRequestPopup() {
this.initData()
@ -185,6 +213,8 @@ export default {
this.planDateList = []
this.fgLocationCode = ''
this.rawLocationCode = ''
this.putAwayRequestSwitch=true
this.putAwayInspectSwitch=true
},
closeRequestPopup() {
@ -220,7 +250,9 @@ export default {
this.showErrorMessage('请选择包装规格')
return
}
if (!this.EnableQms) {
this.putAwayInspectSwitch = false
}
this.callback()
},
@ -240,7 +272,9 @@ export default {
planNumber: this.planNumber,
workStationCode: this.workStationCode,
fgLocationCode: this.fgLocationCode,
rawLocationCode: this.rawLocationCode
rawLocationCode: this.rawLocationCode,
putAwayRequestSwitch:this.putAwayRequestSwitch,
putAwayInspectSwitch:this.putAwayInspectSwitch
}
this.closeRequestPopup()
this.$emit('confirm', item)
@ -336,6 +370,8 @@ export default {
// this.packUnitList = []
this.itemCodeList = []
this.showSelectItemCode()
this.putAwayRequestSwitch=true
this.putAwayInspectSwitch=true
},
showItemList() {
@ -466,7 +502,18 @@ export default {
return uom
}
return item.label
},
switchPutAwayRequest(value){
console.log(value)
console.log("打印"+this.putAwayRequestSwitch)
this.putAwayRequestSwitch =value;
},
switchPutAwayInspect(value){
console.log(value)
this.putAwayInspectSwitch =value;
}
}
}
</script>

159
src/pages/fg/receiptByPlan.vue

@ -102,12 +102,13 @@ import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { isCheckMesCode, planReceiptSubmit,
createPutawayRequestByPlan, createInspectRequestByPlan,
getPlanByNumber,getBalanceToPackage,
getPlanByNumber,getBalanceToPackage,createByPlanSubmit,
batchPrintingLable } from '@/api/request2.js'
import { calc } from '@/common/calc.js'
import storage from '@/common/utils/storage.js'
import { getRemoveOption, deepCopyData,
getCurrDateTime, compare,getSwitchInfoByCode} from '@/common/basic.js'
import {Exception} from 'sass';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comReceiptPopup from '@/pages/fg/coms/comReceiptPopup.vue'
@ -129,7 +130,8 @@ const pageSize = ref(500)
const comReceiptPopupRef = ref()
const scanPopup = ref()
const comMessageRef = ref()
const settingPutAwayRequestSwitch = ref(true)
const settingPutAwayInspectSwitch = ref(true)
onLoad(() => {
options.value = getRemoveOption()
openFg()
@ -174,8 +176,12 @@ const requestConfirm = (result) => {
packUnit: result.packUnit,
workStationCode: result.workStationCode,
fgLocationCode: result.fgLocationCode,
putAwayRequestSwitch: result.putAwayRequestSwitch,
putAwayInspectSwitch: result.putAwayInspectSwitch,
subList: []
}
settingPutAwayRequestSwitch.value = result.putAwayRequestSwitch
settingPutAwayInspectSwitch.value = result.putAwayInspectSwitch
}
const initList = () => {
index.value = 1
@ -221,7 +227,9 @@ const submit = () => {
}
const commit = async () => {
let list = []
try {
let startTime = new Date()
uni.showLoading({
title: '提交中...',
mask: true
@ -230,9 +238,9 @@ const commit = async () => {
console.log(JSON.stringify(params))
const list = []
const planData = await planReceiptSubmit(params)
if (planData.data) {
planData.data.forEach((item) => {
const planData = await createByPlanSubmit(params)
if (planData.data.tb1 && planData.data.tb1.length > 0) {
planData.data.tb1.forEach((item) => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
@ -252,71 +260,65 @@ const commit = async () => {
})
})
} else {
throw new Error('提交失败')
throw new Error('提交失败未获取到打印信息')
}
//
let createProductputawaySwitch = getSwitchInfoByCode(
"CreateProductputawayRequestAfterProductreceiptRecordCreated")
if (createProductputawaySwitch) {
createPutawayRequestByPlan(list[0].requestNumber).then(res => {
createInspectRequestByPlan(list[0].requestNumber)
})
} else { //
createInspectRequestByPlan(list[0].requestNumber)
}
const queryParams = {
filters: [
{
column: 'plan_type',
action: '==',
value: 'assemble'
},
{
column: 'number',
action: '==',
value: dataContent.value.planNumber
}
],
pageNo: 1,
pageSize: 100
}
let isAllSubmit = Number(Number(dataContent.value.goodQty)+ Number(showList.value.length))==Number(dataContent.value.planQty)
const planeInfo = await getPlanByNumber(queryParams)
if (planeInfo.data && planeInfo.data.list.length > 0) {
if (planeInfo.data.list[0].goodQty >= planeInfo.data.list[0].planQty) {
clear()
if (planData.data.tb2 && planData.data.tb2.list.length > 0) {
let planInfo = planData.data.tb2.list[0]
if (planInfo.goodQty >= planInfo.planQty) {
uni.showToast({
title:"计划已完成",
duration:2000
})
clearData()
} else {
dataContent.value.planNumber = planeInfo.data.list[0].number
dataContent.value.handleQty = 0
dataContent.value.planQty = planeInfo.data.list[0].planQty
dataContent.value.goodQty = planeInfo.data.list[0].goodQty
;(dataContent.value.noGoodQty = calc.sub(planeInfo.data.list[0].planQty, planeInfo.data.list[0].goodQty)), (dataContent.value.subList = [])
//
dataContent.value.planQty = planInfo.data.list[0].planQty
dataContent.value.goodQty = planInfo.data.list[0].goodQty
dataContent.value.noGoodQty = calc.sub(planInfo.planQty, planInfo.goodQty)
dataContent.value.handleQty = 0;
dataContent.value.subList = []
showList.value = []
allList.value = []
index.value = 1
}
} else {
throw new Error('未查找到单据信息')
throw new Error('提交失败未获取到计划信息')
}
uni.hideLoading()
let hintMsg = "提交成功\n生成装配收货记录\n";
// showCommitSuccessMessage('<br><br>', list)
if(isAllSubmit){
clearData()
}else {
showList.value = [];
allList.value = [];
index.value = 1;
dataContent.value.handleQty = 0;
if (list.length > 0 && list[0].requestNumber) {
hintMsg += list[0].requestNumber
}
nextTick(()=>{
showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + list[0].requestNumber, list)
nextTick(() => {
showCommitSuccessMessage(hintMsg, list)
})
} catch (error) {
uni.hideLoading()
const hint = error.message ? error.message : error
showErrorMessage(hint)
if (hint.indexOf('请返回开工阶段') > -1) {
showMessage('计划已完成')
clearData()
} else {
showErrorMessage(hint)
}
}
startSetting(list)
}
const startSetting = async (list)=> {
//
if (settingPutAwayRequestSwitch.value) {
if (list.length > 0 && list[0].requestNumber) {
await createPutawayRequestByPlan(list[0].requestNumber)
}
}
//
if (settingPutAwayInspectSwitch.value) {
if (list.length > 0 && list[0].requestNumber) {
await createInspectRequestByPlan(list[0].requestNumber)
}
}
}
const setParams = () => {
@ -407,15 +409,21 @@ const scanPopupLoseFocus = () => {
const getH5BatchPrintingLable = (number)=> {
batchPrintingLable(number).then(resLable => {
console.log('batchPrintingLable', resLable)
const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712`
const webData = {
token: storage.getStorage(storage.constant.token),
asn_number: resLable.data
uni.hideLoading()
if(resLable.data){
const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712`
const webData = {
token: storage.getStorage(storage.constant.token),
asn_number: resLable.data
}
uni.navigateTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
}else {
showErrorMessage(number + "批量打印标签 H5失败")
}
uni.navigateTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
}).catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
}
@ -432,17 +440,31 @@ const print = (pointData)=> {
pointData.forEach(item=>{
packingNumber.push(item.packageCode)
})
if(packingNumber.length==0){
if(packingNumber.length == 0){
showErrorMessage('包装号不能为空!')
return
}
uni.showLoading({
title: "正在获取打印信息",
mask: true
})
getBalanceToPackage({
packingNumber: packingNumber.join(',')
}).then(res => {
console.log('PC打印', res)
getH5BatchPrintingLable(res.data.number)
if (res.data && res.data.number) {
getH5BatchPrintingLable(res.data.number)
} else {
uni.hideLoading()
let hint = ""
packingNumber.forEach(item => {
hint += item
})
hint += "根据库存余额获取包装信息"
showErrorMessage(hint)
}
}).catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
// #endif
@ -459,11 +481,16 @@ const showErrorMessage = (message) => {
}
})
}
const showMessage = (message)=> {
comMessageRef.value.showMessage(message, res => {
if (res) {
openFg();
}
});
}
</script>
<style scoped lang="scss">
.item {
background-color: #fff;
}

93
src/pages/fg/receiptNoPlan.vue

@ -102,11 +102,10 @@ import {
createInspectRequestByPlan,
getPlanByNumber,
getBalanceToPackage,
batchPrintingLable
batchPrintingLable,
createByPlanSubmit
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {calc} from '@/common/calc.js';
import storage from '@/common/utils/storage.js'
import {
getRemoveOption,
@ -124,9 +123,6 @@ import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import light from '@/mycomponents/balance/light.vue'
import {
Exception
} from 'sass';
export default {
components: {
@ -149,7 +145,9 @@ export default {
index: 1,
loadingType: "",
pageSize: 20,
scanedQty: 0
scanedQty: 0,
settingPutAwayRequestSwitch:true,
settingPutAwayInspectSwitch :true
};
},
@ -210,8 +208,12 @@ export default {
bomVersion: result.bomVersion,
workshop: result.workshop,
team: "",
shift: ""
shift: "",
putAwayRequestSwitch:result.putAwayRequestSwitch,
putAwayInspectSwitch:result.putAwayInspectSwitch
}
this.settingPutAwayRequestSwitch = result.putAwayRequestSwitch
this.settingPutAwayInspectSwitch = result.putAwayInspectSwitch
},
initList() {
@ -262,6 +264,7 @@ export default {
},
async commit() {
let list = []
try {
uni.showLoading({
title: "提交中...",
@ -269,12 +272,10 @@ export default {
})
let params = this.setParams()
console.log(JSON.stringify(params))
let list = []
var planData = await planReceiptSubmit(params)
if (planData.data) {
planData.data.forEach(item => {
var planData = await createByPlanSubmit(params)
if (planData.data.tb1&&planData.data.tb1.length>0) {
planData.data.tb1.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
@ -296,18 +297,12 @@ export default {
} else {
throw new Error("提交失败")
}
let createProductputawaySwitch = getSwitchInfoByCode(
"CreateProductputawayRequestAfterProductreceiptRecordCreated")
//
if (createProductputawaySwitch) {
createPutawayRequestByPlan(list[0].requestNumber).then(res => {
createInspectRequestByPlan(list[0].requestNumber)
})
} else { //
createInspectRequestByPlan(list[0].requestNumber)
var hintMsg ="提交成功\n生成装配收货记录\n";
if(list.length>0&&list[0].requestNumber){
hintMsg += list[0].requestNumber
}
this.showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + list[0].requestNumber, list)
this.showCommitSuccessMessage(hintMsg, list)
this.scanedQty = this.scanedQty + this.showList.length;
this.showList = [];
this.dataContent.handleQty = 0;
@ -318,6 +313,24 @@ export default {
var hint = error.message ? error.message : error
this.showErrorMessage(hint)
}
this.startSetting(list)
},
async startSetting(list){
//
if (this.settingPutAwayRequestSwitch) {
if (list.length > 0 && list[0].requestNumber) {
await createPutawayRequestByPlan(list[0].requestNumber)
}
}
//
if (this.settingPutAwayInspectSwitch) {
if (list.length > 0 && list[0].requestNumber) {
await createInspectRequestByPlan(list[0].requestNumber)
}
}
console.log("提交所有完成"+getCurrDateTime())
},
setParams() {
@ -395,11 +408,20 @@ export default {
calcFgQty() {
this.dataContent.handleQty = this.showList.length;
if (this.dataContent.handleQty == this.dataContent.packQty) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup();
if(parseFloat(this.dataContent.planQty) -parseFloat(this.scanedQty) <= parseFloat(this.dataContent.packQty)){
if(parseFloat(this.dataContent.handleQty) == parseFloat(this.dataContent.planQty) -parseFloat(this.scanedQty)){
if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup();
}
this.commit()
}
}else{
if (parseFloat(this.dataContent.handleQty) == parseFloat(this.dataContent.packQty)) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup();
}
this.commit()
}
this.commit()
}
},
@ -416,15 +438,20 @@ export default {
getH5BatchPrintingLable( number) {
let _this = this
batchPrintingLable(number).then(resLable => {
console.log('batchPrintingLable', resLable)
const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712`
const webData = {
token: storage.getStorage(storage.constant.token),
asn_number: resLable.data
}
uni.navigateTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
if ( this.scanedQty + this.showList.length == this.dataContent.planQty) {
uni.redirectTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
}else{
uni.navigateTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
}
})
},

Loading…
Cancel
Save