Browse Source

Merge branch 'hella_online_20240803' into master_hella

# Conflicts:
#	src/mycomponents/qty/balanceQtyEdit.vue
hella_online_20240829
陈薪名 3 months ago
parent
commit
3daf4da63a
  1. 2
      .env.development
  2. 9
      .env.production
  3. 2
      .hbuilderx/launch.json
  4. 4
      src/api/httpRequest3.js
  5. 25
      src/api/request2.js
  6. 21
      src/common/noclick.js
  7. 1
      src/main.js
  8. 6
      src/manifest.json
  9. 30
      src/mycomponents/common/comMessage.vue
  10. 8
      src/mycomponents/qty/balanceQtyEdit.vue
  11. 257
      src/mycomponents/query/balanceQuery.vue
  12. 84
      src/mycomponents/query/showListItem.vue
  13. 55
      src/mycomponents/scan/winComScan.vue
  14. 2
      src/mycomponents/scan/winScanPackAndLocation.vue
  15. 59
      src/pages.json
  16. 2
      src/pages/count/job/fuzzyCountDetail.vue
  17. 49
      src/pages/customerReturn/job/returnDetail.vue
  18. 2
      src/pages/index/index.vue
  19. 6
      src/pages/inventoryMove/coms/comInventoryDetailCard.vue
  20. 48
      src/pages/inventoryMove/coms/comMoveRecord.vue
  21. 53
      src/pages/inventoryMove/job/inventoryMoveDetail.vue
  22. 63
      src/pages/issue/job/issueDetail.vue
  23. 2
      src/pages/issue/job/issueJob.vue
  24. 44
      src/pages/issue/record/directIssue.vue
  25. 36
      src/pages/login/index.vue
  26. 4
      src/pages/package/coms/comScanPackagePack.vue
  27. 2
      src/pages/package/record/splitPackageRecord.vue
  28. 134
      src/pages/pointPutawayJob/index.vue
  29. 10
      src/pages/productDismantle/job/productDismantleDetail.vue
  30. 10
      src/pages/productPutaway/job/productPutawayDetail.vue
  31. 48
      src/pages/productPutaway/record/productPutawayRecord.vue
  32. 10
      src/pages/productReceipt/job/completeReceiveJobDetail.vue
  33. 24
      src/pages/productReceipt/job/productReceiptDetail.vue
  34. 43
      src/pages/productReceipt/job/scrapReceiptDetail.vue
  35. 10
      src/pages/productReceipt/job/semiProductReceiptDetail.vue
  36. 52
      src/pages/productRecycle/job/productRecycleJobDetail.vue
  37. 57
      src/pages/productionReceipt/job/productionReceiptDetail.vue
  38. 5
      src/pages/productionReceipt/job/productionReceiptJob.vue
  39. 10
      src/pages/productionReturn/job/returnDetail.vue
  40. 8
      src/pages/purchaseReceipt/job/receiptDetail.vue
  41. 52
      src/pages/purchaseReturn/job/returnDetail.vue
  42. 10
      src/pages/putaway/job/putawayDetail.vue
  43. 431
      src/pages/putaway/job/quantityPutawayJob.vue
  44. 604
      src/pages/putaway/job/quantityPutawayJobDetail.vue
  45. 51
      src/pages/scrap/job/scrapJobDetail.vue
  46. 10
      src/pages/transfer/job/issueDetail.vue
  47. 11
      src/pages/transfer/job/receiptDetail.vue
  48. 12
      src/pages/transfer/job/transferDetail.vue
  49. 50
      src/pages/unPlanned/job/issueJobDetail.vue
  50. 10
      src/pages/unPlanned/job/receiptJobDetail.vue
  51. 12
      src/store/modules/user.js
  52. 8
      src/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue

2
.env.development

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

9
.env.production

@ -1,11 +1,12 @@
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.22.32.8:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api
# 租户配置
VITE_TENANT='[{"text":"长春1379","value":1}]'
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 是否是测试环境
VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90'
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90'

2
.hbuilderx/launch.json

@ -17,7 +17,7 @@
"type" : "uni-app:h5"
},
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
}
]

4
src/api/httpRequest3.js

