Browse Source

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

hella_online_20240829
lijuncheng 2 months ago
parent
commit
e42e1a825d
  1. 2
      .env.development
  2. 79
      src/api/request2.js
  3. 20
      src/common/directory.js
  4. 25
      src/common/noclick.js
  5. 16
      src/common/style/new_style.css
  6. 7
      src/main.js
  7. 11
      src/mycomponents/balance/balance.vue
  8. 16
      src/mycomponents/balance/balanceSelect.vue
  9. 37
      src/mycomponents/balance/level.vue
  10. 13
      src/mycomponents/job/jobComMainDetailCard.vue
  11. 2
      src/mycomponents/record/recordComDetailCard.vue
  12. 30
      src/mycomponents/scan/winComScanBalance.vue
  13. 2
      src/pages.json
  14. 2
      src/pages/index/index.vue
  15. 42
      src/pages/issue/coms/comIssueRequestPopup.vue
  16. 956
      src/pages/issue/record/issueRecord.vue
  17. 432
      src/pages/issue/record/issueRecordV1.vue
  18. 4
      src/pages/issue/request/issueRequestCreate.vue
  19. 682
      src/pages/repleinsh/record/repleinshRecord.vue
  20. 558
      src/pages/repleinsh/record/repleinshRecordV1.vue

2
.env.development

@ -1,7 +1,7 @@
#VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api #VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
#VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api #VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
# 租户配置 VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' # 租户配置 VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 是否是测试环境 # 是否是测试环境

79
src/api/request2.js

