Browse Source

修改标题显示2024/7/18 10:33:31

hella_vue3
zhang_li 3 months ago
parent
commit
ec66fc3df6
  1. 17
      src/api/request2.js
  2. 13
      src/common/basic.js
  3. 17
      src/common/style/new_style.css
  4. 32
      src/pages.json
  5. 434
      src/pages/fg/coms/comReceiptPopup.vue
  6. 174
      src/pages/fg/receiptByPlan.vue
  7. 132
      src/pages/productReceipt/job/ccProductReceiptDetail.vue
  8. 10
      src/pages/productReceipt/job/ccProductReceiptJob.vue
  9. 2
      src/pages/purchaseReturn/coms/comReturnRequestCard.vue
  10. 4
      src/pages/purchaseReturn/record/returnRecord.vue
  11. 2
      src/pages/purchaseReturn/request/returnRequestCreate.vue

17
src/api/request2.js

@ -2631,3 +2631,20 @@ export function getBalanceByParams(data) {
export function getBusinessType() { export function getBusinessType() {
return http.get("/wms/businesstype/page?pageSize=1000&pageNo=1") return http.get("/wms/businesstype/page?pageSize=1000&pageNo=1")
} }
/**
* 获取生产计划信息通过生产线和日期
* @param {*}
*/
export function getPlaneInfoByproductLine(productionLine,planDate) {
return http.get("/wms/production-main/getPlanProductionByProductionLineAndPlanDate?productionLine="+productionLine+"&planDate="+planDate)
}
/**
*
* @param {*}
*/
export function planReceiptSubmit(data) {
return http.post("/wms/production-main/getPlanProductionByProductionLineAndPlanDate",data)
}

13
src/common/basic.js

@ -37,6 +37,7 @@ export function clearCacheData() {
scrapReasonList = []; scrapReasonList = [];
inspectFailedReasonList = []; inspectFailedReasonList = [];
switchList=[] switchList=[]
businessList = []
} }
@ -857,6 +858,18 @@ 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();

17
src/common/style/new_style.css