@ -89,6 +89,8 @@ function service(options = {}) {
message = '接口' + message.substr(message.length - 3) + '异常'
} else if (message.includes('get lock')) {
message = '接口' + "数据库死锁"
}else if(message.includes('statusCode:-1')){
message = "当前设备无网络,请检查网络后重试"
}
reject("系统异常:" + message);
console.log("系统异常", message)
@ -99,7 +101,7 @@ function service(options = {}) {
const networkType = res.networkType;
console.log("网络类型", networkType)
if (networkType == "none") {
reject("当前无网络");
reject("当前设备无网络,请检查网络后重试");
} else {
uni.request(options);
}

25
src/api/request2.js

@ -19,7 +19,7 @@ export function getCaptchaImage(params) {
*/
export function login(username, password, code, uuid, tenantName) {
return request({
url: baseApi + '/system/auth/login',
url: baseApi + '/system/auth/loginNoCode',
headers: {
isToken: false
},
@ -553,6 +553,29 @@ export function getBasicItemByCode(itemCode) {
});
}
/**
* 查询物品信息接口
* @param {*} code 物品代码
*
*/
export function getBasicItemByCodeSenior(itemCode) {
var params = {
filters: [{
column: "code",
action: "like",
value: itemCode
}],
pageNo: 1,
pageSize: 1000
}
return request({
url: baseApi + "/wms/itembasic/senior",
method: "post",
data: params,
});
}
/**
* 按物品查询库存汇总
* @param {*} itemCode

21
src/common/noclick.js

@ -11,15 +11,34 @@ function noMultipleClicks(methods, info) {
} else {
methods();
}
setTimeout(()=> {
let timer = setTimeout(()=> {
that.noClick= true;
clearTimeout(timer)
}, 2000)
} else {
// 这里是重复点击的判断
}
}
// 节流函数
const throttle = (fn, t,_this) => {
console.log('throttle')
return ()=> {
if (!_this.timer) {
_this.timer = setTimeout(()=>{
console.log('fn')
//·清空定时器
_this.timer = null
}, t)
fn()
}
}
}
//导出
export default {
noMultipleClicks,//禁止多次点击
throttle
}

1
src/main.js

@ -36,6 +36,7 @@ export function createApp() {
app.use(uView)
app.component('comMessage', comMessage)
app.config.globalProperties.$noMultipleClicks = noclick.noMultipleClicks;
app.config.globalProperties.$throttle = noclick.throttle;
// startApp(app);
return {
app,

6
src/manifest.json

@ -1,10 +1,10 @@
{
"name" : "wms",
"package" : "uni.UNI43932FE",
"appid" : "__UNI__C9CF4BF",
"appid" : "__UNI__F36DDCF",
"description" : "",
"versionName" : "1.0.55",
"versionCode" : 55,
"versionName" : "1.0.63",
"versionCode" : 63,
"transformPx" : false,
/* 5+App */
"app-plus" : {

30
src/mycomponents/common/comMessage.vue

@ -12,16 +12,22 @@
<slot name="icon">
<image class="icon" :src="icon" />
</slot>
<slot name="content">
<text class="content" :style="{'color': textColor?textColor:'#000'}" >
{{content}}
</text>
<!-- <rich-text class="content" :nodes="content" v-else></rich-text> -->
</slot>
<scroll-view style="max-height: 400rpx; " scroll-y="true">
<slot name="content">
<view class="" style="display: flex;align-items: center;justify-content: center;">
<text class="text_content" :style="{'color': textColor?textColor:'#000'}" >
{{content}}
</text>
</view>
<!-- <rich-text class="content" :nodes="content" v-else></rich-text> -->
</slot>
</scroll-view>
<view class='split_line'></view>
<slot name="button">
<view class="uni-flex uni-row u-col-center space-between" style="width: 100%;height: 48px;">
<view class="uni-flex uni-row u-col-center space-between" style="width: 100%;height: 50rpx;">
<view v-if="showCancelButton" class="cance_button" @tap="cancelClose">
<text :style="{'color':cancelColor}">{{ cancelText }}</text>
</view>
@ -493,6 +499,7 @@
display: flex; //
flex-direction: column; //
align-items: center; //
margin: 8rpx;
// background-image: url()
}
@ -544,4 +551,11 @@
.def_text {
color: $uni-color-primary;
}
.text_content{
padding: 10rpx;
font-size: 32rpx;
text-align: center;
word-break: break-all;
white-space: normal;
}
</style>

8
src/mycomponents/qty/balanceQtyEdit.vue

@ -36,7 +36,7 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number"
@confirm="confirm()" @input="checkNum" :maxlength="maxlength" disabled :style="{background:'#f5f5f5',color:'#bbbbbb'}"/>
@confirm="confirm()" @input="checkNum" :maxlength="maxlength" :disabled="!allowEditQty" :style="allowEditQty?{}:{background:'#f5f5f5',color:'#bbbbbb'}"/>
<uom :uom="dataContent.uom"></uom>
</view>
</view>
@ -119,7 +119,11 @@
queryBalance: {
type: Boolean,
default: true
}
},
allowEditQty: {
type: Boolean,
default: true
},
},
watch:{
'allQty'(newVal){

257
src/mycomponents/query/balanceQuery.vue

@ -0,0 +1,257 @@
<template>
<view style=" ">
<uni-drawer ref="showRight" mode="left" :mask-click="true" :width="330">
<view style="height:100vh;display:flex;flex-direction:column;">
<view class="uni-flex" style="justify-content: center;
background-color:#007AFF ;
color: #fff;
padding: 15rpx;
font-size: 35rpx;">
库存查询
</view>
<scroll-view v-if="true" style="height: calc(100vh - 180rpx)" scroll-y="true">
<!-- <button @click="closeDrawer" type="primary">关闭Drawer</button> -->
<!-- <view v-for="item in 110" :key="item">可滚动内容 {{ item }}</view> -->
<view class="" style="margin: 10rpx; font-size: 35rpx;">
物料号
</view>
<view style=" margin: 10rpx; display: flex; align-items: center;">
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="itemCode" placeholder="请输入物料号"
@clear="clearItemCode" @confirm="onConfirmItemCode"></uni-easyinput>
<!-- <view>查询</view> -->
<!-- <button style="height: 80rpx; align-items: center; text-align: center;" type="primary" size="mini" >查询</button> -->
</view>
<view v-for="(item, index) in itemCodeResult" :key="index" @click="selectItemCode(item)">
<view class="" style="font-size: 30rpx; margin: 20rpx;">
<view class="">
({{index+1}}) 物料代码 : {{item.code}}
</view>
<view class="">
名称 : {{item.name}}
</view>
<view class="">
描述1 : {{item.desc1}}
</view>
<view class="">
描述2 : {{item.desc1}}
</view>
</view>
<view class="split_line"></view>
</view>
<scroll-view scroll-x="true" v-if="tableData.length>0" style="width: 330px; display: flex; align-items: center; justify-content: center; ">
<view style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;">
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr>
<uni-th width="60" style="font-weight: 800;" align="left">序号</uni-th>
<uni-th width="60" align="left">批次</uni-th>
<uni-th width="50" align="left">库位</uni-th>
<uni-th width="60" align="left">状态</uni-th>
<uni-th width="120" align="left">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item, index) in tableData" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{item.batch}}</uni-td>
<uni-td>{{item.locationCode}}</uni-td>
<uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td>
<uni-td>{{item.qty}}</uni-td>
</uni-tr>
</uni-table>
<view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }}
</view>
</view>
<uni-pagination :current="current" :total="total" :show-icon="true"
@change="change" />
</view>
</view>
</scroll-view>
</scroll-view>
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx;">关闭</button>
</view>
</uni-drawer>
</view>
</template>
<script>
import {
getBasicItemByCodeSenior,
} from '@/api/request2.js';
import {
getInventoryStatusStyle,
getInventoryStatusName
} from '@/common/directory.js';
export default {
components: {},
data() {
return {
itemCode: "",
itemCodeResult: [],
current: 1,
total: 18,
tableData: [{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 1
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 2
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
}
]
}
},
props: {
// detail: {
// type: Object,
// default: {}
// },
// isShowPack: {
// type: Boolean,
// default: true
// }
},
watch: {
},
methods: {
statusStyle: function(val) {
return getInventoryStatusStyle(val);
},
statusDesc(value) {
return getInventoryStatusName(value)
},
change() {
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
selectItemCode(item) {
this.itemCode = item.code
this.itemCodeResult = []
},
clearItemCode() {
this.itemCode = ""
this.itemCodeResult = []
},
onConfirmItemCode() {
if (!this.itemCode) {
this.showErrorMessage("物料号为空,请先输入物料号")
return;
}
uni.showLoading({
title: "加载中",
mask: true
})
getBasicItemByCodeSenior(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
if (res.data.list.length == 1) {
this.itemCode = res.data.list[0].code
} else {
this.itemCodeResult = res.data.list
}
} else {
this.showErrorMessage("未查找到物料[" + this.itemCode + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showDrawer() {
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
}
}
}
</script>
<style>
</style>

84
src/mycomponents/query/showListItem.vue

@ -0,0 +1,84 @@
<template>
<view class="wyf">
<uni-popup ref="listPopup" type="dialog">
<view class="container">
<uni-list class="list">
<uni-list-item v-for="(item,index) in list" :title="item.title"
thumb-size="lg" >
<template v-slot:footer>
<!-- <image class="slot-image" src="@/static/logo.png" mode="widthFix" @click="selectItem(item,index)"></image -->
<text class="go" @click="selectItem(item,index)">Go</text>
</template>
</uni-list-item>
</uni-list>
</view>
</uni-popup>
</view>
</template>
<script>
import { onShow } from '@dcloudio/uni-app';
export default {
emits: ["selectItem"],
components: {
},
data() {
return {
isScanedASN:false,
list: []
// [{
// title:'',
// selected:false
// }],
}
},
props: {
},
methods:{
openList(list){
this.list = list;
this.$refs.listPopup.open('center')
},
selectItem(item,index){
this.$refs.listPopup.close();
this.$emit("selectItem", item);
}
}
}
</script>
<style lang="scss" scoped>
.wyf{
// display: block;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000
}
.container{
display: flex;
justify-content: center;
align-items: center;
.list{
width: 80%;
max-height:50vh;
overflow-y: auto;
border-radius: 10px !important;
.slot-image{
width: 40rpx;
}
.go{
color: rgb(60, 156, 255);
}
}
}
.list ::v-deep .uni-list--border{
border: 1rpx solid #e5e5e5;
}
</style>

55
src/mycomponents/scan/winComScan.vue

@ -4,15 +4,11 @@
<view>
<view class="pop_tab">
<view class="tab_info">
<view class="conbox" >
<textarea
v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;"
:placeholder="placeholderValue"
:focus="boxfocus"
@blur="handleBlur"
@focus="handleFocus"
@input="handelScanMsg" :cursor="cursorIndex" ></textarea>
</view>
<view class="conbox">
<textarea v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;"
:placeholder="placeholderValue" :focus="boxfocus" @blur="handleBlur" @focus="handleFocus"
@input="handelScanMsg" ></textarea>
</view>
<view class="uni-flex uni-row space-between u-col-center">
<!-- <view class="paizhao" @click="scanQRCode()" v-if="true">
@ -20,7 +16,7 @@
</view> -->
<view class="uni-flex">
<button class="clean_scan_btn" @touchend.prevent="clearScanValue()">清空</button>
<button class="clean_scan_btn" @touchend.prevent="clearScanValue()">清空</button>
<button class="scan_btn" @click="clickScanMsg()">扫描</button>
</view>
</view>
@ -37,8 +33,7 @@
</view>
</view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'></u-line>
<scroll-view scroll-y="true" class="scroll-view" v-if="expand"
style="height: 70px;">
<scroll-view scroll-y="true" class="scroll-view" v-if="expand" style="height: 70px;">
<view class="uni-flex u-col" v-for="(item,index) in scanList">
<view style="width: 100%;max-height: 100px;">
<view class="uni-flex u-row space-between u-col-center" @click="showItem(item)">
@ -59,7 +54,7 @@
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script >
<script>
import {
getLabelInfo
} from '../../common/label.js';
@ -104,7 +99,7 @@
}
},
mounted() {
},
watch: {
placeholder() {
@ -139,7 +134,7 @@
},
clearScanValue() {
this.scanMsg = ''
this.cursorIndex =0
// this.cursorIndex = 0
this.getfocus();
},
clickScanMsg() {
@ -153,11 +148,13 @@
// mask: true
// })
let that = this;
let index = that.scanMsg.indexOf('\n');
if (index >= 0) {
// if(index==-1){
// that.scanMsg =that.scanMsg + "\n";
// }
if (that.scanMsg.includes('\n')) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => {
that.losefocus();
that.losefocus();
let content = uni.$u.trim(that.scanMsg)
if (content == "") {
// that.getfocus();
@ -176,7 +173,7 @@
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
scanResult.scanMessage=content
scanResult.scanMessage = content
if (scanResult.success) {
that.clear();
// that.getfocus();//
@ -191,14 +188,13 @@
})
}
});
}, 500);
}, 200);
}
},
handleFocus(){
},
handleBlur(){
handleFocus() {},
handleBlur() {
// setTimeout(res=>{
// uni.hideKeyboard();
// },200)
@ -216,14 +212,13 @@
});
},
clear() {
if(this.clearResult)
{
this.cursorIndex = 0;
this.scanMsg = ''
if (this.clearResult) {
this.scanMsg = ""
// this.cursorIndex = 0;
}
},
iconClick(type) {
this.$emit("clearResult", this.scanMsgk);
this.$emit("clearResult", this.scanMsg);
},
expands() {
this.expand = !this.expand;

2
src/mycomponents/scan/winScanPackAndLocation.vue

@ -434,7 +434,7 @@
balance: item,
fromLocationCode: this.fromLocationCode,
}
// this.packGetFocus();
this.packGetFocus();
this.$emit("getResult", data);
},

