Browse Source

修改生产退料申请

wms3.0_pda
lijuncheng 12 months ago
parent
commit
8383164ef9
  1. 407
      pages/productionReturn/coms/comReturnCommonRequest.vue
  2. 13
      pages/productionReturn/coms/comReturnRequestCreator.vue
  3. 363
      pages/productionReturn/request/returnToHoldRequest.vue
  4. 363
      pages/productionReturn/request/returnToStoreRequest.vue
  5. 24
      pages/productionReturn/request/returnToStoreRequestSubmit.vue

407
pages/productionReturn/coms/comReturnCommonRequest.vue

@ -0,0 +1,407 @@
<template>
<view>
<com-empty-view v-if="requestList.length==0"></com-empty-view>
<request-filter ref="filter" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber"
:checkedWaitTask="checkedWaitTask">
</request-filter>
<view v-if="requestList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in requestList" :key="index">
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event,item)">
<com-return-request-card :dataContent="item" @click='openRequestDetail(item)'>
</com-return-request-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<uni-load-more :status="loadingType" />
<request-info-popup ref='requestInfoPopup'></request-info-popup>
</view>
<requestButton @goScan='openScanDetailPopup'></requestButton>
</view>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import requestFilter from '@/mycomponents/request/requestFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestCard from '@/pages/productionReturn/coms/comReturnRequestCard.vue'
import requestInfoPopup from '@/pages/productionReturn/coms/requestInfoPopup.vue'
import requestButton from '@/mycomponents/button/requestButton.vue'
import {
getBusinessType,
} from '@/common/record.js';
import {
getProductionReturnRequestList,
productionReturnRequestHandle,
productionReturnRequestSubmitApprove,
productionReturnRequestSubmitApproveAgree,
productionReturnRequestSubmitApproveRefused,
productionReturnRequestClose
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailAndApproveOption,
getDetailAndApprovePassAndApproveNoOption,
getDetailAndHandleOption,
getDetailAndCloseOption
} from '@/common/array.js';
export default {
components: {
comEmptyView,
requestFilter,
requiredLocation,
comMessage,
comReturnRequestCard,
requestInfoPopup,
requestButton,
},
data() {
return {
requestList: [],
pageNo: 1,
pageSize: 10,
status: "",
totalCount: 0,
checkedWaitTask: false,
detailOptions: [],
detailAndApproveOptions: [],
detailAndApprovePassAndApproveNoOption: [],
detailAndHandleOption: [],
detailAndCloseOption: [],
showOptions: [],
loadingType: "nomore",
title:"",
fromType:""
};
},
props: {
businessType: {
type: String,
default: ''
},
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
mounted() {
this.detailOptions = getDetailOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndCloseOption = getDetailAndCloseOption()
this.updateTitle();
this.getList('refresh');
},
methods: {
updateTitle() {
if (this.businessType == 'ReturnToStore') {
this.title = "生产合格退料申请"
this.fromType ="ReturnToStore"
} else if (this.businessType == 'ReturnToHold') {
this.title = "生产隔离退料申请"
this.fromType ="ReturnToHold"
}
updateTitle(this.title)
},
onShow(){
this.getList('refresh');
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
openRequestInfoPopup(item) {
this.$refs.requestInfoPopup.openPopup(item)
},
openRequestDetail(item) {
uni.navigateTo({
url: './requestDetail?id=' + item.id
});
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.requestList = [];
}
var filters = []
if (this.checkedWaitTask) {
filters.push({
column: "status",
action: "==",
value: this.status
})
}
filters.push({
column: "business_type",
action: "==",
value: this.businessType
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getProductionReturnRequestList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(res => {
var options = this.updateOptions(res.status);
res.options = options;
})
this.requestList = type === "refresh" ? list : this.requestList.concat(list);
this.pageNo++;
updateTitle(this.title+"("+this.totalCount + ")")
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle(this.title)
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
updateOptions(status) {
if (status == "1") {
this.showOptions = this.detailAndApproveOptions;
} else if (status == "2") {
this.showOptions = this.detailAndApprovePassAndApproveNoOption;
} else if (status == "3") {
this.showOptions = this.detailAndHandleOption;
} else if (status == "4") {
this.showOptions = this.detailAndCloseOption;
} else {
this.showOptions = this.detailOptions;
}
return this.showOptions
},
openScanDetailPopup() {
uni.navigateTo({
url: "./returnToStoreRequestSubmit?fromType=" + this.fromType
})
},
openFilter(){
this.$refs.filter.openFilter();
},
swipeClick(e, dataContent) {
var text = clearTirmAndWrap(e.content.text)
if (e.content.text == "详情") {
this.openRequestInfoPopup(dataContent);
} else if (e.content.text == "处理") {
this.showQuestionMessage("确定要处理当前申请吗?",res=>{
this.productionReturnRequestHandle(dataContent.id)
})
} else if (e.content.text == "审批") {
this.showQuestionMessage("确定要审批当前申请吗?",res=>{
this.productionReturnRequestSubmitApprove(dataContent.id)
})
} else if (e.content.text == "审批通过") {
this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{
this.productionReturnRequestSubmitApproveAgree(dataContent.id)
})
} else if (e.content.text == "审批驳回") {
this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{
this.productionReturnRequestSubmitApproveRefused(dataContent.id)
})
} else if (e.content.text == "关闭") {
this.showQuestionMessage("确定要关闭当前申请吗?",res=>{
this.productionReturnRequestClose(dataContent.id)
})
}
},
showQuestionMessage(hint,callBack){
this.$refs.comMessage.showQuestionMessage(hint,
res => {
if (res) {
callBack()
}
});
},
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: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductionReturnRequestList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openRequestDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
productionReturnRequestSubmitApprove(id) {
productionReturnRequestSubmitApprove(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请提交审批成功"
})
} else {
this.showMessage("申请提交审批失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestClose(id) {
productionReturnRequestClose(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请关闭成功"
})
} else {
this.showMessage("申请关闭失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestSubmitApproveAgree(id) {
productionReturnRequestSubmitApproveAgree(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请审批通过成功"
})
} else {
this.showMessage("申请审批通过失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestSubmitApproveRefused(id) {
productionReturnRequestSubmitApproveRefused(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请审批驳回成功"
})
} else {
this.showMessage("申请审批驳回失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestHandle(id) {
productionReturnRequestHandle(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请处理成功"
})
} else {
this.showMessage("申请处理失败")
}
}).catch(error => {
this.showMessage(error)
})
},
}
}
</script>
<style>
</style>