@ -2,7 +2,7 @@ import request from './httpRequest3.js'
import storage from '../common/utils/storage.js' import storage from '../common/utils/storage.js'
//公司地址 //公司地址
// 本地地址 // 本地地址
const baseApi = '' const baseApi = ''
/** /**
* 获取验证码 * 获取验证码
* @param {*} * @param {*}
@ -17,7 +17,7 @@ export function getCaptchaImage(params) {
/** /**
* 登录方法 * 登录方法
*/ */
export function login(username, password, code, uuid,tenantName) { export function login(username, password, code, uuid, tenantName) {
return request({ return request({
url: baseApi + '/system/auth/login', url: baseApi + '/system/auth/login',
headers: { headers: {
@ -443,9 +443,9 @@ export function getPackageListByNumber(number) {
export function getMesPackInfo(code) { export function getMesPackInfo(code) {
var params = { var params = {
filters: [{ filters: [{
column:"lowerLim", column: "lowerLim",
action:"==", action: "==",
value:code value: code
}], }],
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
@ -1383,10 +1383,10 @@ export function getIssueJobDetail(id) {
* @param {*} 任务id * @param {*} 任务id
* /wms/issue-request-main * /wms/issue-request-main
*/ */
export function getBalanceByBatchOffShelf(itemCode, qty) { export function getBalanceByBatchOffShelf(itemCode, qty, businesstype) {
return request({ return request({
url: baseApi + "/wms/issue-request-main/getBalanceByBatchOffShelf?itemCode=" + itemCode + "&&qty=" + url: baseApi + "/wms/issue-request-main/getBalanceByBatchOffShelf?itemCode=" + itemCode + "&&qty=" +
qty, qty + "&&businesstype=" + businesstype,
method: "get", method: "get",
data: {}, data: {},
}); });
@ -4116,7 +4116,7 @@ export function getMainMessage() {
*/ */
export function appCheckUpdate() { export function appCheckUpdate() {
return request({ return request({
url: baseApi+"/wms/system-install-package/returnNewFile", url: baseApi + "/wms/system-install-package/returnNewFile",
method: "get", method: "get",
data: {} data: {}
}) })
@ -4209,10 +4209,10 @@ export function getPackageLabel(packageCode) {
name: name, name: name,
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
sort:"", sort: "",
filters:[{ filters: [{
action: "==", action: "==",
column:"relateNumber", column: "relateNumber",
value: packageCode value: packageCode
}] }]
} }
@ -4229,7 +4229,7 @@ export function getPackageLabel(packageCode) {
*/ */
export function isCheckMesCode(code) { export function isCheckMesCode(code) {
return request({ return request({
url: baseApi + "/wms/productreceipt-detailb/getCheckWhetherItExists?remark="+code, url: baseApi + "/wms/productreceipt-detailb/getCheckWhetherItExists?remark=" + code,
method: "get", method: "get",
data: {}, data: {},
}); });
@ -4239,11 +4239,11 @@ export function isCheckMesCode(code) {
* 获取上架任务打印明细 * 获取上架任务打印明细
* @param {*} * @param {*}
*/ */
export function getJimuPutawayJobDetail(data) { export function getJimuPutawayJobDetail(data) {
return request({ return request({
url: baseApi + "/wms/jimu-report/getPutawayJobDetailForPDA", url: baseApi + "/wms/jimu-report/getPutawayJobDetailForPDA",
method: "post", method: "post",
data:data data: data
}); });
} }
@ -4251,11 +4251,11 @@ export function getJimuPutawayJobDetail(data) {
* 查询库位后台自己查询管理模式 * 查询库位后台自己查询管理模式
* @param {*} * @param {*}
*/ */
export function getBalanceByParams(data) { export function getBalanceByParams(data) {
return request({ return request({
url: baseApi + "/wms/balance/getBalanceListByPackage", url: baseApi + "/wms/balance/getBalanceListByPackage",
method: "post", method: "post",
data:data data: data
}); });
} }
@ -4264,11 +4264,11 @@ export function getBalanceByParams(data) {
* @param {*} * @param {*}
*/ */
export function getBusinessType() { export function getBusinessType() {
return request({ return request({
url: baseApi + "/wms/businesstype/page?pageSize=1000&pageNo=1", url: baseApi + "/wms/businesstype/page?pageSize=1000&pageNo=1",
method: "get", method: "get",
data:{} data: {}
}); });
} }
@ -4277,11 +4277,12 @@ export function getBusinessType() {
* @param {*} * @param {*}
*/ */
export function getPlaneInfoByproductLine(productionLine,planDate) { export function getPlaneInfoByproductLine(productionLine, planDate) {
return request({ return request({
url: baseApi + "/wms/production-main/getPlanProductionByProductionLineAndPlanDate?productionLine="+productionLine+"&planDate="+planDate, url: baseApi + "/wms/production-main/getPlanProductionByProductionLineAndPlanDate?productionLine=" +
productionLine + "&planDate=" + planDate,
method: "get", method: "get",
data:{} data: {}
}); });
} }
@ -4290,33 +4291,33 @@ export function getPlaneInfoByproductLine(productionLine,planDate) {
* @param {*} * @param {*}
*/ */
export function planReceiptSubmit(params) { export function planReceiptSubmit(params) {
return request({ return request({
url: baseApi + "/wms/productreceipt-record-main/createByPlan", url: baseApi + "/wms/productreceipt-record-main/createByPlan",
method: "post", method: "post",
data:params data: params
}); });
} }
/** /**
* @param {Object} params 创建计划完工后调用上架申请 number * @param {Object} params 创建计划完工后调用上架申请 number
*/ */
export function createPutawayRequestByPlan(number) { export function createPutawayRequestByPlan(number) {
return request({ return request({
url: baseApi + "/wms/productreceipt-record-main/createPutawayRequest?number="+number, url: baseApi + "/wms/productreceipt-record-main/createPutawayRequest?number=" + number,
method: "post", method: "post",
data:{} data: {}
}); });
} }
/** /**
* @param {Object} params 创建检验申请 number * @param {Object} params 创建检验申请 number
*/ */
export function createInspectRequestByPlan(number) { export function createInspectRequestByPlan(number) {
return request({ return request({
url: baseApi + "/wms/productreceipt-record-main/createInspectRequest?number="+number, url: baseApi + "/wms/productreceipt-record-main/createInspectRequest?number=" + number,
method: "post", method: "post",
data:{} data: {}
}); });
} }
@ -4324,11 +4325,11 @@ export function createInspectRequestByPlan(number) {
/** /**
* @param {Object} params 查询计划报工单号 number * @param {Object} params 查询计划报工单号 number
*/ */
export function getPlanByNumber(params) { export function getPlanByNumber(params) {
return request({ return request({
url: baseApi + "/wms/production-detail/senior", url: baseApi + "/wms/production-detail/senior",
method: "post", method: "post",
data:params data: params
}); });
} }

20
src/common/directory.js

@ -22,6 +22,7 @@ let countStageList = [];
let locationAreaTypeList = []; let locationAreaTypeList = [];
let businessList = []; let businessList = [];
let countScopeTypeList = []; let countScopeTypeList = [];
let priorityList = []
@ -64,6 +65,7 @@ export function clearCacheData() {
locationAreaTypeList = [] locationAreaTypeList = []
businessList = [] businessList = []
countScopeTypeList = [] countScopeTypeList = []
priorityList = []
} }
//获取字典信息 //获取字典信息
@ -79,7 +81,6 @@ export function getDirectoryInfo(type) {
} }
} }
} }
return result return result
} }
@ -614,5 +615,20 @@ export function getPackUnitName(value) {
return resultInfo return resultInfo
} }
//获取优先级
export function getPriorityName(value) {
var resultInfo = "";
if (priorityList.length == 0) {
priorityList = getDirectoryInfo("priority")
}
if (priorityList.length > 0) {
for (let item of priorityList) {
if (item.value == value) {
resultInfo = item.label
break;
}
}
}
return resultInfo
}
locationAreaTypeList locationAreaTypeList

25
src/common/noclick.js

@ -0,0 +1,25 @@
// 防止处理多次点击
function noMultipleClicks(methods, info) {
// methods是需要点击后需要执行的函数, info是点击需要传的参数
let that = this;
if (that.noClick) {
// 第一次点击
that.noClick= false;
if(info && info !== '') {
// info是执行函数需要传的参数
methods(info);
} else {
methods();
}
setTimeout(()=> {
that.noClick= true;
}, 2000)
} else {
// 这里是重复点击的判断
}
}
//导出
export default {
noMultipleClicks,//禁止多次点击
}

16
src/common/style/new_style.css

@ -2085,6 +2085,12 @@ button::after {
vertical-align: middle vertical-align: middle
} }
.card_item_code {
color: #329362;
padding: 5px;
font-size: 30rpx;
}
.card_packing_code { .card_packing_code {
color: #3315EB; color: #3315EB;
padding: 5px; padding: 5px;
@ -2138,6 +2144,12 @@ button::after {
padding: 5px; padding: 5px;
} }
.card_level {
color: #0689da;
padding: 5px;
font-size: 30rpx;
}
.card_supportCode { .card_supportCode {
color: #DA8910; color: #DA8910;
padding: 5px; padding: 5px;
@ -2147,10 +2159,10 @@ button::after {
font-size: 32rpx; font-size: 32rpx;
} }
.card_item_code { /* .card_item_code {
color: #F1A532; color: #F1A532;
padding: 5px; padding: 5px;
} } */
.card_product_date { .card_product_date {
color: #329362; color: #329362;

7
src/main.js

@ -4,10 +4,12 @@ import './router/my_router.js'; //引入拦截
import VueClipboard from 'vue-clipboard2' //复制粘贴 import VueClipboard from 'vue-clipboard2' //复制粘贴
import uView from './uni_modules/vk-uview-ui';// 引入 uView UI import uView from './uni_modules/vk-uview-ui';// 引入 uView UI
import comMessage from './mycomponents/common/comMessage.vue' import comMessage from './mycomponents/common/comMessage.vue'
import noclick from './common/noclick.js'
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
console.log("Vuew2222"); console.log("Vuew2222");//配置公共方法 防治多次点击
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$store = store Vue.prototype.$store = store
Vue.prototype.$adpid = "1111111111" Vue.prototype.$adpid = "1111111111"
@ -33,8 +35,7 @@ export function createApp() {
app.use(VueClipboard) app.use(VueClipboard)
app.use(uView) app.use(uView)
app.component('comMessage', comMessage) app.component('comMessage', comMessage)
app.config.globalProperties.$noMultipleClicks = noclick.noMultipleClicks;
console.log("网络22请求")
// startApp(app); // startApp(app);
return { return {
app, app,

11
src/mycomponents/balance/balance.vue

@ -11,8 +11,6 @@
</view> </view>
<view class="uni-flex" style="flex-direction: column;"> <view class="uni-flex" style="flex-direction: column;">
<view class="uni-flex uni-row center"> <view class="uni-flex uni-row center">
<!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent" <!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent"
:isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty> --> :isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty> -->
<qty v-if="dataContent.handleQty==0 || dataContent.handleQty==undefined" :dataContent="dataContent" <qty v-if="dataContent.handleQty==0 || dataContent.handleQty==undefined" :dataContent="dataContent"
@ -22,20 +20,15 @@
:isShowStatus='isShowStatus'> :isShowStatus='isShowStatus'>
</compare-qty> </compare-qty>
<view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()"> <view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; width: 20px;" @click="copy">复制</text> <text style="font-size: 30rpx;color: #2979ff; width: 20px;" @click="copy">复制</text>
</view> </view>
</view> </view>
<view class="" v-if="dataContent.inventoryStatus"> <!-- <view class="" v-if="isShowStatus && dataContent.inventoryStatus">
<move-status :fromInventoryStatus="dataContent.inventoryStatus"> <move-status :fromInventoryStatus="dataContent.inventoryStatus">
</move-status> </move-status>
</view> </view> -->
</view> </view>
</view> </view>
<!-- <u-line></u-line> --> <!-- <u-line></u-line> -->
</view> </view>

16
src/mycomponents/balance/balanceSelect.vue

@ -6,7 +6,14 @@
<item style="margin: 10rpx;" :dataContent="balanceItems[0]"></item> <item style="margin: 10rpx;" :dataContent="balanceItems[0]"></item>
<view class="popinpop count_shadow" style="width: 90vw;margin: 20rpx 20rpx 30rpx 20rpx;" <view class="popinpop count_shadow" style="width: 90vw;margin: 20rpx 20rpx 30rpx 20rpx;"
v-for="(item, index) in balanceItems" :key="item.id" @click="callback(item)"> v-for="(item, index) in balanceItems" :key="item.id" @click="callback(item)">
<balance :dataContent="item" :isShowStatus ="false"></balance> <balance :dataContent="item" :isShowStatus="false"></balance>
</view>
<view class="page-footer">
<view class="uni-flex space-between" style=" width: 100%; ">
<!-- <view class=" uni-flex uni-row"> -->
<button class="btn_single_reject" hover-class="btn_commit_after" @click="close">关闭</button>
<!-- </view> -->
</view>
</view> </view>
</scroll-view> </scroll-view>
</uni-popup> </uni-popup>
@ -37,9 +44,9 @@
}, },
methods: { methods: {
openPopup(items) { openPopup(items) {
if(Array.isArray(items)){ if (Array.isArray(items)) {
this.balanceItems = items; this.balanceItems = items;
}else{ } else {
this.balanceItems = [items]; this.balanceItems = [items];
} }
@ -52,6 +59,9 @@
this.$refs['popupItems'].close(); this.$refs['popupItems'].close();
}, },
close() {
this.$refs['popupItems'].close();
}
} }
} }
</script> </script>

37
src/mycomponents/balance/level.vue

@ -0,0 +1,37 @@
<template>
<view class="card_view ">
<text class="card_level">{{title}}</text>
<text class="card_big_content" style="font-size: 40rpx;">{{getPriorityName1()}}</text>
</view>
</template>
<script>
import {getPriorityName} from '@/common/directory.js';
export default {
components: {
},
data() {
return {}
},
props: {
priority: {
type: String,
default:'2'
},
title: {
type: String,
default: '优先级'
},
},
methods:{
getPriorityName1(){
return getPriorityName(this.priority)
}
},
}
</script>
<style>
</style>

13
src/mycomponents/job/jobComMainDetailCard.vue

@ -9,8 +9,13 @@
<pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber"> <pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber">
</pack> </pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode"> <view class="u-flex u-row-between">
</location> <location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location>
<level title="优先级" :priority="dataContent.priority">
</level>
</view>
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode||dataContent.locationCode"> <to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode||dataContent.locationCode">
</to-location> </to-location>
<view class="card_view " v-if="isShowDeliverType"> <view class="card_view " v-if="isShowDeliverType">
@ -27,8 +32,8 @@
import location from '@/mycomponents/balance/location.vue' import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue' import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue' import batch from '@/mycomponents/balance/batch.vue'
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import level from '@/mycomponents/balance/level.vue'
export default { export default {
components: { components: {
@ -36,8 +41,8 @@
location, location,
toLocation, toLocation,
batch, batch,
jobComMainCard,
itemCompareQty, itemCompareQty,
level
}, },
data() { data() {
return {}; return {};

2
src/mycomponents/record/recordComDetailCard.vue

@ -72,7 +72,7 @@
isShowStatus: { isShowStatus: {
type: Boolean, type: Boolean,
default: false default: true
}, },
isShowFromLocation: { isShowFromLocation: {

30
src/mycomponents/scan/winComScanBalance.vue

@ -72,7 +72,7 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
bussinessCode:{ bussinessCode: {
type: String, type: String,
default: '' default: ''
} }
@ -114,13 +114,13 @@
}, },
getScanResult(result) { getScanResult(result) {
this.resultData = result; this.resultData = result;
if(!result.package){ if (!result.package) {
this.showErrorMessage(result.label.code+"包装信息为空") this.showErrorMessage(result.label.code + "包装信息为空")
return; return;
} }
this.getItemCodeType(result.package.itemCode,callBack=>{ this.getItemCodeType(result.package.itemCode, callBack => {
this.queryBalance(this.resultData) this.queryBalance(this.resultData)
}) })
}, },
@ -130,11 +130,15 @@
itemCode: result.package.itemCode, itemCode: result.package.itemCode,
batch: result.label.batch, batch: result.label.batch,
packingNumber: result.label.packingNumber, packingNumber: result.label.packingNumber,
parentPackingNumber:result.package.parentNumber, parentPackingNumber: result.package.parentNumber,
inventoryStatus: this.fromInventoryStatuses, inventoryStatus: this.fromInventoryStatuses,
areaType: this.fromLocationAreaTypeList, areaType: this.fromLocationAreaTypeList,
bussinessCode:this.bussinessCode bussinessCode: this.bussinessCode
} }
uni.showLoading({
title: '查询中',
mask: true
})
getBalanceByParams(params).then(res => { getBalanceByParams(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data.length == 0) { if (res.data.length == 0) {
@ -151,8 +155,8 @@
} else if (res.data.length == 1) { } else if (res.data.length == 1) {
result.balance = res.data[0] result.balance = res.data[0]
if(result.label.packingNumber!=result.balance.packingNumber){ if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.lableQty=result.label.qty result.balance.lableQty = result.label.qty
} }
this.$emit("getBalance", result) this.$emit("getBalance", result)
// this.closeScanPopup() // this.closeScanPopup()
@ -166,7 +170,7 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
getItemCodeType(itemCode,callBack) { getItemCodeType(itemCode, callBack) {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
@ -201,7 +205,7 @@
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.getfocus() this.$refs.comscan.getfocus()
} }
} }
@ -215,8 +219,8 @@
closeScanPopup() { closeScanPopup() {
this.$refs.popup.close() this.$refs.popup.close()
}, },
getfocus(){ getfocus() {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.getfocus() this.$refs.comscan.getfocus()
} }
} }

2
src/pages.json

@ -593,7 +593,7 @@
{ {
"path": "pages/issue/record/issueRecord", "path": "pages/issue/record/issueRecord",
"style": { "style": {
"navigationBarTitleText": "直接发料记录", "navigationBarTitleText": "先进先出发料",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"titleNView": { "titleNView": {
"autoBackButton": "true" "autoBackButton": "true"

2
src/pages/index/index.vue

@ -359,7 +359,7 @@
"inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason", "inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason",
"unplanned_issue_reason", "scrap_reason", "inspect_failed_reason", "unplanned_issue_reason", "scrap_reason", "inspect_failed_reason",
"request_status", "inspect_type", "next_action", "sample_method", "transfer_mode", "request_status", "inspect_type", "next_action", "sample_method", "transfer_mode",
"count_stage", "inspect_result", "area_type","count_scope_type" "count_stage", "inspect_result", "area_type","count_scope_type","priority"
] ]
} }
getDictionaryItem(params).then(res => { getDictionaryItem(params).then(res => {

42
src/pages/issue/coms/comIssueRequestPopup.vue

@ -23,10 +23,23 @@
@confirm="confirmWareHouse"></u-select> @confirm="confirmWareHouse"></u-select>
</view> </view>
</view> </view>
<view class='split_line'></view>
<view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-right: 20rpx;
border-radius: 8rpx;
">
<view class="uni-center" style="width: 25%; font-size: 32rpx; ">
优先级
</view>
<view style="width: 100%;">
<uni-data-select style="padding: 20rpx;" v-model="priority" :localdata="priorityList"
:clear="false"></uni-data-select>
</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="uni-flex uni-row padding title u-col-center">
<text>位置</text> <text>目标位置</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect"> <view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;"> <view class="" style="margin-left: 20rpx;">
{{positionInfo}} {{positionInfo}}
@ -38,7 +51,7 @@
<view class='split_line'></view> <view class='split_line'></view>
<view class="title padding" style="display: flex;"> <view class="title padding" style="display: flex;">
<text style=" flex-shrink: 0;">物料</text> <text style=" flex-shrink: 0;">需求物料</text>
<view class="" style="width: 100% ;"> <view class="" style="width: 100% ;">
{{itemCode}} {{itemCode}}
</view> </view>
@ -67,6 +80,7 @@
</view> </view>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
</view> </view>
</view> </view>
</view> </view>
@ -136,7 +150,21 @@
maxlength: 10, maxlength: 10,
stdPackInfo: undefined, stdPackInfo: undefined,
wareHouseList: [], wareHouseList: [],
showWareHouse: false showWareHouse: false,
priorityList: [{
value: 0,
text: "低"
},
{
value: 1,
text: "中"
},
{
value: 2,
text: "高"
},
],
priority:1,//
} }
}, },
props: { props: {
@ -207,6 +235,7 @@
this.itemCode = "请扫描物料信息"; this.itemCode = "请扫描物料信息";
this.rawLocationCode = "" this.rawLocationCode = ""
this.positionInfo = "请选择位置" this.positionInfo = "请选择位置"
this.priority = ''
this.fromWarehouseCode = "请选择仓库代码" this.fromWarehouseCode = "请选择仓库代码"
this.workshopCode = "" // this.workshopCode = "" //
this.workShopName = "" this.workShopName = ""
@ -241,6 +270,10 @@
}, },
confirm() { confirm() {
if (this.priority === '') {
this.showErrorMessage("请输入优先级", "priority")
return
}
if (this.positionInfo == "请选择位置") { if (this.positionInfo == "请选择位置") {
this.showErrorMessage("请选择位置") this.showErrorMessage("请选择位置")
return return
@ -286,6 +319,7 @@
fgLocationCode: this.fgLocationCode, fgLocationCode: this.fgLocationCode,
fromWarehouseCode: this.fromWarehouseCode, fromWarehouseCode: this.fromWarehouseCode,
toWarehouseCode: this.fromWarehouseCode, toWarehouseCode: this.fromWarehouseCode,
priority : this.priority,
itemCode: this.itemCode, itemCode: this.itemCode,
itemName: this.itemName, itemName: this.itemName,
uom: this.uom, uom: this.uom,

956
src/pages/issue/record/issueRecord.vue

File diff suppressed because it is too large

432
src/pages/issue/record/issueRecordV1.vue

@ -0,0 +1,432 @@
<template>
<view class="page-wraper">
<view class="" v-if='detailSource.length==0'>
<com-blank-view @goScan='goScan(true)'></com-blank-view>
</view>
<view v-else class="page-wraper">
<view class="page-main">
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
<view class="uni-row uni-flex">
<!-- <com-issue-request-info :workShopCode="workShopCode" :dataContent="toLocation">
</com-issue-request-info> -->
<work-station :workshopCode="workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode"
:rawLocationCode="toLocation.toLocationCode"></work-station>
</view>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation"
@updateData='updateData'
@removeItemCode ="removeItemCode"
>
</com-issue-detail-card>
</view>
</scroll-view>
<button class="btn_add" @click="goScan(false)">+去添加</button>
</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>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</view>
</view>
</view>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm' :itemCodeTypeList="itemCodeTypeList"></com-issue-request-popup>
<win-scan-button v-if='detailSource.length>0' @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import {
issueRecordSubmit,
getBalanceByBatchOffShelf
} from '@/api/request2.js';
import {
goHome,
getRemoveOption,
getISODateTime,
getCurrDateTime,
getPackingNumberAndBatch
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getBusinessType,
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comIssueRequestPopup from '@/pages/issue/coms/comIssueRequestPopup.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
export default {
name: '',
components: {
comBlankView,
comIssueRequestPopup,
jobDetailPopup,
comIssueRequestCreator,
comIssueRequestInfo,
comIssueDetailCard,
winScanButton,
comScanIssuePack,
workStation
},
data() {
return {
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: [],
workShopCode: "",
fromInventoryStatuses: "",
toInventoryStatuses: "",
requestList: [],
dataContent: {},
managementList: [],
itemCodeTypeList: []
}
},
mounted() {
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onLoad(option) {
var typeCode = "Issue"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.itemCodeTypeList = res.itemCodeTypeList;
this.fromInventoryStatuses = res.fromInventoryStatuses
this.toInventoryStatuses = res.toInventoryStatuses
this.goScan(true)
} else {
this.showErrorMessage(res.message)
}
});
},
methods: {
closeScan() {
this.resizeCollapse();
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
goScan(editPosition) {
this.$refs.comIssueRequestPopup.openRequestPopup(editPosition);
},
//
requestConfirm(action, item) {
if (item.itemCode == '' || item.itemCode == null) return;
let that = this;
let request = that.requestList.find(r => r.itemCode == item.itemCode);
if (request == undefined) {
that.requestList.push(item);
this.getRecommendInfo(item);
} else {
this.$refs.comMessage.showQuestionMessage('已经存在物料[' + item.itemCode + ']的需求信息,是否要修改?', res => {
if (res) {
request.qty = item.qty;
that.detailSource.forEach(detail => {
let index = detail.Items.findIndex(r => {
r.itemCode == item.itemCode
})
detail.Items.splice(index, 1);
})
this.getRecommendInfo(item);
}
});
}
},
getRecommendInfo(item) {
let that = this;
uni.showLoading({
title: '加载中...',
mask: true
})
getBalanceByBatchOffShelf(item.itemCode, item.qty).then(res => {
if (res.data == null) {
that.showMessage('未获取到推荐信息');
} else {
if (res.data.length > 0) {
that.workShopCode = item.workshopCode;
res.data.forEach(r => {
r.toLocationCode = item.rawLocationCode;
r.productionLineCode = item.productionLineCode;
r.workStationCode = item.workStationCode;
// r.itemCode = item.itemCode;
r.itemName = item.itemName
r.uom = item.uom;
that.subList.push(r);
})
that.detailSource = getDataSource(that.detailSource, that.subList)
//
that.detailSource.forEach(detail => {
detail.Items.forEach(i => {
let request = that.requestList.find(r => r
.itemCode == i
.itemCode);
i.qty = request.qty;
})
})
that.resizeCollapse();
} else {
that.showMessage('列表数据为0');
}
uni.hideLoading();
}
}).catch(error => {
uni.hideLoading()
that.showErrorMessage(error)
})
},
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty = calc.add(totalQty, res.qty);
})
this.detailSource.totalQty = totalQty;
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
var dataContent = {
allowModifyPackingNumber: "FALSE",
outInventoryStatuses: this.fromInventoryStatuses
}
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, dataContent);
},
closeScanPopup() {
this.updateCommitBtn();
},
updateData(record) {
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty);
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
this.resizeCollapse();
// item.handleQty=itemHandleQty;
// this.closeScan();
},
removeItemCode(){
var isClear =this.detailSource[0].Items.length==0
if(isClear){
this.clearData();
this.$refs.comIssueRequestPopup.initData()
}
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = subItem
.toLocationCode;
record.fromLocationCode = fromLocation
.fromLocationCode
record.supplierCode = r.supplierCode;
let single_price = r.singlePrice == null ?
0 : r.singlePrice;
record.singlePrice = single_price;
record.amount = single_price * r.qty;
//使
var info = getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
subItem.recordList.push(record);
})
subList.push(subItem);
}
})
})
})
})
this.dataContent.subList = subList
this.dataContent.createTime = createTime;
this.dataContent.creator = creator;
return this.dataContent;
},
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocation => {
toLocation.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.submitJob();
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
submitJob() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败:【" + res.msg+"】")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
this.$refs.comIssueRequestPopup.initData()
})
},
clearData() {
this.subList= [], //subList
this.detailSource=[], //
this.detailOptions=[],
this.scanOptions= [],
this.workShopCode="",
this.requestList= [],
this.dataContent= {},
this.managementList= []
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
showQuestionMessage(message) {
},
// this.$refs.comMessage.showQuestionMessage('?', res => {
// if (res) {
// that.clearInfo();
// }
// });
}
}
</script>
<style>
</style>

4
src/pages/issue/request/issueRequestCreate.vue

@ -107,7 +107,6 @@
// //
requestConfirm(action, item) { requestConfirm(action, item) {
if (this.detailSource.subList.length == 0) { if (this.detailSource.subList.length == 0) {
this.detailSource = { this.detailSource = {
workshopCode: item.workshopCode, workshopCode: item.workshopCode,
@ -119,6 +118,7 @@
toLocationCode: item.rawLocationCode, toLocationCode: item.rawLocationCode,
fromWarehouseCode:item.fromWarehouseCode, fromWarehouseCode:item.fromWarehouseCode,
useOnTheWay:this.useOnTheWay, useOnTheWay:this.useOnTheWay,
priority : item.priority,
totalQty: 0, totalQty: 0,
subList: [] subList: []
} }
@ -153,7 +153,7 @@
qty: item.qty, qty: item.qty,
uom: item.uom uom: item.uom
} }
this.detailSource.priority =item.priority
this.detailSource.subList.push(subItem) this.detailSource.subList.push(subItem)
} else { } else {

682
src/pages/repleinsh/record/repleinshRecord.vue

@ -1,44 +1,58 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='showRequestPopup' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='getBusinessType' v-if="recommendList.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="recommendList.length>0">
<view class="page-header">
<view class="header_item" style="font-size:35rpx; padding: 10rpx;">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx;">
先进先出推荐信息
</view>
</template>
<view class="detail-list" v-for="(recommend, index) in recommendList" :key="recommend.id">
<view class="card_view">
<text class="card_item_code ">物料代码</text>
<text class="card_content ">{{recommend.itemCode}}</text>
</view>
<balance :dataContent='recommend' :isShowStatus='false'></balance>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(toLocation, index) in detailSource" :key="index"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<view class="page-header"> <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
<view class="text_lightblue fontsize-16">目标库位:{{toLocation.toLocationCode}}</view> :isShowFromLocation="true" @removeItem="removeItem(index,item)"
</view> :isShowToLocation="false" @updateData="updateData" @removePack="removePack">
<com-issue-detail-card ref='comRepleinshDetailCard' :dataContent="toLocation" </record-com-detail-card>
@updateData='updateData'>
</com-issue-detail-card>
</view> </view>
<!-- <view class='split_line'></view> -->
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList">
</requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<com-repleinsh-request-popup ref="comRepleinshRequestPopup" :toLocationAreaTypeList="toLocationAreaTypeList" <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
@confirm='requestConfirm' </winComScanBalance>
:itemCodeTypeList="itemCodeTypeList">
</com-repleinsh-request-popup>
<win-scan-button v-if='detailSource.length>0' @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -46,93 +60,91 @@
<script> <script>
import { import {
repleinshRecordSubmit, repleinshRecordSubmit,
validateItemAndLocation,
getPutawayRecommendLocation,
getBalanceByFilter,
getBalanceByBatchOffShelf getBalanceByBatchOffShelf
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
getDetailOption,
getDetailRemoveOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import { import {
getBusinessType, getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
getDataSource getManagementPrecisions,
} from '@/pages/issue/js/issue.js'; getPrecisionStrategyList,
getPrecisionStrategyParams
import {
getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import comRepleinshRequestPopup from '@/pages/repleinsh/coms/comRepleinshRequestPopup.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' import balance from '@/mycomponents/balance/balance.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
export default { export default {
components: { components: {
winScanButton, winScanButton,
winScanPack, winScanPack,
requiredLocation,
comBlankView, comBlankView,
winScanLocation,
winScanPackAndLocation, winScanPackAndLocation,
recordComDetailCard, recordComDetailCard,
comRepleinshRequestPopup, winComScanBalance,
comIssueDetailCard, balance
comScanIssuePack
}, },
data() { data() {
return { return {
id: '', id: '',
receiptJob: {}, dataContent: {}, //
subList: [], //subList
detailSource: [], // detailSource: [], //
businessTypeInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationCode: "", fromLocationAreaTypeList: [],
toLocationAreaTypeList: [], toLocationAreaTypeList: [],
allowModifyLocation: false, inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {}, businessType: {},
requestList: [], showToLoaction: true,
managementList: [], recommendLocationList: [], //
dataContent: {}, fromWarehouseCode: '', //
itemCodeTypeList:[] businessTypeCode: "Repleinment",
toLocationCode: "",
resultData: {},
itemCode: "",
recommendList: []
}; };
}, },
onLoad(option) { onLoad(option) {
var typeCode = "Repleinment" uni.setNavigationBarTitle({
getBusinessType(typeCode, res => { title: option.title
if (res.success) { })
this.businessType = res.businessType; this.clear();
this.itemCodeTypeList = res.itemCodeTypeList; this.getBusinessType()
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showRequestPopup();
} else {
this.showErrorMessage(res.message)
}
});
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -146,77 +158,115 @@
onPullDownRefresh() {}, onPullDownRefresh() {},
mounted() {}, mounted() {},
methods: { methods: {
closeScan() { getBusinessType() {
this.resizeCollapse(); getBusinessType(this.businessTypeCode, res => {
}, if (res.success) {
resizeCollapse() { this.businessType = res.businessType;
this.$nextTick(r => { this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.$refs.comRepleinshDetailCard.forEach(r => { this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
r.resizeCollapse(); this.openScanPopup();
}) } else {
this.showErrorMessage(res.message)
}
}); });
}, },
showRequestPopup() { getBalance(label, packageInfo, callback) {
this.$refs.comRepleinshRequestPopup.openRequestPopup(); var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
}, },
// getScanResult(result) {
requestConfirm(action, item) {
if (item.itemCode == '' || item.itemCode == null) return;
let that = this; let that = this;
let request = that.requestList.find(r => r.itemCode == item.itemCode); let pack = result.package;
if (request == undefined) { if (that.recommendList.length > 0) {
that.requestList.push(item); let recommend = that.recommendList.filter(r => r.itemCode == pack.itemCode);
this.getRecommendInfo(item); if (recommend.length == 0) {
this.showErrorMessage('物料代码【' + pack.itemCode + '】不在推荐列表中');
} else { } else {
this.$refs.comMessage.showQuestionMessage('已经存在物料[' + item.itemCode + ']的需求信息,是否要修改?', res => { let batch = recommend.find(r => r.batch == pack.batch);
if (res) { if (batch == undefined) {
request.qty = item.qty; that.showErrorMessage('扫描的批次【' + pack.batch + '】,不是系统推荐的批次,不满足系统的先进先出规则,请重新扫描物料');
that.detailSource.forEach(detail => { } else {
let index = detail.Items.findIndex(r => { this.setData(result);
r.itemCode == item.itemCode
})
detail.Items.splice(index, 1);
})
this.getRecommendInfo(item);
} }
}); }
} else {
this.getRecommendInfo(result);
} }
}, },
getRecommendInfo(item) { getRecommendInfo(result) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
mask: true mask: true
}) })
getBalanceByBatchOffShelf(item.itemCode, item.qty).then(res => { let item = {
itemCode: result.package.itemCode,
qty: result.package.qty,
}
getBalanceByBatchOffShelf(item.itemCode, item.qty, "Repleinment").then(res => {
if (res.data == null) { if (res.data == null) {
that.showMessage('未获取到推荐信息'); that.showErrorMessage('未获取到推荐信息');
} else { } else {
if (res.data.length > 0) { if (res.data.length > 0) {
res.data.forEach(r => { that.recommendList = res.data;
r.toLocationCode = item.toLocation.code; that.recommendList.forEach(r => r.locationCode = r.fromLocationCode)
r.itemName = item.itemName let recommendInfo = res.data[0];
r.uom = item.uom; if (recommendInfo.batch != result.package.batch) {
that.subList.push(r); that.showErrorMessage('扫描的批次【' + result.package.batch + '】,不是系统推荐的批次【' +
}) recommendInfo.batch + '】,不满足系统的先进先出规则,请重新扫描');
} else {
that.detailSource = getDataSource(that.detailSource, that.subList) this.setData(result);
// }
that.detailSource.forEach(detail => {
detail.Items.forEach(i => {
let request = that.requestList.find(r => r
.itemCode == i
.itemCode);
i.qty = request.qty;
})
})
// that.resizeCollapse();
} else { } else {
that.showMessage('列表数据为0'); that.showErrorMessage('未查找到物料的推荐信息');
} }
uni.hideLoading(); uni.hideLoading();
} }
@ -226,76 +276,98 @@
}) })
}, },
setData(result) {
caclcQty() { let balance = result.balance;
var totalQty = 0; let label = result.label;
this.detailSource.subList.forEach(res => { let pack = result.package;
totalQty = calc.add(totalQty, res.qty) if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
}) this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
this.detailSource.totalQty = totalQty; .fromLocationCode + "]没有库存余额")
}, return;
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
var dataContent = {
allowModifyPackingNumber: "FALSE",
outInventoryStatuses: this.fromInventoryStatuses
} }
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, dataContent);
},
closeScanPopup() { var item = this.detailSource.find(res => {
this.updateCommitBtn(); if (res.itemCode == balance.itemCode) {
}, return res
}
updateData(record) { })
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); if (item == undefined) {
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); if (this.itemCode != "" && this.itemCode != balance.itemCode) {
let itemHandleQty = 0; this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码")
if (item != undefined) { return;
item.Locations.forEach(l => { }
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b if (this.fromWarehouseCode == '') {
.packingNumber == null || b.packingNumber == '') && b.batch == this.fromWarehouseCode = balance.warehouseCode;
record.batch); }
let handleQty = 0; var itemp = createItemInfo(balance, pack);
if (batch != undefined) { let newDetail = createDetailInfo(balance, pack); //
batch.Records.forEach(res => { newDetail.parentNumber = pack.parentNumber;
handleQty = calc.add(handleQty, res.qty) newDetail.packingNumber = pack.number
}) newDetail.packUnit = pack.packUnit;
batch.handleQty = handleQty; newDetail.packQty = pack.packQty;
itemHandleQty = calc.add(itemHandleQty, handleQty) if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode
this.scanPopupGetFocus()
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
} }
}) })
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
} }
this.resizeCollapse(); calcHandleQty(this.detailSource);
// item.handleQty=itemHandleQty;
// this.closeScan();
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
this.scanPopupGetFocus()
} }
}); });
}, },
calcHandleQty() {
for (let item of this.detailSource) { updateData() {
item.qty = 0; calcHandleQty(this.detailSource);
for (let detail of item.subList) { for (var i = 0; i < this.detailSource.length; i++) {
if (detail != undefined) { let item = this.detailSource[i];
item.qty = calc.add(item.qty,detail.qty) if (item.qty == 0) {
} this.detailSource.splice(i, 1)
} }
} }
this.$forceUpdate(); this.$forceUpdate();
}, },
removeItem(index, item) { removeItem(index, item) {
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
this.updateData();
}, },
removePack() { removePack() {
@ -309,169 +381,142 @@
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.getBusinessType()
}
}, },
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() { closeScanPopup() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
} }
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();
} }
}, },
submit() { scanLocationCode(location, code) {
if(this.getScanCount()==0){ this.toLocationCode = code
this.showErrorMessage("当前扫描数为0,请先扫描在提交"); },
return
commit() {
if (this.toLocationCode == "") {
this.showMessage("请输入目标库位")
return;
}
if (this.detailSource.length == 0) {
this.showMessage("请扫描要发货的物料")
return;
} }
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = this.toLocationCode
detail.fromLocation = this.fromLocationCode
})
})
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
// //
var itemCodes = [] let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource);
let locationCode = this.detailSource[0].toLocationCode //2:
this.detailSource.forEach(toLocation => { getPrecisionStrategyList(precisionStrategyParams, res => {
toLocation.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
this.submitJob(); var params = this.setRecordParams()
console.log("提交参数", JSON.stringify(params));
repleinshRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成直接补料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}); });
}, },
submitJob() {
var params = this.setParams() setRecordParams() {
console.log("提交参数", JSON.stringify(params));
repleinshRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成补料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg+"]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => { this.detailSource.forEach(item => {
toLocationCode.Items.forEach(item => { item.subList.forEach(detail => {
item.Locations.forEach(fromLocation => { if (detail.scaned) {
fromLocation.Batchs.forEach(batch => { var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
let subItem = batch.detail; detail.packingNumber, detail.toLocationCode, detail.batch);
subItem.recordList = []; var submitItem = deepCopyData(detail)
submitItem.toPackingNumber = info.packingNumber;
if (batch.Records.length > 0) { submitItem.toBatch = info.batch;
batch.Records.forEach(r => { submitItem.toContainerNumber = detail.containerNumber;
let record = {};
record.handleQty = r.qty; submitItem.fromPackingNumber = info.packingNumber;
submitItem.fromBatch = info.batch;
record.fromPackingNumber = r submitItem.fromContainerNumber = detail.containerNumber;
.packingNumber;
record.fromBatch = r.batch; submitItem.fromLocationCode = detail.locationCode;
record.fromContainerNumber = r submitItem.toLocationCode = detail.toLocationCode;
.ContainerNumber;
// detail.toInventoryStatus = detail.inventoryStatus
record.toContainerNumber = r // detail.toLocationCode = detail.toLocationCode
.ContainerNumber; submitItem.qty = detail.handleQty;
record.toInventoryStatus = r submitItem.package = "";
.inventoryStatus; submitItem.recordList = [{
record.toLocationCode = subItem toInventoryStatus: detail.inventoryStatus,
.toLocationCode; fromPackingNumber: info.packingNumber,
record.fromLocationCode = fromLocation fromParentPackingNumber: detail.parentNumber,
.fromLocationCode fromBatch: info.batch,
record.supplierCode = r.supplierCode;
toPackingNumber: info.packingNumber,
//使
var info = getPackingNumberAndBatch( toBatch: info.batch,
this.managementList, r fromLocationCode: detail.locationCode,
.itemCode, toLocationCode: detail.toLocationCode,
r.packingNumber, r handleQty: detail.handleQty,
.batch); fromPackUnit: detail.packUnit,
record.toPackingNumber = info toPackUnit: detail.packUnit,
.packingNumber; fromPackQty: detail.packQty,
record.toBatch = info.batch; toPackQty: detail.packQty
subItem.recordList.push(record); }]
}) subList.push(submitItem)
subList.push(subItem); }
}
})
})
}) })
}) })
if (subList.length > 0) {
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode;
}
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.createTime = createTime;
this.dataContent.creator = creator; this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
return this.dataContent; return this.dataContent;
}, },
getScanCount(){
var scanCount = 0;
var subList = []
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
subItem.recordList.push(record);
})
subList.push(subItem);
}
})
})
})
})
return scanCount =subList.length;
},
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) {} if (res) {}
}); });
}, },
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) { showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message); this.$refs.comMessage.showScanMessage(message);
@ -484,75 +529,34 @@
closeScanMessage() { closeScanMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
getLocation(location, code) {
this.getToLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) { getToLocationCode(location, code) {
// if (this.fromLocationCode == code) { if (this.fromLocationCode == code) {
// uni.showToast({ uni.showToast({
// title: "[" + this.fromLocationCode + "][" + code + "]", title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
// duration: 2000 duration: 2000
// }) })
// return return
// } }
this.ToLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData(); this.clear();
}) })
}, },
clearData() {
clear() {
this.fromLocationCode = ''; this.fromLocationCode = '';
this.fromWarehouseCode = '';
this.toWarehouseCode = '';
this.detailSource = []; this.detailSource = [];
this.requestList = []; this.toLocationCode = "";
this.dataContent = {} this.itemCode = ""
this.managementList = [] }
},
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.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;
}
</style> </style>