59
src/pages.json

@ -458,6 +458,45 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/putaway/job/quantityPutawayJob",
"style": {
"navigationBarTitleText": "采购上架(批量)",
"enablePullDownRefresh": false,
"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/putaway/job/quantityPutawayJobDetail",
"style": {
"navigationBarTitleText": "采购上架(批量)详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/putaway/record/putawayRecord",
"style": {
@ -606,7 +645,25 @@
"navigationBarTitleText": "直接发料",
"enablePullDownRefresh": false,
"titleNView": {
"autoBackButton": "true"
"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"
}
]
}
}
},

2
src/pages/count/job/fuzzyCountDetail.vue

@ -318,7 +318,7 @@
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus();
this.$refs.scanPopup.losefocus();
}
},

49
src/pages/customerReturn/job/returnDetail.vue

@ -339,17 +339,44 @@
if (!this.checkLocation()) {
return
}
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致`
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
})
})
if (str) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -358,24 +385,6 @@
} else {
this.submitJob()
}
// //
// if (this.scanCount == this.subList.length) {
// this.submitJob();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.submitJob();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(',\n' + "[" + this.scanCount +
// "][" + this.subList.length + "]", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
},
submitJob() {

2
src/pages/index/index.vue

@ -388,7 +388,7 @@
console.log("包装规格获取失败", res)
})
var switchCode="FgPutawayLocationCodeValidate,SemiPutawayLocationCodeValidate,PurchasePutawayToLocationCodeValidate,IssueToLocationCodeValidate,fgProductReceipCommitValidate,purchasereceiptPrintPDA,purchaseReceiptLocationCodeValidate,CreateProductputawayRequestAfterProductreceiptRecordCreated";
var switchCode="FgPutawayLocationCodeValidate,SemiPutawayLocationCodeValidate,PurchasePutawayToLocationCodeValidate,IssueToLocationCodeValidate,fgProductReceipCommitValidate,semiProductReceipCommitValidate,purchasereceiptPrintPDA,purchaseReceiptLocationCodeValidate,CreateProductputawayRequestAfterProductreceiptRecordCreated";
getSwitchByCode(switchCode).then(res=>{
uni.setStorageSync("switch", res.data)

6
src/pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -17,7 +17,7 @@
<!-- <view class='split_line'></view> -->
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm" :allowEditStatus="true"></balance-qty-edit>
<balance-qty-edit ref="qtyEdit" :allowEditQty="allowEditQty" :settingParam="settingParam" @confirm="confirm" :allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
></win-scan-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
@ -67,6 +67,10 @@
type: Object,
default: {}
},
allowEditQty: {
type: Boolean,
default: true
}
},
watch: {
// dataContent: {

48
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -372,20 +372,7 @@
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成" + this.title + "\n" +
res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
this.submit()
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
@ -398,6 +385,39 @@
}
},
submit(){
//
var params = this.setParams()
let hint=""
this.dataContent.subList.forEach(res=>{
if(res.fromLocationCode==res.toLocationCode&&
res.fromInventoryStatus==res.toInventoryStatus){
hint +=`包装号【${res.fromPackingNumber}】来源库位与目标库位 来源状态与目标状态一致,不可以提交\n`
}
})
if(hint){
uni.hideLoading()
this.$refs.comMessage.showQuestionMessage1(hint, 'red', res => {
if (res) {
}
});
return;
}
console.log("提交" + JSON.stringify(params))
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成" + this.title + "\n" +
res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setPrecisionStrategParams() {
var itemList = []

53
src/pages/inventoryMove/job/inventoryMoveDetail.vue

@ -12,7 +12,7 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData"
<comInventoryDetailCard :allowEditQty="false" :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData' @openDetail="openDetail">
</comInventoryDetailCard>
</view>
@ -354,17 +354,44 @@
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
//
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致`
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
}
})
})
if (str) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -373,26 +400,6 @@
} else {
this.submitJob()
}
// //
// //
// if (this.scanCount == this.subList.length) {
// this.submitJob();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.submitJob();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(',\n' + "[" + this.scanCount +
// "][" + this
// .subList.length + "]", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
},
submitJob() {

63
src/pages/issue/job/issueDetail.vue

@ -171,12 +171,6 @@
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
// this.$refs.mainCollapse.forEach(r => {
// r.childrens.forEach(i => {
// i.init();
// })
// r.resize();
// })
});
},
@ -455,39 +449,46 @@
afterScan() {
this.resizeCollapse();
let str = ""
this.detailSource.forEach(detail => {
let s = '';
detail.Items.forEach(item => {
let totalHandleQty = 0;
var isHandleEmpty = false; // handleQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
if (batch.handleQty != 0) {
totalHandleQty = calc.add(totalHandleQty, batch
.handleQty)
} else {
isHandleEmpty = true;
}
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
var tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
tempHandleQty = 0
}
if (batch.qty != 0) {
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
})
})
})
if (item.qty == totalHandleQty) {
if (isHandleEmpty) {
return;
}
this.submit();
} else {
this.$refs.comMessage.showQuestionMessage('实际扫描数量【' + totalHandleQty +
'】与物料需求数量【' + item.qty +
'】不一致,是否继续提交', res => {
if (res) {
this.submit();
}else {
this.scanPopupGetFocus()
}
});
}
})
})
if (str) {
str = '任务明细未全部完成,是否提交?\n' + str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
this.$throttle(this.submit, 2000, this)()
} else {
this.scanPopupGetFocus()
}
});
} else {
//
this.$throttle(this.submit, 2000, this)()
}
},
scanPopupGetFocus() {

2
src/pages/issue/job/issueJob.vue

@ -194,6 +194,7 @@
this.fromInventoryStatuses = res.fromInventoryStatuses.split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.showErrorMessage(res.message)
}
@ -294,6 +295,7 @@
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
this.openScanPopup()
}
var list = res.data.list;