@ -2448,7 +2448,24 @@ button[disabled] {
padding-right: 20rpx; padding-right: 20rpx;
z-index: 10; z-index: 10;
} }
.btn_single_clear{
background-color: #fff;
font-size: 30rpx;
color: #000;
text-align: center;
width: 180rpx;
}
.btn_single_clear{
background-color: #fff;
font-size: 30rpx;
color: #000;
text-align: center;
width: 180rpx;
}
.btn_clear_after {
opacity: 0.7;
}
.btn_single_commit { .btn_single_commit {
background-color: #3C9CFF; background-color: #3C9CFF;
font-size: 30rpx; font-size: 30rpx;

32
src/pages.json

@ -1009,7 +1009,39 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/productReceipt/job/ccProductReceiptJob",
"style": {
"navigationBarTitleText": "装配报工收货任务",
"enablePullDownRefresh": true,
"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/productReceipt/job/ccProductReceiptDetail",
"style": {
"navigationBarTitleText": "装配完工收货详情",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/productReceipt/job/scrapReceiptJob", "path": "pages/productReceipt/job/scrapReceiptJob",
"style": { "style": {

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

@ -12,39 +12,62 @@
<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="title" style="display: flex; align-items: center; padding: 10rpx">
<view class="" style="width: 25%"> <text style="flex-shrink: 0; width: 25%">生产线</text>
<text>生产线</text> <view class="customerBorder" @click="showSelectLine">
{{ productionLineName }}
</view> </view>
<u-select v-model="showProductLineSelect" mode="single-column" :list="productLineList" @confirm="confirmSelectLine"></u-select>
<view class=""> <view class="">
<uni-combox :candidates="productLineList" v-model="productLineCode" placeholder="请扫描来源库位" @confirm="handleConfirm" style="height: 30rpx; border: 1px solid #fff"></uni-combox> <image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectLine"> </image>
</view> </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="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="itemCodeClick"> </image> <image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectItemCode"> </image>
</view> </view>
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
<view class="uni-flex uni-row padding title u-col-center">
<text>数量 </text>
<view class="uni-flex uni-row uni-center" style="display: flex; align-items: center; margin-left: 20rpx; justify-content: center">
<input style="text-align: center" class="qty_input" v-model="counQty" type="number" @confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom> <view class="title" style="display: flex; align-items: center; padding: 10rpx">
<view class="" v-if="stdPackInfo != undefined" style="display: flex; flex-direction: row; margin-left: 10rpx"> (<packQty :dataContent="stdPackInfo"></packQty>) </view> <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> </view>
<view class="split_line"></view> <view class="split_line"></view>
<view class="title" style="display: flex; align-items: center; padding: 10rpx">
<text style="flex-shrink: 0; width: 25%">包装规格</text>
<view class="customerBorder">
{{ packUnit }}
</view>
<u-select v-model="showPackUnitSelect" mode="mutil-column-auto" :list="packUnitList" @confirm="confirmSelectPackUnit"></u-select>
<view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectPackUnit"> </image>
</view>
</view>
<view class="split_line"></view>
</view> </view>
</view> </view>
</view> </view>
@ -54,14 +77,16 @@
</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 { getBasicItemByCode, getProductionlineItem, getWorkShopLineStation, getWarehouseCodeList } from '@/api/request2.js' import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode } from '@/api/request2.js'
import { getLocationTypeName, getListLocationTypeDesc, checkDirectoryItemExist } from '@/common/directory.js' import { getPackUnitName, getUomInfo } 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'
@ -76,42 +101,56 @@ export default {
}, },
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, //
maxlength: 10,
stdPackInfo: undefined,
wareHouseList: [],
showWareHouse: false,
productLineList: [], productLineList: [],
productLineCode: '' productionLineName: '请选择生产线',
productionLineCode: '',
batch: '',
packUnit: '请选择包装规格',
showPackUnitSelect: false,
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,
@ -119,244 +158,202 @@ export default {
} }
}, },
methods: { methods: {
checkNum(e) { openRequestPopup() {
const { value } = e.detail this.initData()
const dot = value.indexOf('.') // this.batch = getBatch8()
const reg = /^[0-9]+$/ //
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') 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('请输入物料', 'itemCode') this.showErrorMessage('请选择物料信息')
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() {
const item = { const 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) {
this.show = true
}
},
showWarseHouseSelect() { confirmSelectLine(data) {
if (this.editPosition) { this.productionLineName = data[0].label
this.wareHouseClick() this.productionLineCode = data[0].value
}
}, },
confirmSelect(e) { showSelectLine() {
this.positionInfo = `${e[0].label}-${e[1].label}-${e[2].label}` if (this.productLineList.length == 0) {
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 getIssueJobByProductionline()
this.productionLineName = e[1].label .then((res) => {
this.workStationName = e[2].label uni.hideLoading()
if (res.data && res.data.length > 0) {
const shop = this.positionList.find((shop) => shop.value == this.workshopCode) res.data.forEach((item) => {
if (shop != undefined && shop.children != undefined) { item.label = item.name
const prodLine = shop.children.find((line) => line.value == this.productionLineCode) })
if (prodLine != undefined && prodLine.children != undefined) { this.productLineList = res.data
const station = prodLine.children.find((r) => r.value == this.workStationCode) this.showProductLineSelect = true
if (station.rawLocationCode == '' && station.rawLocationCode == null) { } else {
this.showErrorMessage(`${this.workStationName}的原材料库位为空,请重新选择`) this.showErrorMessage('未查找到生产线信息')
}
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else { } else {
this.rawLocationCode = station.rawLocationCode this.showProductLineSelect = true
this.fgLocationCode = station.fgLocationCode }
},
showSelectItemCode() {
if (!this.productionLineCode) {
this.showErrorMessage('请先选择生产线')
return
} }
if (this.itemCodeList.length == 0) {
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
})
this.itemCodeList = res.data
this.showItemCodeSelect = true
} else { } else {
this.showErrorMessage('生产线-工位基础信息维护错误') this.showErrorMessage('未查找到物料信息')
} }
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else { } else {
this.showErrorMessage('车间-生产线基础信息维护错误') this.showItemCodeSelect = true
} }
}, },
confirmSelectItem(data) {
getItemScanResult(code, scanResult) { this.itemCode = data[0].label
this.itemCode = code const item = this.itemCodeList.find((res) => res.itemCode == this.itemCode)
this.itemName = scanResult.name this.uom = item.uom
this.uom = scanResult.uom this.planQty = item.planQty
this.stdPackInfo = scanResult.package this.number = item.number
this.numberFocus = true
}, },
wareHouseClick() {
showSelectPackUnit() {
if (this.packUnitList.length == 0) {
if (this.itemCode == '请选择物料信息') {
this.showErrorMessage('请先选择物料')
return
}
uni.showLoading({ uni.showLoading({
title: '查询中....', title: '加载中',
mask: true mask: true
}) })
getWarehouseCodeList(1, 100) getPackUnitByItemCode(this.itemCode)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data != null && res.data.list.length > 0) { if (res.data && res.data.list.length > 0) {
res.data.list.forEach((item) => { res.data.list.forEach((item) => {
item.value = item.code item.value = item.packUnit
item.label = item.name item.label = `${getPackUnitName(item.packUnit)}(${item.packQty}${this.getUomInfo(item.uom)})`
}) })
this.wareHouseList = res.data.list // this.packUnitList = res.data.list
this.showWareHouse = true this.showPackUnitSelect = true
} else { } else {
this.showErrorMessage('未查找到仓库代码') this.showErrorMessage('未查找到包装信息')
} }
}) })
.catch((error) => { .catch((error) => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
} else {
this.showPackUnitSelect = true
}
}, },
confirmWareHouse(e) { confirmSelectPackUnit(data) {
this.fromWarehouseCode = e[0].value const pack = this.packUnitList.filter((r) => r.packUnit == data[0].value)[0]
// this.packUnit = pack.packQty;
this.packUnit = data[0].label
},
getUomInfo(uom) {
const item = getUomInfo(uom)
if (item == '') {
return uom
}
return item.label
} }
} }
} }
@ -366,4 +363,11 @@ export default {
.title { .title {
font-size: 30rpx; font-size: 30rpx;
} }
.customerBorder {
width: 100%;
border: 1rpx solid lightgray;
border-radius: 5rpx;
padding: 15rpx;
}
</style> </style>

174
src/pages/fg/receiptByPlan.vue

@ -1,21 +1,187 @@
<template> <template>
<view class="page-wraper" style="background-color: #fff">
<view class=""> <view class="">
<com-blank-view @goScan="openFg" v-if="!dataContent"></com-blank-view>
</view>
<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="">
<com-blank-view @goScan="openFg" v-if="detailSource.length == 0"></com-blank-view> <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> </view>
<comReceiptPopup ref="comReceiptPopupRef" @confirm="requestConfirm"></comReceiptPopup> <comReceiptPopup ref="comReceiptPopupRef" @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>
<com-message ref="comMessageRef" />
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, nextTick, watch, getCurrentInstance } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onShow, onLoad, onNavigationBarButtonTap } from '@dcloudio/uni-app'
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'
const dataContent = ref(null)
const options = ref([])
const scanPopup = ref()
const detailSource = ref([])
const comReceiptPopupRef = ref() const comReceiptPopupRef = ref()
onLoad(() => {
options.value = getRemoveOption()
openFg()
})
const openFg = () => { const openFg = () => {
comReceiptPopupRef.value.openRequestPopup('') setTimeout((res) => {
if (comReceiptPopupRef.value) {
comReceiptPopupRef.value.openRequestPopup()
}
}, 600)
}
const requestConfirm = (result) => {
dataContent.value = {
itemCode: result.itemCode,
number: result.number, //
handleQty: 0,
qty: result.planQty,
batch: result.batch,
packUnit: '3031',
uom: result.uom,
subList: [
{
code: '1234'
},
{
code: '12345'
}
]
}
}
const swipeClick = (e, dataContent, index) => {
if (e.content.text == '移除') {
dataContent.value.subList.splice(index, 1)
}
}
const commit = () => {
planReceiptSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(res.data)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
})
}
const openScanPopup = () => {
const { itemCode } = dataContent.value
// itemCode = "015553147"
console.log('物料', itemCode)
scanPopup.value.openScanPopup(itemCode)
}
const getScanResult = (result) => {
// TODO
// mes
isCheckMesCode(result.content)
.then((res) => {
if (res.data) {
if (dataContent.value) {
const list = dataContent.value.subList //
const itemIndex = list.findIndex(
(r) =>
r.itemCode == result.itemCode &&
// r.productDate == result.productDate &&
r.order == result.order
)
//
if (itemIndex == -1) {
list.push(result)
calcFgQty()
} else {
showErrorMessage(`标签【${result.content}】已经扫描,是否移除`, (confirm) => {
list.splice(itemIndex, 1)
calcFgQty()
})
}
setTimeout((r) => {
scanPopupGetFocus()
}, 500)
}
}
})
.catch((error) => {
showErrorMessage(error)
})
}
const calcFgQty = () => {
dataContent.value.handleQty = dataContent.value.subList.length
if (dataContent.value.handleQty == dataContent.value.qty) {
commit()
}
}
const scanPopupGetFocus = () => {
if (scanPopup.value) {
scanPopup.value.getfocus()
}
}
const scanPopupLoseFocus = () => {
if (scanPopup.value) {
scanPopup.value.losefocus()
}
}
const showCommitSuccessMessage = (hint) => {
comMessageRef.value.showSuccessMessage(hint, (res) => {
dataContent.value = null
openFg()
})
} }
</script> </script>

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

