Browse Source

发料申请

wms3.0_pda
lijuncheng 10 months ago
parent
commit
eb6aab6bab
  1. 19
      api/request2.js
  2. 1
      mycomponents/detail/comDetailCard.vue
  3. 105
      mycomponents/popup/selectList.vue
  4. 7
      pages.json
  5. 92
      pages/issue/coms/comIssueRequestCreator.vue
  6. 227
      pages/issue/coms/comIssueRequestPopup.vue
  7. 2
      pages/issue/request/issueRequest.vue
  8. 177
      pages/issue/request/issueRequestSubmit.vue
  9. 1
      static/search.svg

19
api/request2.js

@ -347,6 +347,21 @@ export function getItempackagingByItemcode(itemCode) {
});
}
/**
* 查询生产线物料关系
* @param {*} productionLineCode 生产线code
*
*/
export function getProductionlineItem(params) {
return request({
url: baseApi + "/wms/productionlineitem/page" ,
method: "get",
data: params,
});
}
/**
* 供应商发货
@ -1918,8 +1933,8 @@ export function getIssueRequestDetail(id) {
*/
export function issueRequestSubmit(params) {
return request({
url: baseApi + "/wms/purchasereturn-request-main/submit",
method: "put",
url: baseApi + "/wms/issue-request-main/create",
method: "post",
data: params,
});
}

1
mycomponents/detail/comDetailCard.vue

@ -15,6 +15,7 @@
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line />
</view>
</uni-collapse-item>
</uni-collapse>

105
mycomponents/popup/selectList.vue

@ -0,0 +1,105 @@
<template>
<uni-popup ref="popupItems">
<com-popup @onClose="closePopup">
<view class="">
<view class="uni-center" style="font-size: 40rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
选择零件
</view>
<u-line/>
<view style="margin: 20rpx;" v-for="(item, index) in showList" :key="index" >
<view class="" style="padding: 10rpx;" @click="selectItem(item)">
零件: {{item.itemCode}}
</view>
<u-line/>
</view>
</view>
<view class="flex uni-center" style="width: 100%;justify-content: center;margin-top: 10rpx;margin-bottom: 10rpx;" >
<view class="">
当前页{{ pageCurrent }}数据总量{{ total }}每页数据{{ pageSize }}
</view>
</view>
<view class="">
<uni-pagination :page-size="pageSize" :current="pageCurrent" :total="total" @change="change" />
</view>
</com-popup>
</uni-popup>
</template>
<script>
import {
getProductionlineItem
} from '@/api/request2.js';
import comPopup from '@/mycomponents/common/comPopup.vue'
export default {
emits: ["selectedItem"],
components: {
comPopup,
},
props: {
},
data() {
return {
showList: [],
pageCurrent:1,
pageSize:10,
total:0
}
},
methods: {
queryList(lineCode){
var params = {
productionLineCode: lineCode,
pageNo: this.pageCurrent,
pageSize: this.pageSize
}
getProductionlineItem(params).then(res => {
if (res.data != null && res.data.list.length > 0) {
this.showList = res.data.list;
this.total =res.data.total;
this.$refs['popupItems'].open("center");
} else {
//线
// this.showErrorMessage('线' + lineCode + '');
this.$refs['popupItems'].open("center");
}
}).catch(error => {
// this.showErrorMessage(error);
})
},
openPopup(items) {
this.showList = items;
this.$refs['popupItems'].open("center");
},
closePopup() {
this.$refs.popupItems.close()
},
selectItem(item) {
this.$emit("selectedItem", item);
this.$refs['popupItems'].close();
},
change(e){
this.pageCurrent = e.current
console.log("分页",e.current)
}
}
}
</script>
<style>
.fixed-bottom {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
padding: 10px 0;
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}
</style>

7
pages.json