44
src/pages/issue/record/directIssue.vue

@ -5,10 +5,11 @@
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header_item">
来源库位 : {{fromLocationCode}}
<view class="header-view">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</view>
</view>
<view class='split_line'></view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
@ -16,9 +17,8 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false"
:isShowParentToLocation="false"
@updateData="updateData" @removePack="removePack">
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
@removePack="removePack">
</record-com-detail-card>
</view>
@ -45,9 +45,10 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> -->
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -98,6 +99,8 @@
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
// import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
export default {
components: {
@ -110,7 +113,8 @@
recordComDetailCard,
recordDetailCard,
balanceSelect,
winComScanBalance
winComScanBalance,
// balanceQuery
},
data() {
return {
@ -132,7 +136,7 @@
show: false,
positionInfo: "请选择生产线",
resultData: {},
itemCode:""
itemCode: ""
};
},
onLoad(option) {
@ -156,10 +160,14 @@
// }
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
// this.$refs.refBalanceQuery.showDrawer();
// this.closeScanPopup();
}
},
//
@ -170,7 +178,10 @@
mounted() {},
methods: {
// showDrawer() {
// this.$refs.showRight.open();
// },
getBusinessType() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
@ -183,7 +194,7 @@
}
});
},
getScanResult(result) {
this.setData(result);
},
@ -191,14 +202,14 @@
let balance = result.balance;
let label = result.label;
let pack = result.package;
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return;
}
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
@ -256,9 +267,6 @@
},
showErrorMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
@ -519,7 +527,7 @@
this.toWarehouseCode = '';
this.detailSource = [];
this.positionInfo = "请选择生产线";
this.itemCode=""
this.itemCode = ""
}
}
}