@ -83,6 +83,10 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue' import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
const id= ref('') const id= ref('')
const receiptJob= ref({}) const receiptJob= ref({})
const toLocationCode= ref('') const toLocationCode= ref('')
@ -102,10 +106,12 @@ const scanPopup= ref()
const comMessageRef= ref() const comMessageRef= ref()
onLoad((option)=> { onLoad((option)=> {
setTimeout(res=>{
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `${option.title}详情` title: `${option.title}详情`
}) })
},50)
id.value = option.id id.value = option.id
scanedPackingNumber.value = option.scaned || '' scanedPackingNumber.value = option.scaned || ''
status.value = option.status || '' status.value = option.status || ''
@ -282,7 +288,7 @@ const comMessageRef= ref()
} }
const showMessageHint(hint, callback) { const showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, (res) => { comMessageRef.value.showErrorMessage(hint, (res) => {
if (res) { if (res) {
callback() callback()
} }
@ -290,39 +296,39 @@ const comMessageRef= ref()
} }
const commit=() =>{ const commit=() =>{
scanCount.value = getScanCount(subList.value) scanCount.value = getScanCount(subList.value)
if (this.scanCount == 0) { if (scanCount.value == 0) {
this.showErrorMessage('扫描数为0,请先扫描') showErrorMessage('扫描数为0,请先扫描')
return return
} }
// //
if (!this.checkLocation()) { if (!checkLocation()) {
return return
} }
// //
if (this.scanCount == this.subList.length) { if (scanCount.value == subList.value.length) {
if (this.checkCount()) { if (checkCount()) {
this.submitJob() submitJob()
} }
} else if (this.scanCount < this.subList.length) { } else if (scanCount.value < subList.value.length) {
// //
if (this.jobContent.allowPartialComplete == 'TRUE') { if (jobContent.value.allowPartialComplete == 'TRUE') {
// //
if (this.checkCount()) { if (checkCount()) {
this.submitJob() submitJob()
} }
} else { } else {
// //
this.showMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${this.scanCount}]总共[${this.subList.length}]`) showMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${subList.value.length}]`)
}
} }
} }
},
checkCount() { const checkCount=()=> {
let isCheck = true let isCheck = true
let hint = '' let hint = ''
for (let i = 0; i < this.detailSource.length; i++) { for (let i = 0; i < detailSource.value.length; i++) {
const item = this.detailSource[i] const item =detailSource.value[i]
for (let j = 0; j < item.subList.length; j++) { for (let j = 0; j < item.subList.length; j++) {
const subItem = item.subList[i] const subItem = item.subList[i]
if (calc.sub(subItem.handleQty, subItem.qty) < 0) { if (calc.sub(subItem.handleQty, subItem.qty) < 0) {
@ -333,120 +339,118 @@ const comMessageRef= ref()
} }
} }
if (!isCheck) { if (!isCheck) {
this.showQuestMessage(hint, (res) => { showQuestMessage(hint, (res) => {
if (res) { if (res) {
this.submitJob() submitJob()
} }
}) })
} }
return isCheck return isCheck
}, }
submitJob() { const submitJob=() =>{
uni.showLoading({ uni.showLoading({
title: '提交中....', title: '提交中....',
mask: true mask: true
}) })
const itemCodes = [] const itemCodes = []
this.detailSource.forEach((item) => { detailSource.value.forEach((item) => {
itemCodes.push(item.itemCode) itemCodes.push(item.itemCode)
}) })
getManagementPrecisions(itemCodes, this.toLocationCode, (res) => { getManagementPrecisions(itemCodes,toLocationCode.value, (res) => {
if (res.success) { if (res.success) {
this.managementList = res.list managementList.value = res.list
const params = this.setParams() const params = setParams()
console.log('提交参数', JSON.stringify(params))
ccProductReceiptJobsubmit(params) ccProductReceiptJobsubmit(params)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage(`提交成功<br>生成预生产收货记录<br>${res.data}`) showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + res.data )
} else { } else {
this.showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
} }
}) })
.catch((error) => { .catch((error) => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) showErrorMessage(error)
}) })
} else { } else {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(res.message) showErrorMessage(res.message)
} }
}) })
}, }
setParams() { const setParams=() =>{
const subList = [] const subList = []
const creator = this.$store.state.user.id const creator = store.id
this.detailSource.forEach((item) => { detailSource.value.forEach((item) => {
item.subList.forEach((detail) => { item.subList.forEach((detail) => {
if (detail.scaned) { if (detail.scaned) {
const info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.packingNumber, detail.batch) const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch)
detail.toPackingNumber = info.packingNumber detail.toPackingNumber = info.packingNumber
detail.toBatch = info.batch detail.toBatch = info.batch
detail.toContainerNumber = '' detail.toContainerNumber = ''
detail.toInventoryStatus = detail.inventoryStatus detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode detail.toLocationCode =toLocationCode.value
subList.push(detail) subList.push(detail)
} }
}) })
}) })
this.jobContent.subList = subList jobContent.value.subList = subList
this.jobContent.creator = creator jobContent.value.creator = creator
return this.jobContent return jobContent.value
}, }
scanPopupGetFocus() { const scanPopupGetFocus=() =>{
if (this.$refs.scanPopup != undefined) { if (scanPopup.value != undefined) {
this.$refs.scanPopup.getfocus() scanPopup.value.getfocus()
}
} }
},
scanPopupLoseFocus() { const scanPopupLoseFocus=()=> {
if (this.$refs.scanPopup != undefined) { if (scanPopup.value != undefined) {
this.$refs.scanPopup.losefocus() scanPopup.value.losefocus()
}
} }
},
showMessage(message) { const showMessage=(message)=> {
setTimeout((r) => { setTimeout((r) => {
this.scanPopupLoseFocus() scanPopupLoseFocus()
this.$refs.comMessage.showMessage(message, (res) => { comMessageRef.value.showMessage(message, (res) => {
if (res) { if (res) {
this.scanPopupGetFocus() scanPopupGetFocus()
} }
}) })
}) })
}, }
showErrorMessage(message) { const showErrorMessage=(message)=> {
setTimeout((r) => { setTimeout((r) => {
this.scanPopupLoseFocus() scanPopupLoseFocus()
this.$refs.comMessage.showErrorMessage(message, (res) => { comMessageRef.value.showErrorMessage(message, (res) => {
if (res) { if (res) {
this.scanPopupGetFocus() scanPopupGetFocus()
} }
}) })
}) })
}, }
showCommitSuccessMessage(hint) { const showCommitSuccessMessage=(hint) =>{
this.$refs.comMessage.showSuccessMessage(hint, (res) => { comMessageRef.value.showSuccessMessage(hint, (res) => {
navigateBack(1) navigateBack(1)
}) })
}, }
showQuestMessage(hint, callBack) { const showQuestMessage=(hint, callBack) =>{
this.$refs.comMessage.showQuestionMessage(hint, (res) => { comMessageRef.value.showQuestionMessage(hint, (res) => {
if (res) { if (res) {
callBack(true) callBack(true)
} }
}) })
} }
}
}
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

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