@ -498,6 +498,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/issue/request/issueRequestSubmit",
"style": {
"navigationBarTitleText": "创建发料申请",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productionReturn/job/returnJob",

92
pages/issue/coms/comIssueRequestCreator.vue

@ -0,0 +1,92 @@
<template>
<view class="">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<view class="" style="font-size: 32rpx;">
<view class="" >
车间代码 : {{dataContent.workShopCode}}
</view>
<view class="" >
车间名称 :
</view>
<view class="">
生产线代码 :{{dataContent.productionLineCode}}
</view>
<view class="">
工位代码 :{{dataContent.workStationCode}}
</view>
</view>
</template>
<u-line />
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item>
<view class="" style="font-size: 32rpx;margin: 10rpx;">
<view class="">
物品代码 : {{item.itemCode}}
</view>
<view class="">
物品名称 : {{item.itemName}}
</view>
<view class="uni-flex uni-row uni-center">
<view class="">
数量 : {{item.qty}} 单位 :
</view>
<view class="">
<uom :uom="item.uom"></uom>
</view>
</view>
</view>
</uni-swipe-action-item>
<u-line />
</view>
</uni-swipe-action>
</uni-collapse-item>
</uni-collapse>
</view>
</template>
<script>
import uom from '@/mycomponents/qty/uom.vue'
export default {
components: {
uom
},
data() {
return {
}
},
props: {
dataContent: {
type: Object,
default: {}
},
},
methods: {
update(){
this.$nextTick(r => {
this.$refs.collapse.resize()
});
}
}
}
</script>
<style>
</style>

227
pages/issue/coms/comIssueRequestPopup.vue

@ -16,15 +16,11 @@
<view class="uni-flex uni-row padding title u-col-center">
<text>位置 : </text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<!-- <input class="uni-input" v-model="toLocationCode" placeholder="请输入需求库位"
:disabled="locationDisable" :focus="locationFocus" @confirm="locationConfirm"
@blur='locationFocus = false' /> -->
<view class="">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="list"
@confirm="confirmSelect"></u-select>
</view>
</view>
@ -33,16 +29,20 @@
<view class="uni-flex uni-row padding title u-col-center">
<text>零件 : </text>
<view class="uni-flex u-col-center uni-row">
<input class="" v-model="itemCode" placeholder="请输入需求零件"
:focus="itemCodeFocus" @blur='itemCodeFocus = false'
@confirm="itemCodeConfirm" />
<u-input v-model="itemCode" :focus="itemCodeFocus" :border="true"
placeholder="请输入需求零件" @confirm="itemCodeConfirm" />
<image src="/static/search.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 10rpx;" @click="itemCodeClick">
</image>
</view>
</view>
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
@ -60,14 +60,17 @@
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
<selectList ref='selectList' @selectedItem="selectedItem"></selectList>
</view>
</template>
<script>
import {
getBasicLocationByCode,
getBasicItemByCode
getBasicItemByCode,
getProductionlineItem
} from '@/api/request2.js';
import {
getLocationTypeName,
@ -77,31 +80,36 @@
import uom from '@/mycomponents/qty/uom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import selectList from '@/mycomponents/popup/selectList.vue'
export default {
components: {
uom,
balanceStatus,
comMessage
comMessage,
selectList
},
data() {
return {
// toLocationCode: 'SFG',
// itemCode: 'CE115F11161AG',
toLocationCode: '',
workShopCode: "",
productionLineCode: "",
workStationCode: "",
itemCode: '',
itemName: "",
qty: 0,
locationFocus: true,
itemCodeFocus: false,
locationDisable: false,
requestInfo: null,
locationTypeList: [],
isCheckLocation: false,
itemCodeList: [],
isCheckItemCode: false,
counQty: 0,
editPosition: true,
numberFocus: false,
uom: "",
positionInfo: "请选择位置",
show: false,
isModifiedPosition: true,
list: [{
value: 1,
label: '车间1',
@ -159,7 +167,7 @@
value: 10,
label: '工位2'
}
]
]
},
@ -175,30 +183,17 @@
},
},
methods: {
openRequestPopup(requestInfo) {
if (requestInfo != undefined) {
this.requestInfo = requestInfo;
this.toLocationCode = requestInfo.toLocationCode;
// this.itemCode = requestInfo.Items[0].itemCode;
// this.qty = requestInfo.Items[0].qty;
this.itemCode = '';
this.qty = 0;
this.locationDisable = true;
this.itemCodeGetFocus();
openRequestPopup(editPosition) {
this.editPosition = editPosition;
if (this.isModifiedPosition) {
this.isModifiedPosition = false
} else {
this.toLocationCode = ''
this.itemCode = ''
this.qty = 0
this.locationFocus = true
this.itemCodeFocus = false
this.locationDisable = false
this.requestInfo = null
this.locationTypeList = []
this.isCheckLocation = false
this.isCheckItemCode = false
this.counQty = 0
this.itemCode = "";
this.uom = ""
this.qty = 0
this.itemCodeGetFocus();
}
this.$refs.popup.open('bottom')
},
closeRequestPopup() {
@ -207,108 +202,55 @@
locationConfirm() {
//
this.checkLocatioCode();
},
itemCodeClick() {
if (this.positionInfo == "请选择位置") {
this.showErrorMessage("请先选择位置")
return
}
this.$refs.selectList.queryList("111dsda")
// this.refs.selectList
// this.getItemCodeListByProLine("111")
},
itemCodeGetFocus() {
this.itemCodeFocus = true;
},
itemCodeLoseFocus() {
this.itemCodeFocus = false;
},
locationCodeGetFocus() {
this.locationFocus = true;
},
locationCodeLoseFocus() {
this.locationFocus = false;
selectedItem(item) {
this.itemCode = item.itemCode;
this.checkItemCode();
},
confirm() {
if (this.requestInfo != null) {
let item = this.requestInfo.Items.find(r => r.itemCode == this.itemCode)
if (item != undefined) {
if (this.requestInfo.qty == item.qty) {
this.$refs.comMessage.showMessage('零件【' + this.itemCode + '】的需求信息已存在, 请重新输入零件及数量',
res => {
this.itemCode = '';
this.qty = 0;
this.uom = ""
this.itemCodeGetFocus();
});
} else {
this.$refs.comMessage.showQuestionMessage('已经有零件【' + this.itemCode + '】的需求信息, 是否要修改零件的需求数量?',
res => {
if (res) {
this.callback('update');
}
});
}
}
} else {
// if (this.toLocationCode == "" || !this.isCheckLocation) {
// this.showErrorMessage("", "location")
// return
// }
if (this.itemCode == "" || !this.isCheckItemCode) {
this.showErrorMessage("请输入零件", "itemCode")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
}
this.callback('add');
if (this.itemCode == "" || !this.isCheckItemCode) {
this.showErrorMessage("请输入零件", "itemCode")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
}
},
checkLocatioCode() {
getBasicLocationByCode(this.toLocationCode).then(res => {
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.Type;
var available = result.available;
if (available == 1) {
if (checkDirectoryItemExist(this.locationTypeList, type)) {
this.toLocationCode = result.Code;
this.isCheckLocation = true
this.itemCodeGetFocus();
} else {
var hint = getListLocationTypeDesc(this.locationTypeList);
this.showErrorMessage("扫描库位[" + this.toLocationCode + "]是[" +
getLocationTypeName(type) + "],需要的库位类型是[" + hint + "]", "location")
}
} else {
this.showErrorMessage("扫描库位[" + this.toLocationCode + "]不可用", "location")
}
} else {
this.showErrorMessage('未查询到库位[' + this.toLocationCode + ']', "location")
this.callback('add');
}
uni.hideLoading();
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error, "location")
})
},
checkItemCode() {
//
getBasicItemByCode(this.itemCode).then(res => {
uni.hideLoading();
if(res.data==null){
if (res.data != null && res.data.list.length > 0) {
this.itemCode = res.data.list[0].code;
this.itemName = res.data.list[0].name
this.isCheckItemCode = true;
this.numberFocus = true
this.uom = res.data.list[0].uom
} else {
this.showErrorMessage('未查找到零件【' + this.itemCode + '】', "itemCode");
}else {
if(res.data.list.length>0){
this.itemCode = res.data.list[0].code;
this.isCheckItemCode = true;
this.numberFocus = true
this.uom = res.data.list[0].uom
}else {
this.showErrorMessage('未查找到零件【' + this.itemCode + '】', "itemCode");
}
}
}).catch(error => {
uni.hideLoading();
@ -319,32 +261,29 @@
callback(action) {
let item = {
toLocationCode: this.toLocationCode,
positionInfo: this.positionInfo,
workShopCode: this.workShopCode,
productionLineCode: this.productionLineCode,
workStationCode: this.workStationCode,
itemCode: this.itemCode,
itemName: this.itemName,
uom: this.uom,
qty: this.qty
};
this.closeRequestPopup();
this.$emit("confirm", action, item);
},
cancel() {
this.closeRequestPopup();
},
showErrorMessage(message, type) {
setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => {
if (type == "location") {
this.locationCodeGetFocus();
} else if (type == "itemCode") {
if (type == "itemCode") {
this.itemCodeGetFocus();
} else {
this.numberFocus = true;
}
})
if (type == "location") {
this.toLocationCode = ""
this.isCheckLocation = false
} else if (type == "itemCode") {
if (type == "itemCode") {
this.itemCode = ""
this.isCheckItemCode = false;
}
@ -357,14 +296,34 @@
this.qty = value;
},
cancel(e) {
console.log("取消", e)
this.closeRequestPopup();
},
showSelect() {
this.show = true
if (this.editPosition) {
this.show = true
}
},
confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
console.log(e);
// this.productionLineCode =e[1].label;
// this.getItemCodeListByProLine(lineCode)
this.workShopCode = e[0].label
this.productionLineCode = e[1].label
this.workStationCode = e[2].label
},
getItemCodeListByProLine(lineCode) {
getProductionlineItem(lineCode).then(res => {
if (res.data != null && res.data.list.length > 0) {
this.$refs.selectList.openPopup(res.data.list)
} else {
//线
this.showErrorMessage('未查找到生产线【' + lineCode + '】对应的零件', "itemCode");
}
}).catch(error => {
this.showErrorMessage(error, "itemCode");
})
}

2
pages/issue/request/issueRequest.vue

@ -194,7 +194,7 @@
openScanDetailPopup() {
uni.navigateTo({
url: "../record/issueRecord?fromType=" + this.fromType
url: "../request/issueRequestSubmit?fromType=" + this.fromType
})
},

177
pages/issue/request/issueRequestSubmit.vue

@ -0,0 +1,177 @@
<template>
<view class="page-wraper">
<view class="" v-if='detailSource.subList.length==0'>
<com-blank-view @goScan='goScan(true)'></com-blank-view>
</view>
<view v-else class="page-wraper">
<view class="page-main">
<comIssueRequestCreator ref="issueRequest" :dataContent="detailSource">
</comIssueRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</div>
<com-scan-issue-pack ref="comScanIssuePack" >
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage>
</view>
</view>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup>
</template>
<script>
import {
issueRequestSubmit,
issueRecordSubmit
} from '@/api/request2.js';
import {
goHome,
updateTitle,
getRemoveOption,
getISODateTime
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comIssueRequestPopup from '@/pages/issue/coms/comIssueRequestPopup.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
export default {
name: 'issueRequestSubmit',
components: {
comBlankView,
comIssueRequestPopup,
jobDetailPopup,
comScanIssuePack,
comMessage,
comIssueRequestCreator
},
data() {
return {
jobContent: {}, //
subList: [], //subList
detailSource: {
subList: []
}, //
detailOptions: [],
scanOptions: [],
requestList: [], //
}
},
mounted() {
this.goScan(true)
},
onLoad(option) {
},
methods: {
goScan(editPosition) {
this.$refs.comIssueRequestPopup.openRequestPopup(editPosition);
},
//
requestConfirm(action, item) {
if (this.detailSource.subList.length == 0) {
this.detailSource = {
workShopCode: item.workShopCode,
productionLineCode:item.productionLineCode,
workStationCode:item.workStationCode,
subList: []
}
var subItem = {
productionLineCode: item.productionLineCode,
workStationCode: item.workStationCode,
itemCode: item.itemCode,
itemName: item.itemName,
qty: item.qty,
uom: item.uom
}
this.detailSource.subList.push(subItem)
} else {
var result = this.detailSource.subList.filter(res => {
if (res.itemCode == item.itemCode) {
return res
}
})
//
if (result.length == 0) {
var subItem = {
productionLineCode: item.productionLineCode,
workStationCode: item.workStationCode,
itemCode: item.itemCode,
itemName: item.itemName,
qty: item.qty,
uom: item.uom
}
this.detailSource.subList.push(subItem)
} else {
//
result[0].qty += item.qty
}
this.$refs.issueRequest.update()
}
},
setParams() {
return this.detailSource
},
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
// issueRequestSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data)
// } else {
// this.showErrorMessage("" + res.msg)
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateTo({
url: './issueRequest'
})
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
}
}
</script>
<style>
</style>

1
static/search.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1701072244680" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4277" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1024 963.7L756.8 696.5c60.2-73.6 96.5-167.5 96.5-269.8C853.3 191.4 661.9 0 426.7 0S0 191.4 0 426.7s191.4 426.7 426.7 426.7c102.3 0 196.3-36.3 269.8-96.5L963.7 1024l60.3-60.3zM426.7 768C238.5 768 85.3 614.9 85.3 426.7S238.5 85.3 426.7 85.3 768 238.5 768 426.7 614.9 768 426.7 768z" fill="#333333" p-id="4278"></path></svg>

After

Width:  |  Height:  |  Size: 655 B

Loading…
Cancel
Save