36
src/pages/login/index.vue

@ -65,13 +65,13 @@
</view>
</view>
<view style="display: flex;flex-direction: row;">
<view style="display: flex;flex-direction: row;" v-if="needCode">
<!-- <view class="uni-input">
<input class="" placeholder="请输入验证码"
v-model="code"
style="background-color: lightgray;padding-top: 40rpx;padding-bottom: 40rpx;margin-right: 20rpx;" />
</view> -->
<view class="uni-input-wrapper">
<view class="uni-input-wrapper" >
<input class="" style="height: 80rpx; background-color: #F7F9FF;margin-right: 20rpx;"
placeholder="请输入验证码" type="number" v-model="code" />
</view>
@ -119,7 +119,8 @@
imageSrc: "",
code: "",
uuid: "",
version: ""
version: "",
needCode:false
}
},
// computed: mapState(['forcedLogin', 'hasLogin']),
@ -185,13 +186,15 @@
icon: 'none',
mask: true
})
} else if (this.code === '') {
}
else if (this.needCode&&this.code === '') {
uni.showToast({
title: '验证码不能为空',
icon: 'none',
mask: true
})
} else {
}
else {
// console.log("", this.username, "", this.password, this.tapstyle, this.smloginmsg)
let logininfo = {
username: "",
@ -226,14 +229,21 @@
title: "正在登录",
mask: true
})
await this.$store.dispatch('Login', logininfo);
// await this.$store.dispatch('GetTenantIdInfo', this.tenantName)
uni.hideLoading()
uni.setStorageSync('hasLogin', true)
uni.switchTab({
url: '/pages/index/index'
});
uni.setStorageSync('username', this.username);
try{
var result = await this.$store.dispatch('Login', logininfo);
// await this.$store.dispatch('GetTenantIdInfo', this.tenantName)
console.log(result)
uni.hideLoading()
uni.setStorageSync('hasLogin', true)
uni.switchTab({
url: '/pages/index/index'
});
uni.setStorageSync('username', this.username);
}catch(e){
uni.hideLoading()
this.showErrorMessage(e)
}
},

4
src/pages/package/coms/comScanPackagePack.vue

@ -353,8 +353,10 @@ import { getDirectoryItemArray } from '@/common/directory';
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.calcBatchHandleQty(batch);
this.packGetFocus();
this.$emit('refresh');
setTimeout(res=>{
this.packGetFocus();
},100)
},
swipeClick(e, item, index) {

2
src/pages/package/record/splitPackageRecord.vue

@ -30,7 +30,7 @@
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="$throttle(commit,2000,this)()">提交</button>
</view>
</view>
</view>

134
src/pages/pointPutawayJob/index.vue

@ -26,7 +26,7 @@
<tr>
<td>供应商</td>
<td>{{item.supplierCode}}</td>
<td>批次</td>
<td>供应商批次</td>
<td>{{item.supplierBatch}}</td>
</tr>
<tr>
@ -35,6 +35,9 @@
<td>抽检数量</td>
<td>{{item.sampleQty}}</td>
</tr>
<tr v-if="!item.haveInspectionRequest">
<td colspan='4' style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</td>
</tr>
</tbody>
</table>
</view>
@ -76,6 +79,7 @@
</button>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -197,41 +201,83 @@
this.readFile(htmlFileUrl1, (htmlContent) => {
this.newHtmlContent1 = htmlContent
this.data1.inspectDTOList.forEach(item => {
str += `
<div class="box" style="page-break-before:always;"><br />
<div class="relative" >
<div class="q">Q</div>
<table border='1'>
<thead>
<tr class='top1'>
<th>物料代码:</th>
<th colspan='3'>${item.itemCode}</th>
</tr>
</thead>
<tbody>
<tr>
<td>物料名称</td>
<td>${item.itemName}</td>
<td>发货单号</td>
<td>${this.data1.asnNumber}</td>
</tr>
<tr>
<td>供应商</td>
<td>${item.supplierCode}</td>
<td>批次</td>
<td>${item.supplierBatch}</td>
</tr>
<tr>
<td>到货数量</td>
<td>${item.quantityQty}</td>
<td>抽检数量</td>
<td>${item.sampleQty}</td>
</tr>
</tbody>
</table>
if(!item.haveInspectionRequest){
str += `
<div class="box" style="page-break-before:always;"><br />
<div class="relative" >
<div class="q">Q</div>
<table border='1'>
<thead>
<tr class='top1'>
<th>物料代码:</th>
<th colspan='3'>${item.itemCode}</th>
</tr>
</thead>
<tbody>
<tr>
<td>物料名称</td>
<td>${item.itemName}</td>
<td>发货单号</td>
<td>${this.data1.asnNumber}</td>
</tr>
<tr>
<td>供应商</td>
<td>${item.supplierCode}</td>
<td>供应商批次</td>
<td>${item.supplierBatch}</td>
</tr>
<tr>
<td>到货数量</td>
<td>${item.quantityQty}</td>
<td>抽检数量</td>
<td>${item.sampleQty}</td>
</tr>
<tr>
<td colspan='4' style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
`
`
}else{
str += `
<div class="box" style="page-break-before:always;"><br />
<div class="relative" >
<div class="q">Q</div>
<table border='1'>
<thead>
<tr class='top1'>
<th>物料代码:</th>
<th colspan='3'>${item.itemCode}</th>
</tr>
</thead>
<tbody>
<tr>
<td>物料名称</td>
<td>${item.itemName}</td>
<td>发货单号</td>
<td>${this.data1.asnNumber}</td>
</tr>
<tr>
<td>供应商</td>
<td>${item.supplierCode}</td>
<td>供应商批次</td>
<td>${item.supplierBatch}</td>
</tr>
<tr>
<td>到货数量</td>
<td>${item.quantityQty}</td>
<td>抽检数量</td>
<td>${item.sampleQty}</td>
</tr>
</tbody>
</table>
</div>
</div>
`
}
})
this.newHtmlContent1 = this.newHtmlContent1.replace(
"mainBody", str); //
@ -268,7 +314,14 @@
this.showTableInspectDTOList = this.data1.inspectDTOList
}
console.log(233, this.showTableInspectDTOList)
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
},
watch: {
isLoadFinish: {
@ -306,14 +359,21 @@
await queryInspectionFreeFlag({
number: this.number
}).then(async res1 => {
console.log(444,res1)
this.data1 = res1.data
this.data1.inspectDTOList = this.data1.inspectDTOList.filter(item=>item.sampleQty>0)
// this.data1.inspectDTOList=[]
if(this.data1&&this.data1.inspectDTOList&&this.data1.inspectDTOList.length == 0){
this.tabIndex =2
}
this.getTableInspectDTOList()
})
.catch(error=>{
this.$refs.comMessage.showMessage(error, res => {
if (res) {
}
});
})
}
this.getPointPutawayJobHtml()

10
src/pages/productDismantle/job/productDismantleDetail.vue

@ -342,12 +342,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

10
src/pages/productPutaway/job/productPutawayDetail.vue

@ -404,12 +404,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

48
src/pages/productPutaway/record/productPutawayRecord.vue

@ -1,10 +1,10 @@
<template>
<view class="">
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="uni-flex uni-column" v-if="detailSource.length>0" style="height: calc(100vh - 44px);">
<view class="" style="flex: 1;">
<view class="page-wraper" v-if="detailSource.length>0" style="height: calc(100vh - 44px);">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
@ -30,9 +30,11 @@
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-button v-if="detailSource.length>0" @goScan='openScanPopup'></win-scan-button>
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
@ -142,7 +144,7 @@
},
methods: {
getScanResult(result) {
getScanResult(result) {
let label = result.label;
let pack = result.package;
result.balance.forEach(
@ -155,17 +157,14 @@
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
itemp.containerNumber = balance.parentPackingNumber
//
let newDetail = createDetailInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack);
newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail);
this.getRecommendLocation(balance, res => {
itemp.toLocationCode = res.code;
itemp.expectinNumber = res.expectinNumber;
this.detailSource.push(itemp)
this.$forceUpdate();
})
this.detailSource.push(itemp)
this.calcHandleQty();
this.getRecommendLocation(balance)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
@ -191,7 +190,7 @@
)
},
getRecommendLocation(balance, callback) {
getRecommendLocation(balance) {
uni.showLoading({
title: '扫描中...',
mask: true
@ -201,11 +200,21 @@
expectinNumber: balance.packingNumber + "-" + Date.now(),
itemCode: balance.itemCode,
inventoryStatus: balance.inventoryStatus,
batch: balance.batch
};
console.log(JSON.stringify(param))
getrecommendLocationExpectin(param).then(res => {
callback(res.data);
getrecommendLocationExpectin(param).then(result => {
uni.hideLoading();
let item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode && res.containerNumber == balance
.parentPackingNumber) {
return res
}
})
item.toLocationCode = result.data.code;
item.expectinNumber = result.data.expectinNumber;
this.$forceUpdate();
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
@ -277,7 +286,7 @@
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus();
@ -460,9 +469,8 @@
}
}
},
cancel()
{
cancel() {
this.clearData();
this.openScanPopup();
}

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

@ -302,12 +302,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.showMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount + "]总共[" + this.subList
.length +
"]");
this.showMessage("任务明细未全部完成,不允许部分提交!");
}
}