@ -67,13 +67,17 @@
const detailOptions = ref([]) const detailOptions = ref([])
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const type = ref('assemble') const type = ref('assemble')
const title = ref("")
const filter = ref() const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobListPopupRef = ref() const jobListPopupRef = ref()
const jobInfoPopupRef = ref() const jobInfoPopupRef = ref()
const scanPopup = ref() const scanPopup = ref()
onLoad((option) => {
title.value = option.title
})
onMounted(() => { onShow(() => {
detailOptions.value = getDetailOption() detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption() detailGiveupOptions.value = getDetailGiveupOption()
getList('refresh') getList('refresh')
@ -106,9 +110,7 @@
} }
getList('more') getList('more')
}) })
const refresh = () => {
getList('refresh')
}
const getList = (type) => { const getList = (type) => {
uni.showLoading({ uni.showLoading({
title: '加载中­....', title: '加载中­....',

2
src/pages/purchaseReturn/coms/comReturnRequestCard.vue

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

4
src/pages/purchaseReturn/record/returnRecord.vue

@ -64,6 +64,7 @@ const supplierCode = ref('') // 供应商代码
const poNumber = ref('') const poNumber = ref('')
const fromType = ref('') const fromType = ref('')
const dataContent = ref({}) const dataContent = ref({})
const currentPackage = ref({})
const comMessageRef = ref() const comMessageRef = ref()
const scanPopup = ref() const scanPopup = ref()
const scanLocationCode = ref() const scanLocationCode = ref()
@ -131,6 +132,7 @@ const getDataSource = (result) => {
const { balance } = result const { balance } = result
const { label } = result const { label } = result
const pack = result.package const pack = result.package
currentPackage.value = pack
const item = detailSource.value.find((res) => { const item = detailSource.value.find((res) => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
@ -232,6 +234,8 @@ const setRecordParams = (queryModel) => {
submitItem.qty = detail.handleQty submitItem.qty = detail.handleQty
submitItem.package = '' submitItem.package = ''
submitItem.poNumber = currentPackage.value.poNumber
submitItem.poLine = currentPackage.value.poLine
subList.push(submitItem) subList.push(submitItem)
} }
}) })

2
src/pages/purchaseReturn/request/returnRequestCreate.vue

@ -186,6 +186,8 @@ const setRequestParams = () => {
} }
submitItem.fromLocationCode = detail.locationCode submitItem.fromLocationCode = detail.locationCode
submitItem.qty = detail.handleQty submitItem.qty = detail.handleQty
submitItem.poNumber = detail.package.poNumber
submitItem.poLine = detail.package.poLine
subList.push(submitItem) subList.push(submitItem)
} }
}) })

Loading…
Cancel
Save