558
src/pages/repleinsh/record/repleinshRecordV1.vue

@ -0,0 +1,558 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showRequestPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(toLocation, index) in detailSource" :key="index">
<view class="">
<view class="page-header">
<view class="text_lightblue fontsize-16">目标库位:{{toLocation.toLocationCode}}</view>
</view>
<com-issue-detail-card ref='comRepleinshDetailCard' :dataContent="toLocation"
@updateData='updateData'>
</com-issue-detail-card>
</view>
<!-- <view class='split_line'></view> -->
</view>
</scroll-view>
</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>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<com-repleinsh-request-popup ref="comRepleinshRequestPopup" :toLocationAreaTypeList="toLocationAreaTypeList"
@confirm='requestConfirm'
:itemCodeTypeList="itemCodeTypeList">
</com-repleinsh-request-popup>
<win-scan-button v-if='detailSource.length>0' @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
repleinshRecordSubmit,
getBalanceByBatchOffShelf
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
goHome,
getCurrDateTime,
getPackingNumberAndBatch
} from '@/common/basic.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getDetailOption,
getDetailRemoveOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import {
getBusinessType,
calcHandleQty
} from '@/common/record.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import comRepleinshRequestPopup from '@/pages/repleinsh/coms/comRepleinshRequestPopup.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
export default {
components: {
winScanButton,
winScanPack,
comBlankView,
winScanPackAndLocation,
recordComDetailCard,
comRepleinshRequestPopup,
comIssueDetailCard,
comScanIssuePack
},
data() {
return {
id: '',
receiptJob: {},
subList: [], //subList
detailSource: [], //
businessTypeInfo: {},
fromLocationCode: "",
toLocationCode: "",
toLocationAreaTypeList: [],
allowModifyLocation: false,
businessType: {},
requestList: [],
managementList: [],
dataContent: {},
itemCodeTypeList:[]
};
},
onLoad(option) {
var typeCode = "Repleinment"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.itemCodeTypeList = res.itemCodeTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showRequestPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {},
methods: {
closeScan() {
this.resizeCollapse();
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comRepleinshDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
showRequestPopup() {
this.$refs.comRepleinshRequestPopup.openRequestPopup();
},
//
requestConfirm(action, item) {
if (item.itemCode == '' || item.itemCode == null) return;
let that = this;
let request = that.requestList.find(r => r.itemCode == item.itemCode);
if (request == undefined) {
that.requestList.push(item);
this.getRecommendInfo(item);
} else {
this.$refs.comMessage.showQuestionMessage('已经存在物料[' + item.itemCode + ']的需求信息,是否要修改?', res => {
if (res) {
request.qty = item.qty;
that.detailSource.forEach(detail => {
let index = detail.Items.findIndex(r => {
r.itemCode == item.itemCode
})
detail.Items.splice(index, 1);
})
this.getRecommendInfo(item);
}
});
}
},
getRecommendInfo(item) {
let that = this;
uni.showLoading({
title: '加载中...',
mask: true
})
getBalanceByBatchOffShelf(item.itemCode, item.qty).then(res => {
if (res.data == null) {
that.showMessage('未获取到推荐信息');
} else {
if (res.data.length > 0) {
res.data.forEach(r => {
r.toLocationCode = item.toLocation.code;
r.itemName = item.itemName
r.uom = item.uom;
that.subList.push(r);
})
that.detailSource = getDataSource(that.detailSource, that.subList)
//
that.detailSource.forEach(detail => {
detail.Items.forEach(i => {
let request = that.requestList.find(r => r
.itemCode == i
.itemCode);
i.qty = request.qty;
})
})
// that.resizeCollapse();
} else {
that.showMessage('列表数据为0');
}
uni.hideLoading();
}
}).catch(error => {
uni.hideLoading()
that.showErrorMessage(error)
})
},
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty = calc.add(totalQty, res.qty)
})
this.detailSource.totalQty = totalQty;
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
var dataContent = {
allowModifyPackingNumber: "FALSE",
outInventoryStatuses: this.fromInventoryStatuses
}
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, dataContent);
},
closeScanPopup() {
this.updateCommitBtn();
},
updateData(record) {
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
this.resizeCollapse();
// item.handleQty=itemHandleQty;
// this.closeScan();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
calcHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty,detail.qty)
}
}
}
this.$forceUpdate();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
submit() {
if(this.getScanCount()==0){
this.showErrorMessage("当前扫描数为0,请先扫描在提交");
return
}
uni.showLoading({
title: "提交中....",
mask: true
});
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocation => {
toLocation.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.submitJob();
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
submitJob() {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
repleinshRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成补料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg+"]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = subItem
.toLocationCode;
record.fromLocationCode = fromLocation
.fromLocationCode
record.supplierCode = r.supplierCode;
//使
var info = getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
subItem.recordList.push(record);
})
subList.push(subItem);
}
})
})
})
})
this.dataContent.subList = subList
this.dataContent.createTime = createTime;
this.dataContent.creator = creator;
return this.dataContent;
},
getScanCount(){
var scanCount = 0;
var subList = []
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
subItem.recordList.push(record);
})
subList.push(subItem);
}
})
})
})
})
return scanCount =subList.length;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getToLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
// if (this.fromLocationCode == code) {
// uni.showToast({
// title: "[" + this.fromLocationCode + "][" + code + "]",
// duration: 2000
// })
// return
// }
this.ToLocationCodeInfo = location;
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
})
},
clearData() {
this.fromLocationCode = '';
this.detailSource = [];
this.requestList = [];
this.dataContent = {}
this.managementList = []
},
}
}
</script>
<style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.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;
}
</style>
Loading…
Cancel
Save