24
src/pages/productReceipt/job/productReceiptDetail.vue

@ -85,7 +85,8 @@
import {
goHome,
navigateBack,
getPackingNumberAndBatch,
getPackingNumberAndBatch,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
@ -334,18 +335,21 @@
});
},
commit() {
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
var valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate")
//
if(valiDate){
if (!this.checkLocation()) {
return
}
}else{
this.toLocationCode = this.jobToLocationCode
}
//
if (!this.checkLocation()) {
return
}
//
if (this.scanCount == this.subList.length) {
if (this.checkCount()) {
@ -378,8 +382,8 @@
var subItem = item.subList[i]
if (calc.sub(subItem.handleQty, subItem.qty) < 0) {
isCheck = false;
hint = "包装【" + subItem.packingNumber + "】实际收货数量:" + subItem.handleQty + "与包装数量" + subItem.qty +
"不相等,是否继续收货?"
hint = "包装【" + subItem.packingNumber + "】实际收货数量:[" + subItem.handleQty + "]与包装数量[" + subItem.qty +
"]不相等,是否继续收货?"
break
}
}

43
src/pages/productReceipt/job/scrapReceiptDetail.vue

@ -294,18 +294,41 @@
if (!this.checkLocation()) {
return
}
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.showMessage("任务明细未全部完成,是否提交");
}
}
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致`
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
})
})
if (str) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -314,22 +337,6 @@
} else {
this.submitJob()
}
// //
// if (this.scanCount == this.subList.length) {
// this.submitJob();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.submitJob();
// } else {
// //
// this.showMessage(',\n' + "[" + this.scanCount + "][" + this.subList
// .length +
// "]");
// }
// }
},
submitJob() {

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

@ -302,12 +302,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.showMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount + "]总共[" + this.subList
.length +
"]");
this.showMessage("任务明细未全部完成,不允许部分提交!");
}
}

52
src/pages/productRecycle/job/productRecycleJobDetail.vue

@ -318,17 +318,45 @@
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
// //
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致`
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
})
})
if (str) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -337,26 +365,6 @@
} else {
this.submitJob()
}
// //
// //
// if (this.scanCount == this.subList.length) {
// this.submitJob();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.submitJob();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(',\n' + "[" + this.scanCount +
// "][" + this
// .subList.length + "]", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
},
submitJob() {

57
src/pages/productionReceipt/job/productionReceiptDetail.vue

@ -217,28 +217,32 @@
},
autoCommit(){
//
var noCommitInfo=null
for (var i = 0; i < this.detailSource.length; i++) {
var sub =this.detailSource[i].subList
for(var j=0;j<sub.length;j++){
var item =sub[j]
if(item.qty!=item.handleQty){
noCommitInfo=item;
break;
}
}
}
//
if(noCommitInfo){
this.showQuestionMessage("扫描数量["+noCommitInfo.handleQty+"]任务数量["+noCommitInfo.qty+"]不一致,是否提交?",res=>{
if(res){
this.commit()
let str=""
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
}
})
}else {
//
this.commit()
})
if (str) {
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.$throttle(this.commit,2000,this)()
}
});
} else {
this.$throttle(this.commit,2000,this)()
}
},
//
@ -358,6 +362,7 @@
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
console.log("自动提交")
this.autoCommit();
} else {
this.scanPopupGetFocus();
@ -381,6 +386,7 @@
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
this.autoCommit();
}
}
@ -405,16 +411,20 @@
//
if (this.scanCount == this.subList.length) {
this.submitJob();
console.log("提交this.submitJob()")
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
console.log("提交this.submitJob()")
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
@ -462,7 +472,6 @@
this.showErrorMessage(error)
})
// var itemCodes = []
// this.detailSource.forEach(item => {
// itemCodes.push(item.itemCode)