13
pages/productionReturn/coms/comReturnRequestCreator.vue

@ -7,7 +7,9 @@
<view class="" > <view class="" >
车间 : {{dataContent.workShopName}} ({{dataContent.workshopCode}}) 车间 : {{dataContent.workShopName}} ({{dataContent.workshopCode}})
</view> </view>
<view class="" >
类型 : {{getType(dataContent.businessType)}}
</view>
<view class=""> <view class="">
总数量 : {{dataContent.totalQty}} 总数量 : {{dataContent.totalQty}}
</view> </view>
@ -77,6 +79,15 @@
this.$nextTick(r => { this.$nextTick(r => {
this.$refs.collapse.resize() this.$refs.collapse.resize()
}); });
},
getType(value){
var type =""
if(value=="ReturnToStore"){
type ="合格退料"
}else if (value=='ReturnToHold'){
type ="隔离退料"
}
return type;
} }

363
pages/productionReturn/request/returnToHoldRequest.vue

@ -1,380 +1,55 @@
<template> <template>
<view> <view class="">
<com-empty-view v-if="requestList.length==0"></com-empty-view> <comReturnCommonRequest ref="request" businessType="ReturnToHold"></comReturnCommonRequest>
<request-filter ref="filter" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber"
:checkedWaitTask="checkedWaitTask">
</request-filter>
<view v-if="requestList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in requestList" :key="index">
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event,item)">
<com-return-request-card :dataContent="item" @click='openRequestDetail(item)'>
</com-return-request-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<uni-load-more :status="loadingType" />
<request-info-popup ref='requestInfoPopup'></request-info-popup>
</view>
<requestButton @goScan='openScanDetailPopup'></requestButton>
</view> </view>
<comMessage ref="comMessage"></comMessage>
</template> </template>
<script> <script>
import requestFilter from '@/mycomponents/request/requestFilter.vue' import comReturnCommonRequest from '@/pages/productionReturn/coms/comReturnCommonRequest.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestCard from '@/pages/productionReturn/coms/comReturnRequestCard.vue'
import requestInfoPopup from '@/pages/productionReturn/coms/requestInfoPopup.vue'
import requestButton from '@/mycomponents/button/requestButton.vue'
import {
getBusinessType,
} from '@/common/record.js';
import {
getProductionReturnRequestList,
productionReturnRequestHandle,
productionReturnRequestSubmitApprove,
productionReturnRequestSubmitApproveAgree,
productionReturnRequestSubmitApproveRefused,
productionReturnRequestClose
} from '@/api/request2.js';
import { import {
goHome, goHome,
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getDetailOption,
getDetailAndApproveOption,
getDetailAndApprovePassAndApproveNoOption,
getDetailAndHandleOption,
getDetailAndCloseOption
} from '@/common/array.js';
export default { export default {
components: { components: {
comEmptyView, comReturnCommonRequest,
requestFilter,
requiredLocation,
comMessage,
comReturnRequestCard,
requestInfoPopup,
requestButton,
}, },
data() { data() {
return { return {
requestList: [], requestList: [],
pageNo: 1,
pageSize: 10,
status: "",
totalCount: 0,
checkedWaitTask: false,
detailOptions: [],
detailAndApproveOptions: [],
detailAndApprovePassAndApproveNoOption: [],
detailAndHandleOption: [],
detailAndCloseOption: [],
showOptions: [],
fromType: "ReturnToHold",
loadingType: "nomore",
businessCode: "ReturnToHold"
}; };
}, },
onReady() {
this.detailOptions = getDetailOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndCloseOption = getDetailAndCloseOption()
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
onShow() {
this.getList('refresh');
},
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
} else if (e.index == 1) { } else if (e.index == 1) {
this.$refs.filter.openFilter(); this.$refs.request.openFilter();
} }
}, },
mounted() { onShow() {
if(this.$refs.request!=undefined){
this.$refs.request.onShow()
}
},
onPullDownRefresh() {
this.$refs.request.onPullDownRefresh()
},
onReachBottom() {
this.$refs.request.onReachBottom()
}, },
methods: { methods: {
openRequestInfoPopup(item) {
this.$refs.requestInfoPopup.openPopup(item)
},
openRequestDetail(item) {
uni.navigateTo({
url: './requestDetail?id=' + item.id
});
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.requestList = [];
}
var filters = []
if (this.checkedWaitTask) {
filters.push({
column: "status",
action: "==",
value: this.status
})
}
filters.push({
column: "business_type",
action: "==",
value: this.businessCode
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getProductionReturnRequestList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(res => {
var options = this.updateOptions(res.status);
res.options = options;
})
this.requestList = type === "refresh" ? list : this.requestList.concat(list);
this.pageNo++;
updateTitle("生产合格退料申请(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("生产合格退料申请");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
updateOptions(status) {
if (status == "1") {
this.showOptions = this.detailAndApproveOptions;
} else if (status == "2") {
this.showOptions = this.detailAndApprovePassAndApproveNoOption;
} else if (status == "3") {
this.showOptions = this.detailAndHandleOption;
} else if (status == "4") {
this.showOptions = this.detailAndCloseOption;
} else {
this.showOptions = this.detailOptions;
}
return this.showOptions
},
openScanDetailPopup() {
uni.navigateTo({
url: "./returnToStoreRequestSubmit?fromType=" + this.fromType
})
},
swipeClick(e, dataContent) {
var text = clearTirmAndWrap(e.content.text)
if (e.content.text == "详情") {
this.openRequestInfoPopup(dataContent);
} else if (e.content.text == "处理") {
this.showQuestionMessage("确定要处理当前申请吗?",res=>{
this.productionReturnRequestHandle(dataContent.id)
})
} else if (e.content.text == "审批") {
this.showQuestionMessage("确定要审批当前申请吗?",res=>{
this.productionReturnRequestSubmitApprove(dataContent.id)
})
} else if (e.content.text == "审批通过") {
this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{
this.productionReturnRequestSubmitApproveAgree(dataContent.id)
})
} else if (e.content.text == "审批驳回") {
this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{
this.productionReturnRequestSubmitApproveRefused(dataContent.id)
})
} else if (e.content.text == "关闭") {
this.showQuestionMessage("确定要关闭当前申请吗?",res=>{
this.productionReturnRequestClose(dataContent.id)
})
}
},
showQuestionMessage(hint,callBack){
this.$refs.comMessage.showQuestionMessage(hint,
res => {
if (res) {
callBack()
}
});
},
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: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductionReturnRequestList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openRequestDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
productionReturnRequestSubmitApprove(id) {
productionReturnRequestSubmitApprove(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请提交审批成功"
})
} else {
this.showMessage("申请提交审批失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestClose(id) {
productionReturnRequestClose(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请关闭成功"
})
} else {
this.showMessage("申请关闭失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestSubmitApproveAgree(id) {
productionReturnRequestSubmitApproveAgree(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请审批通过成功"
})
} else {
this.showMessage("申请审批通过失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestSubmitApproveRefused(id) {
productionReturnRequestSubmitApproveRefused(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请审批驳回成功"
})
} else {
this.showMessage("申请审批驳回失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestHandle(id) {
productionReturnRequestHandle(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请处理成功"
})
} else {
this.showMessage("申请处理失败")
}
}).catch(error => {
this.showMessage(error)
})
},
} }
} }

