Browse Source

修改补料任务

hella_online_20240829
niexiting 4 months ago
parent
commit
dca73faa4c
  1. 11
      .env.development
  2. 6
      src/manifest.json
  3. 242
      src/pages/repleinsh/job/repleinshJob.vue

11
.env.development

@ -1,11 +1,12 @@
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
VITE_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=true
VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90'

6
src/manifest.json

@ -1,10 +1,10 @@
{
"name" : "wms",
"package":"uni.UNI43932FE",
"package" : "uni.UNI43932FE",
"appid" : "__UNI__C9CF4BF",
"description" : "",
"versionName" : "1.0.42",
"versionCode" : 42,
"versionName" : "1.0.44",
"versionCode" : 44,
"transformPx" : false,
/* 5+App */
"app-plus" : {

242
src/pages/repleinsh/job/repleinshJob.vue

@ -11,7 +11,8 @@
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions"
@click="swipeClick($event,item)">
<com-repleinsh-job-card :dataContent="item" @click='openJobDetail(item)'></com-repleinsh-job-card>
<com-repleinsh-job-card :dataContent="item"
@click='openJobDetail(item)'></com-repleinsh-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
@ -19,20 +20,21 @@
<repleinsh-info-popup ref='jobInfoPopup'></repleinsh-info-popup>
<repleinsh-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></repleinsh-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>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> -->
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getRepleinshJobList,
cancleTakeRepleinshJob,
closeTakeRepleinshJob
closeTakeRepleinshJob,
} from '@/api/request2.js';
import {
@ -40,6 +42,10 @@
updateTitle
} from '@/common/basic.js';
import {
getBusinessType
} from '@/common/record.js';
import {
getDetailOption,
getDetailGiveupOption,
@ -54,7 +60,8 @@
import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
export default {
name: 'repleinsh',
components: {
@ -65,6 +72,7 @@
repleinshInfoPopup,
winScanPackJob,
winScanButton,
winComScanBalance
},
data() {
return {
@ -80,12 +88,18 @@
detailOptions: [],
detailGiveupOptions: [],
detailCloseOptions: [],
title:'',
scanMessage:""
title: '',
scanMessage: "",
businessTypeCode: "Repleinment",
businessType: null,
scanBalance: {},
inInventoryStatus: "", //
outInventoryStatus: "", //
};
},
onLoad(option){
onLoad(option) {
this.title = option.title
this.getBusinessTypeFunc()
},
onShow() {
@ -128,14 +142,26 @@
},
methods: {
getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
getList(type, fromLocationCode = '') {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
@ -150,13 +176,13 @@
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
@ -183,10 +209,10 @@
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")");
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
@ -194,7 +220,7 @@
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
@ -210,11 +236,12 @@
this.getList('refresh', fromLocationCode, '')
},
openJobDetail(item,scanMessage = '') {
openJobDetail(item, scanMessage) {
uni.navigateTo({
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' + scanMessage +'&title='+this.title
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' +
scanMessage + '&title=' + this.title
});
this.scanMessage=""
this.scanMessage = ""
},
showItemList(itemList) {
@ -235,13 +262,13 @@
this.cancleJob(dataContent.masterId);
}
});
}else if (e.content.text == "关闭") {
} else if (e.content.text == "关闭") {
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?",
res => {
if (res) {
this.closeJob(dataContent.masterId);
}
});
res => {
if (res) {
this.closeJob(dataContent.masterId);
}
});
}
},
@ -251,12 +278,12 @@
cancleJob(id) {
cancleTakeRepleinshJob(id).then(res => {
if(res.data){
if (res.data) {
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
title: "放弃任务成功"
})
}else {
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
@ -268,15 +295,15 @@
title: "加载中....",
mask: true
});
closeTakeRepleinshJob(id).then(res => {
uni.hideLoading()
if(res.data){
if (res.data) {
this.getList("refresh")
uni.showToast({
title:"关闭任务成功"
title: "关闭任务成功"
})
}else {
} else {
this.showMessage("关闭任务失败")
}
}).catch(error => {
@ -321,7 +348,7 @@
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
@ -333,7 +360,7 @@
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的补料任务');
} else {
} else {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
@ -350,78 +377,95 @@
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
if (this.businessType == null) {
this.getBusinessTypeFunc()
} else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item,this.scanMessage);
this.openJobDetail(item, this.scanMessage);
},
getScanResult(result) {
this.scanMessage=""
if(!result.label.batch){
this.showMessage("批次为空")
return;
}
if(!result.label.itemCode){
this.showMessage("物料号为空")
return;
}
try {
var filters = [
{
column: "status",
action: "in",
value: '1,2'
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
{
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
}
]
getRepleinshJobList({
filters: filters,
pageNo: 1,
pageSize: 1000,
sort: 'createTime',
by: 'asc'
}).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)
let balance = result.balance;
if (balance != null) {
this.scanMessage = ""
if (!result.label.batch) {
this.showMessage("批次为空")
return;
}
if (!result.label.itemCode) {
this.showMessage("物料号为空")
return;
}
try {
var filters = [{
column: "status",
action: "in",
value: '1,2'
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
{
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
},
{
column: "fromLocationCode",
action: "==",
value: balance.locationCode
}
]
getRepleinshJobList({
filters: filters,
pageNo: 1,
pageSize: 1000,
sort: 'createTime',
by: 'asc'
}).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 > 0) {
this.selectItem(list[0])
}
})
if(list.length >0){
this.selectItem(list[0])
} else {
this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch +
']未查找到任务<br>' + "扫描[" + result.scanMessage + "]")
}
} else {
this.showMessage("物料号["+result.label.itemCode+"]批次["+result.label.batch+']未查找到任务<br>'+"扫描["+result.scanMessage+"]")
}
}).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]")
})
} catch (e) {
this.showMessage(e.message)
}).catch(error => {
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
}
// else
// {
// this.showMessage(error + "<br>[" + result.scanMessage + "]")
// }
},
}
}
@ -429,4 +473,4 @@
<style scoped lang="scss">
</style>
</style>
Loading…
Cancel
Save