5
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -373,6 +373,11 @@
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "status",
action: "in",
value: '1,2'
},
{
column: "batch",
action: "==",

10
src/pages/productionReturn/job/returnDetail.vue

@ -349,12 +349,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

8
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -454,16 +454,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage('还有未扫描的物料,是否继续提交?', res => {
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob();
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

52
src/pages/purchaseReturn/job/returnDetail.vue

@ -350,17 +350,45 @@
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
//
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致`
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
})
})
if (str) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -369,26 +397,6 @@
} else {
this.submitJob()
}
//
//
// if (this.scanCount == this.subList.length) {
// this.submitJob();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.submitJob();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(',\n' + "[" + this.scanCount +
// "][" + this
// .subList.length + "]", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
},
submitJob() {

10
src/pages/putaway/job/putawayDetail.vue

@ -452,12 +452,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

431
src/pages/putaway/job/quantityPutawayJob.vue

@ -0,0 +1,431 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-putaway-job-card :dataContent="item" @click='openJobDetail(item)'></com-putaway-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<putaway-info-popup ref='jobInfoPopup'></putaway-info-popup>
<putaway-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></putaway-job-list-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult'>
</winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import jobList from '@/mycomponents/jobList/jobList.vue'
import {
getPutawayJobList,
cancleTakePutawayJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comPutawayJobCard from '@/pages/putaway/coms/comPutawayJobCard.vue'
import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue'
import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import {
Exception
} from 'sass';
export default {
name: 'Putaway',
components: {
comEmptyView,
jobFilter,
comPutawayJobCard,
putawayJobListPopup,
putawayInfoPopup,
winScanButton,
winScanPackJob,
jobList
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
title: '',
scanMessage: ""
};
},
onLoad(option) {
this.title = option.title
},
onShow() {
this.getList('refresh');
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
methods: {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getPutawayJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
this.openScanPopup()
}
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
this.loadingType = "";
updateTitle(this.title);
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './putawayDetail?id=' + item.masterId + '&status=' + item.status + '&title=' + this.title
});
this.scanMessage = ""
},
showItemList(itemList) {
this.$refs.scanList.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.masterId);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakePutawayJob(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "放弃任务成功"
})
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getPutawayJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
if(this.$refs.scanPopup){
this.$refs.scanPopup.packLoseFocus()
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if(this.$refs.scanPopup){
this.$refs.scanPopup.packGetFocus()
}
}
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
uni.navigateTo({
url: './putawayDetail?id=' +
item.masterId +
'&status=' + item.status +
'&scaned=' + item.packingNumber +
'&title=' + this.title +
"&scanMessage=" + this.scanMessage
});
this.scanMessage = ""
},
getScanResult(result) {
try {
this.scanMessage = ""
var filters = [{
column: "packingNumber",
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "batch",
action: "==",
value: result.package.batch
},
// {
// column: "qty",
// action: "==",
// value: result.label.qty
// },
{
column: "itemCode",
action: "==",
value: result.package.itemCode
},
{
column: "status",
action: "in",
value: '1,2',
},
// {
// column: "accept_user_id",
// action: "==",
// value: this.$store.state.user.id
// }
// {
// column: "fromLocationCode",
// action: "==",
// value: result.label.fromLocationCode
// },
]
getPutawayJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
this.scanMessage = result.scanMessage
let resultList = res.data.list;
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length == 1) {
//
if (list[0].status == 1) {
this.selectItem(list[0])
} else if (list[0].status == 2) {
//
if (list[0].acceptUserId == this.$store.state.user.id) {
this.selectItem(list[0])
} else {
this.showMessage("该任务已经被[" + list[0].acceptUserName + "]承接" + "\n任务号[" +
list[0].number + "]扫描[" + result.scanMessage + "]")
}
} else if (list[0].status == 3) {
this.showMessage("该任务已经完成\n承接人[" + list[0].acceptUserName + "]\n任务号[" +
list[0].number + "]扫描[" + result.scanMessage + "]")
}
} else {
this.showMessage("查询到多条任务\n" + "扫描[" + result.scanMessage + "]")
}
} else {
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e + "\n扫描[" + result.scanMessage + "]")
}
},
}
}
</script>
<style scoped lang="scss">
</style>

604
src/pages/putaway/job/quantityPutawayJobDetail.vue

@ -0,0 +1,604 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<view class="header_item">
申请单号 : {{jobContent.requestNumber}}
</view>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comJobDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
:isShowStatus="false" @remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList'>
</comJobDetailCard>
</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="">
<locationCompare ref='comScanLocation' title="目标库位" :recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode' :isShowEdit="isCheckLocation"
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<!-- <winScanPackAndLocationNoBalance ref="scanPopup" @getResult='getScanResult' :allowNullBalance="true">
</winScanPackAndLocationNoBalance> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="false" ref="scanPopup" @getResult='getScanResult'
:noShowBalanceMessage="true">
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getManagementPrecisions,
} from '@/common/balance.js';
import {
getPutawayJobDetail,
putawayJobSubmit,
takePutawayJob,
cancleTakePutawayJob,
getSwitchByCode
} from '@/api/request2.js';
import {
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
navigateBack,
compareAsc,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
getDirectoryItemArray,
getInventoryStatusName
} from '@/common/directory.js';
import {
getTreeDataSource,
calcHandleQty,
calcTreeHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comJobDetailCard from "@/mycomponents/detail/comJobDetailCard.vue"
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
components: {
winScanButton,
winScanPackAndLocation,
locationCompare,
comJobDetailCard,
jobTop
},
data() {
return {
id: '',
scanCount: 0,
jobContent: {}, //
subList: [], //subList
detailSource: [], //
managementList: [],
fromLocationCode: "",
toLocationCode: "",
toLocationAreaTypeList: [],
jobStatus: "",
jobToLocationCode: "",
isCheckLocation: false,
scanMessage: ""
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
})
this.id = option.id;
this.scanMessage = option.scanMessage
if (this.id != undefined) {
//
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == "2") {
//
cancleTakePutawayJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
//
receive(callback) {
if (this.id != null) {
takePutawayJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getPutawayJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getTreeDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.jobToLocationCode = that.subList[0].toLocationCode;
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.isCheckLocation = getSwitchInfoByCode("PurchasePutawayToLocationCodeValidate")
if (that.isCheckLocation) {
that.toLocationCode = ""
} else {
that.toLocationCode = that.jobToLocationCode;
}
//
if (this.scanMessage) {
this.openScanPopupSimulate(this.scanMessage)
}
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
this.scanCount = items != null ? items.length : 0;
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
}
},
calcHandleQty() {
calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate();
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
updateData() {
console.log("updateData")
// this.calcHandleQty();
calcTreeHandleQty(this.detailSource)
},
//
openScanPopupSimulate(message) {
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
fromlocationCode = l.fromLocationCode;
}
})
}
this.$refs.scanPopup.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, this.jobContent,
message);
},
openScanPopup() {
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var locationCode = result.fromLocationCode;
if (!result.balance) {
this.showMessage("箱码【" + packingNumber + "】没有库存余额")
return;
}
// var inventoryStatus = "OK";
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode
})
if (itemDetail == undefined) {
var isExit;
for (let subItem of detail.subList) {
var item;
for (let pack of subItem.packList) {
if (pack.packingNumber == packingNumber &&
pack.batch == batch) {
item = pack;
isExit = pack;
break;
}
}
if (item != undefined) {
subItem.scaned = true
subItem.handleQty = 0;
item = undefined
}
}
if (isExit == undefined) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】不在列表中")
} else {
if (!isExit.cancleScanedHiht && isExit.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
isExit.scaned = true
let qty = 0;
if (result.balance != null) {
qty = Number(result.balance.qty);
} else {
qty = Number(result.label.qty);
}
isExit.handleQty = Number(result.label.qty);
isExit.toLocationCode = this.toLocationCode;
}
}
calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
} else {
var scanedLength = 0;
itemDetail.packList.forEach(res => {
if (res.scaned) {
scanedLength++;
}
})
//
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList
.length) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = result.label.qty;
// itemDetail.toInventoryStatus = "OK"
itemDetail.packList.forEach(pac => {
pac.scaned = true
pac.handleQty = Number(pac.qty);
pac.toLocationCode = this.toLocationCode;
})
calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
}
}
} catch (e) {
this.showMessage(e.message)
}
},
scanLocationCode(location, code) {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
},
openDetail(item) {
this.$refs.jobDetailPopup.openPopup(item)
},
checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})
return isPass = false;
}
return isPass;
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
if (!this.checkLocation()) {
return
}
//
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
putawayJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成采购上架记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
detail.toContainerNumber = '';
detail.singlePrice = 1;
detail.amount = 11;
detail.arriveDate = getCurrDateTime();
detail.produceDate = getCurrDateTime();
detail.expireDate = getCurrDateTime();
let packList = detail.packList.filter(p => p.scaned == true);
detail.packList = packList;
// detail.singlePrice = detail.balance.singlePrice;
// detail.amount = detail.balance.singlePrice * detail.handleQty;
// detail.arriveDate = detail.balance.arriveDate;
// detail.produceDate = detail.balance.produceDate;
// detail.expireDate = detail.balance.expireDate;
subList.push(detail)
}
})
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
scanPopupGetFocus() {
this.$refs.scanPopup.packGetFocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.packLoseFocus();
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
}
}
</script>
<style scoped lang="scss">
</style>

51
src/pages/scrap/job/scrapJobDetail.vue

@ -288,18 +288,44 @@
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致`
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
})
})
if (str) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -308,25 +334,6 @@
} else {
this.submitJob()
}
// //
// if (this.scanCount == this.subList.length) {
// this.submitJob();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.submitJob();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(',\n' + "[" + this.scanCount +
// "][" + this
// .subList.length + "]", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
},
submitJob() {

10
src/pages/transfer/job/issueDetail.vue

@ -333,12 +333,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

11
src/pages/transfer/job/receiptDetail.vue

@ -358,13 +358,14 @@
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

12
src/pages/transfer/job/transferDetail.vue

@ -12,7 +12,7 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData"
<comInventoryDetailCard :allowEditQty="true" :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData'>
</comInventoryDetailCard>
</view>
@ -368,13 +368,15 @@
async commit() {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
this.scanCount = this.getScanCount();
if (this.scanCount < this.subList.length) {
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

50
src/pages/unPlanned/job/issueJobDetail.vue

@ -280,17 +280,44 @@
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
str += `包装号【${cur.packingNumber}】提交数量【${cur.handleQty}】与任务物料数量【${cur.qty}】不一致`
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
})
})
if (str) {
str += ',是否确认提交?'
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -299,25 +326,6 @@
} else {
this.submitJob()
}
// //
// if (this.scanCount == this.subList.length) {
// this.submitJob();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.submitJob();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(',\n' + "[" + this.scanCount +
// "][" + this
// .subList.length + "]", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
},

10
src/pages/unPlanned/job/receiptJobDetail.vue

@ -261,12 +261,14 @@
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob();
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}

12
src/store/modules/user.js

@ -59,16 +59,14 @@ const user = {
storage.setStorage(storage.constant.token,res.accessToken)
resolve(res)
}else {
uni.showToast({
title:res.msg
})
if(res.msg){
reject(res.msg)
}else {
reject("登录失败")
}
}
}).catch(error => {
reject(error)
uni.showToast({
title:error
})
})
})
},

8
src/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue

@ -16,9 +16,10 @@
<view class="uni-pagination__btn"
:class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === 1 ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickLeft">
:hover-stay-time="70" @click="clickLeft"
style="margin-right: 70rpx;">
<template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="left" />
<uni-icons color="#666" size="16" type="left" />
</template>
<template v-else>
<text class="uni-pagination__child-btn">{{ prevPageText }}</text>
@ -41,7 +42,8 @@
<view class="uni-pagination__btn"
:class="currentIndex >= maxPage ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === maxPage ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickRight">
:hover-stay-time="70" @click="clickRight"
style="margin-left: 70rpx;">
<template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="right" />
</template>

Loading…
Cancel
Save