363
pages/productionReturn/request/returnToStoreRequest.vue

@ -1,380 +1,55 @@
<template> <template>
<view> <view class="">
<com-empty-view v-if="requestList.length==0"></com-empty-view> <comReturnCommonRequest ref="request" businessType="ReturnToStore"></comReturnCommonRequest>
<request-filter ref="filter" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber"
:checkedWaitTask="checkedWaitTask">
</request-filter>
<view v-if="requestList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in requestList" :key="index">
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event,item)">
<com-return-request-card :dataContent="item" @click='openRequestDetail(item)'>
</com-return-request-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<uni-load-more :status="loadingType" />
<request-info-popup ref='requestInfoPopup'></request-info-popup>
</view>
<requestButton @goScan='openScanDetailPopup'></requestButton>
</view> </view>
<comMessage ref="comMessage"></comMessage>
</template> </template>
<script> <script>
import requestFilter from '@/mycomponents/request/requestFilter.vue' import comReturnCommonRequest from '@/pages/productionReturn/coms/comReturnCommonRequest.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestCard from '@/pages/productionReturn/coms/comReturnRequestCard.vue'
import requestInfoPopup from '@/pages/productionReturn/coms/requestInfoPopup.vue'
import requestButton from '@/mycomponents/button/requestButton.vue'
import {
getBusinessType,
} from '@/common/record.js';
import {
getProductionReturnRequestList,
productionReturnRequestHandle,
productionReturnRequestSubmitApprove,
productionReturnRequestSubmitApproveAgree,
productionReturnRequestSubmitApproveRefused,
productionReturnRequestClose
} from '@/api/request2.js';
import { import {
goHome, goHome,
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getDetailOption,
getDetailAndApproveOption,
getDetailAndApprovePassAndApproveNoOption,
getDetailAndHandleOption,
getDetailAndCloseOption
} from '@/common/array.js';
export default { export default {
components: { components: {
comEmptyView, comReturnCommonRequest,
requestFilter,
requiredLocation,
comMessage,
comReturnRequestCard,
requestInfoPopup,
requestButton,
}, },
data() { data() {
return { return {
requestList: [], requestList: [],
pageNo: 1,
pageSize: 10,
status: "",
totalCount: 0,
checkedWaitTask: false,
detailOptions: [],
detailAndApproveOptions: [],
detailAndApprovePassAndApproveNoOption: [],
detailAndHandleOption: [],
detailAndCloseOption: [],
showOptions: [],
fromType: "ReturnToStore",
loadingType: "nomore",
businessCode: "ReturnToStore"
}; };
}, },
onReady() {
this.detailOptions = getDetailOption();
this.detailAndApproveOptions = getDetailAndApproveOption()
this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(),
this.detailAndHandleOption = getDetailAndHandleOption()
this.detailAndCloseOption = getDetailAndCloseOption()
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
onShow() {
this.getList('refresh');
},
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
} else if (e.index == 1) { } else if (e.index == 1) {
this.$refs.filter.openFilter(); this.$refs.request.openFilter();
} }
}, },
mounted() { onShow() {
if(this.$refs.request!=undefined){
this.$refs.request.onShow()
}
},
onPullDownRefresh() {
this.$refs.request.onPullDownRefresh()
},
onReachBottom() {
this.$refs.request.onReachBottom()
}, },
methods: { methods: {
openRequestInfoPopup(item) {
this.$refs.requestInfoPopup.openPopup(item)
},
openRequestDetail(item) {
uni.navigateTo({
url: './requestDetail?id=' + item.id
});
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.requestList = [];
}
var filters = []
if (this.checkedWaitTask) {
filters.push({
column: "status",
action: "==",
value: this.status
})
}
filters.push({
column: "business_type",
action: "==",
value: this.businessCode
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getProductionReturnRequestList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(res => {
var options = this.updateOptions(res.status);
res.options = options;
})
this.requestList = type === "refresh" ? list : this.requestList.concat(list);
this.pageNo++;
updateTitle("生产合格退料申请(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("生产合格退料申请");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
updateOptions(status) {
if (status == "1") {
this.showOptions = this.detailAndApproveOptions;
} else if (status == "2") {
this.showOptions = this.detailAndApprovePassAndApproveNoOption;
} else if (status == "3") {
this.showOptions = this.detailAndHandleOption;
} else if (status == "4") {
this.showOptions = this.detailAndCloseOption;
} else {
this.showOptions = this.detailOptions;
}
return this.showOptions
},
openScanDetailPopup() {
uni.navigateTo({
url: "./returnToStoreRequestSubmit?fromType=" + this.fromType
})
},
swipeClick(e, dataContent) {
var text = clearTirmAndWrap(e.content.text)
if (e.content.text == "详情") {
this.openRequestInfoPopup(dataContent);
} else if (e.content.text == "处理") {
this.showQuestionMessage("确定要处理当前申请吗?",res=>{
this.productionReturnRequestHandle(dataContent.id)
})
} else if (e.content.text == "审批") {
this.showQuestionMessage("确定要审批当前申请吗?",res=>{
this.productionReturnRequestSubmitApprove(dataContent.id)
})
} else if (e.content.text == "审批通过") {
this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{
this.productionReturnRequestSubmitApproveAgree(dataContent.id)
})
} else if (e.content.text == "审批驳回") {
this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{
this.productionReturnRequestSubmitApproveRefused(dataContent.id)
})
} else if (e.content.text == "关闭") {
this.showQuestionMessage("确定要关闭当前申请吗?",res=>{
this.productionReturnRequestClose(dataContent.id)
})
}
},
showQuestionMessage(hint,callBack){
this.$refs.comMessage.showQuestionMessage(hint,
res => {
if (res) {
callBack()
}
});
},
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: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductionReturnRequestList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openRequestDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
}
});
},
productionReturnRequestSubmitApprove(id) {
productionReturnRequestSubmitApprove(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请提交审批成功"
})
} else {
this.showMessage("申请提交审批失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestClose(id) {
productionReturnRequestClose(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请关闭成功"
})
} else {
this.showMessage("申请关闭失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestSubmitApproveAgree(id) {
productionReturnRequestSubmitApproveAgree(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请审批通过成功"
})
} else {
this.showMessage("申请审批通过失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestSubmitApproveRefused(id) {
productionReturnRequestSubmitApproveRefused(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请审批驳回成功"
})
} else {
this.showMessage("申请审批驳回失败")
}
}).catch(error => {
this.showMessage(error)
})
},
productionReturnRequestHandle(id) {
productionReturnRequestHandle(id).then(res => {
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "申请处理成功"
})
} else {
this.showMessage("申请处理失败")
}
}).catch(error => {
this.showMessage(error)
})
},
} }
} }

24
pages/productionReturn/request/returnToStoreRequestSubmit.vue

@ -70,6 +70,7 @@
} }
}, },
mounted() { mounted() {
this.goScan(true) this.goScan(true)
}, },
@ -94,6 +95,7 @@
if (this.detailSource.subList.length == 0) { if (this.detailSource.subList.length == 0) {
this.detailSource = { this.detailSource = {
workshopCode: item.workshopCode, workshopCode: item.workshopCode,
businessType:this.fromType,
status: "1", status: "1",
totalQty: 0, totalQty: 0,
subList: [] subList: []
@ -168,17 +170,17 @@
}); });
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// productionReturnRequestCreate(params).then(res => { productionReturnRequestCreate(params).then(res => {
// uni.hideLoading() uni.hideLoading()
// if (res.data) { if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data) this.showCommitSuccessMessage("提交成功<br>生成发料申请" + res.data)
// } else { } else {
// this.showErrorMessage("[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
// } }
// }).catch(error => { }).catch(error => {
// uni.hideLoading() uni.hideLoading()
// this.showErrorMessage(error) this.showErrorMessage(error)
// }) })
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {

Loading…
Cancel
Save