Browse Source

修改制品完工收货

hella_vue3
niexiting 8 months ago
parent
commit
7cd4df004d
  1. 1
      src/api/request2.js
  2. 27
      src/common/style/new_style.css
  3. 263
      src/mycomponents/scan/winComScanFG.vue
  4. 114
      src/mycomponents/scan/winScanFGLabel.vue
  5. 6
      src/pages.json
  6. 62
      src/pages/productReceipt/coms/comFgCard.vue
  7. 12
      src/pages/productReceipt/coms/comProductDetailCard.vue
  8. 61
      src/pages/productReceipt/job/FgProductReceiptDetail.vue
  9. 268
      src/pages/productReceipt/job/FgProductReceiptJob.vue
  10. 268
      src/pages/productReceipt/job/SemiProductReceiptJob.vue
  11. 30
      src/pages/productReceipt/job/productReceiptJob.vue

1
src/api/request2.js

@ -1895,6 +1895,7 @@ export function getProductReceiptJobList(params) {
}); });
} }
/** /**
* 制品收货 获取任务明细 * 制品收货 获取任务明细
* @param {*} id 任务id * @param {*} id 任务id

27
src/common/style/new_style.css

@ -2077,22 +2077,11 @@ button::after {
padding: 5px; padding: 5px;
} }
.card_packing_code_content {
font-size: 32rpx;
padding: 5px;
}
.card_batch { .card_batch {
color: #9747FF; color: #9747FF;
padding: 5px; padding: 5px;
} }
.card_batch_content {
font-size: 32rpx;
padding: 5px;
}
.card_container { .card_container {
color: #0076F6; color: #0076F6;
padding: 5px; padding: 5px;
@ -2131,12 +2120,28 @@ button::after {
.card_supportCode { .card_supportCode {
color: #DA8910; color: #DA8910;
padding: 5px;
} }
.card_supportCode_content { .card_supportCode_content {
font-size: 32rpx; font-size: 32rpx;
} }
.card_item_code {
color: #F1A532;
padding: 5px;
}
.card_product_date {
color: #329362;
padding: 5px;
}
.card_order {
color: #0076F6;
padding: 5px;
}
.scan_view { .scan_view {
/* #0CC2B6 20% */ /* #0CC2B6 20% */
background: linear-gradient(90deg, rgba(12, 194, 182, 0.2) 0%, rgba(12, 194, 182, 0) 100%) background: linear-gradient(90deg, rgba(12, 194, 182, 0.2) 0%, rgba(12, 194, 182, 0) 100%)

263
src/mycomponents/scan/winComScanFG.vue

@ -0,0 +1,263 @@
<!--扫描组件-->
<template>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<view>
<view class="pop_tab">
<view class="tab_info">
<view class="conbox">
<textarea inputmode="none" v-model="scanMsg" trim="all" maxlength="1000"
style="margin-left: 5px;width: 90%;" :focus="boxfocus" :placeholder="placeholderValue"
@focus="getfocus" @blur="losefocus" @input="handelScanMsg" :cursor="cursorIndex"></textarea>
</view>
<view class="uni-flex uni-row space-between u-col-center">
<view class="uni-flex">
<button class="clean_scan_btn" @click="clearScanValue()">清空</button>
<button class="scan_btn" @click="clickScanMsg()">扫描</button>
</view>
</view>
</view>
<view style="width: 100%;">
<view style="width: 100%;" v-if="scanList.length>0&&isShowHistory">
<view class="uni-flex uni-row space-between u-col-center">
<view class="" style="padding: 10rpx;">
历史记录
</view>
<view class="" style="padding-right: 10rpx;">
<u-icon :name="expendIcon" size="35rpx" @click="expands()"></u-icon>
</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&&scanList.length>0"
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)">
<view class="text_ellipsis" style="padding: 15rpx;">
{{item}}
</view>
<view class="">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<u-line class='line_color'></u-line>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getLabelInfo
} from '../../common/label.js';
export default {
name: "winComScan",
emits: ["getResult"],
components: {},
props: {
placeholder: {
type: String,
default: '请扫描标签'
},
clearResult: {
type: Boolean,
default: true
},
boxFocus: {
type: Boolean,
default: true
},
isShowHistory: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: 'HPQ' //HLB HMQ HCQ HPQ
}
},
data() {
return {
// scanMsg: "HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q100",
scanMsg: "",
boxfocus: false,
placeholderValue: '',
scanResult: {},
scanList: [],
expand: true,
expendIcon: 'arrow-down',
cursorIndex: 0
}
},
mounted() {
this.boxfocus = true;
uni.hideKeyboard();
// #ifdef H5
if (document.querySelector('textarea') != null) {
document.querySelector('textarea').setAttribute('inputmode', 'none')
}
// #endif
this.hide()
// #ifdef APP-PLUS
// #endif
},
watch: {
placeholder() {
this.placeholderValue = '请扫描' + this.placeholder;
}
},
created() {
this.placeholderValue = '请扫描' + this.placeholder;
},
methods: {
hide() {
// #ifdef APP-PLUS
//
var interval = setInterval(function() {
uni.hideKeyboard(); //
console.log('刷新')
}, 5);
setTimeout(() => {
clearInterval(interval);
console.log('停止刷新')
}, 1000);
// #endif
},
getValue() {
return this.scanMsg
},
setValue(val) {
this.scanMsg = val
},
clearScanValue() {
this.scanMsg = ''
this.getfocus();
},
clickScanMsg() {
this.scanMsg = this.scanMsg + "\n";
this.handelScanMsg();
},
handelScanMsg() {
let that = this;
setTimeout(() => {
that.losefocus();
// let content = uni.$u.trim(that.scanMsg)
let content = that.scanMsg;
if (content == "") {
that.getfocus();
this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => {
if (res) {
that.scanMsg = ""
that.getfocus();
}
})
return;
}
if (that.isShowHistory) {
that.scanList.unshift(content);
}
try {
let itemCode = content.substr(0, 10);
let productDate = content.substr(10, 8);
let batch = content.substr(18, 3);
let order = content.substr(21, 8);
let scanResult = {
itemCode: itemCode,
productDate: productDate,
batch: batch,
order: order,
content: content,
success: true
};
that.clear();
that.$emit("getResult", scanResult);
} catch (e) {
this.$refs.comMessage.showErrorMessage('解析错误', res => {
if (res) {
that.getfocus();
}
})
}
}, 500);
},
getfocus() {
let that = this;
this.$nextTick(r => {
that.boxfocus = true;
});
this.hide()
},
losefocus() {
let that = this;
this.$nextTick(r => {
that.boxfocus = false;
});
},
clear() {
this.cursorIndex = 0;
this.scanMsg = ''
},
iconClick(type) {
this.$emit("clearResult", this.scanMsg);
},
expands() {
this.expand = !this.expand;
this.expendIcon = this.expand == true ? "arrow-down" : "arrow-up"
},
scanClick() {
this.handelScanMsg();
},
cancelClick() {
this.clear();
this.getfocus();
},
showItem(item) {
this.$refs.comMessage.showMessage(item, res => {
if (res) {
// this.$refs.modal.cancelClose();
}
})
},
scanQRCode() {
let that = this;
uni.scanCode({
onlyFromCamera: true,
success: (res) => {
that.scanMsg = res.result;
that.$emit("getResult", res.result);
console.log('扫描二维码成功,结果:' + res.result);
},
fail: (res) => {
that.showItem('扫描出现错误:' + res.result);
console.log('扫描出现错误:' + res.result);
}
});
}
}
}
</script>
<script module="textarea" lang="renderjs">
export default {
mounted() {
document.querySelector('textarea').setAttribute('inputmode', 'none')
},
}
</script>
<style scoped lang="scss">
</style>

114
src/mycomponents/scan/winScanFGLabel.vue

@ -0,0 +1,114 @@
<template>
<view>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan-fg ref="comscan" :placeholder="title" @getResult="getScanResult"
:headerType="headerType" :isShowHistory="isShowHistory"
:clearResult="true"></win-com-scan-fg>
</view>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage" @afterClose="getfocus"></comMessage>
</view>
</template>
<script>
import winComScanFg from '@/mycomponents/scan/winComScanFg.vue'
export default {
name: 'winScanFGLabel',
components: {
winComScanFg,
},
props: {
title: {
type: String,
default: '成品标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: 'HPQ'
}
},
data() {
return {
show: false,
}
},
created() {
},
methods: {
openScanPopup() {
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 200)
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
this.$refs.comscan.clickScanMsg();
},
cancelClick() {
this.$refs.comscan.clearScanValue();
},
getScanResult(result) {
if (result.success) {
this.$emit("getResult", result);
} else {
this.showMessage(result.message)
}
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
change(e) {
this.show = e.show
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

6
src/pages.json

@ -821,7 +821,7 @@
{ {
"path": "pages/productReceipt/job/fgProductReceiptJob", "path": "pages/productReceipt/job/fgProductReceiptJob",
"style": { "style": {
"navigationBarTitleText": "装配完工收货任务", "navigationBarTitleText": "装配收货任务",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"titleNView": { "titleNView": {
// "autoBackButton": "true", // "autoBackButton": "true",
@ -847,14 +847,14 @@
{ {
"path": "pages/productReceipt/job/fgProductReceiptDetail", "path": "pages/productReceipt/job/fgProductReceiptDetail",
"style": { "style": {
"navigationBarTitleText": "装配完工收货详情", "navigationBarTitleText": "装配收货详情",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path": "pages/productReceipt/job/semiProductReceiptJob", "path": "pages/productReceipt/job/semiProductReceiptJob",
"style": { "style": {
"navigationBarTitleText": "预生产完工收货任务", "navigationBarTitleText": "预生产收货任务",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"titleNView": { "titleNView": {
// "autoBackButton": "true", // "autoBackButton": "true",

62
src/pages/productReceipt/coms/comFgCard.vue

@ -0,0 +1,62 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff; border-bottom: 1upx solid #EEEEEE;">
<view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉-->
<view style="word-break: break-all;">
<view>
<text class="card_item_code card_content ">零件号</text>
<text class="card_content ">{{detail.itemCode}}</text>
</view>
<view>
<text class="card_product_date card_content ">生产日期</text>
<text class="card_content ">{{detail.productDate}}</text>
</view>
<view>
<text class="card_batch card_content ">批次</text>
<text class="card_content ">{{detail.batch}}</text>
</view>
<view>
<text class="card_order card_content ">顺序</text>
<text class="card_content ">{{detail.order}}</text>
</view>
</view>
<view style="word-break: break-all;">
<recommend-qty :dataContent="detail"
:isShowStdPack="false" :isShowStatus="false"></recommend-qty>
</view>
</view>
</view>
</template>
<script>
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
export default {
components: {
recommendQty,
},
data() {
return {
}
},
props: {
detail: {
type: Object,
default: {}
},
},
watch: {
},
methods: {
}
}
</script>
<style>
</style>

12
src/pages/productReceipt/coms/comProductDetailCard.vue

@ -5,21 +5,20 @@
<template v-slot:title> <template v-slot:title>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty> <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty>
</template> </template>
<u-line /> <view class="split_line"></view>
<view class="" v-for="(item,index) in dataContent.subList"> <view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :isShowFromLocation="false" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend> <recommend :detail="item" :isShowFromLocation="false"
:isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" <recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
@confirm="confirm">
</recommend-qty-edit> </recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
@ -101,7 +100,8 @@
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
} }
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty,this.settingParam.allowModifyLocation) this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
} }
}, },

61
src/pages/productReceipt/job/FgProductReceiptDetail.vue

@ -14,11 +14,15 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" <com-product-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'> @remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'>
</comProductDetailCard> </com-product-detail-card>
<view class="card_view" style="margin-left: 20px; border-bottom: 1px solid #e0e0e0;"
v-for="(fg, index) in fgList">
<com-fg-card :detail='fg'></com-fg-card>
</view> </view>
<u-line /> </view>
<view class="split_line"></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -27,8 +31,8 @@
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<locationCompare title="收货库位" :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" <locationCompare title="收货库位" :recommendLocationCode="jobToLocationCode"
@getLocation='scanLocationCode' :locationCode="toLocationCode" @getLocation='scanLocationCode'
:locationTypeList="toLocationTypeList"></locationCompare> :locationTypeList="toLocationTypeList"></locationCompare>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
@ -38,7 +42,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'制品标签'" headerType="HMQ"></win-scan-pack> <win-scan-fg-label ref="scanPopup" @getResult='getScanResult' title='制品标签'></win-scan-fg-label>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -75,11 +79,11 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue" import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
export default { export default {
name: 'receipt_detail', name: 'receipt_detail',
@ -87,9 +91,10 @@
winScanButton, winScanButton,
comDetailCard, comDetailCard,
locationCompare, locationCompare,
winScanPack, winScanFgLabel,
jobTop, jobTop,
comProductDetailCard comProductDetailCard,
comFgCard
}, },
data() { data() {
return { return {
@ -104,8 +109,8 @@
toLocationTypeList: [], toLocationTypeList: [],
managementList: [], managementList: [],
jobStatus: "", jobStatus: "",
jobToLocationCode:"" jobToLocationCode: "",
fgList: []
}; };
}, },
onLoad(option) { onLoad(option) {
@ -197,36 +202,8 @@
}, },
getScanResult(result) { getScanResult(result) {
let label = result.label; let source = that.detailSource;
var packingNumber = label.packingNumber; this.fgList.push(result);
var batch = label.batch;
var qty = label.qty;
var itemCode = label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r =>
r.packingNumber == packingNumber &&
r.batch == batch);
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在任务列表中")
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
}
}
}, },
// //

268
src/pages/productReceipt/job/FgProductReceiptJob.vue

@ -1,283 +1,29 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <product-receipt-job ref="productreceiptjob" type='fg'></product-receipt-job>
<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-product-job-card :dataContent="item" @click='openJobDetail(item)'></com-product-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
<comMessage ref="comMessage"></comMessage>
</view>
</view> </view>
</template> </template>
<script> <script>
import { import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue'
getProductReceiptJobList,
cancleTakeProductReceiptJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comProductJobCard from '@/pages/productReceipt/coms/comProductJobCard.vue'
import jobListPopup from '@/pages/productReceipt/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productReceipt/coms/jobInfoPopup.vue'
export default { export default {
name: 'receipt', name: 'fgProductReceiptJob',
components: { components: {
comEmptyView, productReceiptJob
jobFilter,
comProductJobCard,
jobListPopup,
jobInfoPopup
}, },
data() { data() {
return { return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
};
},
onShow() {
this.getList("refresh")
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() { };
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
}, },
// mounted() {
onNavigationBarButtonTap(e) { this.$refs.productreceiptjob.getList("refresh");
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
}, },
methods: { 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: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getProductReceiptJobList(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;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
updateTitle("制品收货(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("制品收货");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './productReceiptDetail?id=' + item.id + '&status=' + item.status
});
},
showItemList(itemList) {
this.$refs.jobListPopup.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.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeProductReceiptJob(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
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductReceiptJobList(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) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
} }
} }
</script> </script>

268
src/pages/productReceipt/job/SemiProductReceiptJob.vue

@ -1,283 +1,29 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <product-receipt-job ref="productreceiptjob" type='predict'></product-receipt-job>
<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-product-job-card :dataContent="item" @click='openJobDetail(item)'></com-product-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
<comMessage ref="comMessage"></comMessage>
</view>
</view> </view>
</template> </template>
<script> <script>
import { import productReceiptJob from '@/pages/productReceipt/job/productReceiptJob.vue'
getProductReceiptJobList,
cancleTakeProductReceiptJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comProductJobCard from '@/pages/productReceipt/coms/comProductJobCard.vue'
import jobListPopup from '@/pages/productReceipt/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productReceipt/coms/jobInfoPopup.vue'
export default { export default {
name: 'receipt', name: 'semiProductReceiptJob',
components: { components: {
comEmptyView, productReceiptJob
jobFilter,
comProductJobCard,
jobListPopup,
jobInfoPopup
}, },
data() { data() {
return { return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
};
},
onShow() {
this.getList("refresh")
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() { };
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
}, },
// mounted() {
onNavigationBarButtonTap(e) { this.$refs.productreceiptjob.getList("refresh");
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
}, },
methods: { 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: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getProductReceiptJobList(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;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
updateTitle("制品收货(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("制品收货");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './productReceiptDetail?id=' + item.id + '&status=' + item.status
});
},
showItemList(itemList) {
this.$refs.jobListPopup.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.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeProductReceiptJob(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
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductReceiptJobList(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) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
} }
} }
</script> </script>

30
src/pages/productReceipt/job/productReceiptJob.vue

@ -9,8 +9,7 @@
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index"> <view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item <uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-product-job-card :dataContent="item" @click='openJobDetail(item)'></com-product-job-card> <com-product-job-card :dataContent="item" @click='openJobDetail(item)'></com-product-job-card>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -73,9 +72,10 @@
detailGiveupOptions: [], detailGiveupOptions: [],
}; };
}, },
// type = 'assemble'
onShow() { // type = 'predict'
this.getList("refresh") props: {
type: 'assemble',
}, },
onReady() { onReady() {
@ -146,7 +146,9 @@
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
type: this.type
} }
getProductReceiptJobList(params).then(res => { getProductReceiptJobList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (type === "refresh") { if (type === "refresh") {
@ -155,7 +157,11 @@
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
updateTitle("制品收货(" + this.totalCount + ")"); if (this.type == 'predict') {
updateTitle("预生产收货任务(" + this.totalCount + ")");
} else {
updateTitle("装配收货任务(" + this.totalCount + ")");
}
this.loadingType = "loadmore"; this.loadingType = "loadmore";
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
this.loadingType = "nomore"; this.loadingType = "nomore";
@ -169,7 +175,11 @@
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
updateTitle("制品收货"); if (this.type == 'predict') {
updateTitle("预生产收货任务(" + this.totalCount + ")");
} else {
updateTitle("装配收货任务(" + this.totalCount + ")");
}
this.loadingType = ""; this.loadingType = "";
uni.hideLoading(); uni.hideLoading();
that.showMessage(error) that.showMessage(error)
@ -177,9 +187,15 @@
}, },
openJobDetail(item) { openJobDetail(item) {
if (this.type == 'predict') {
uni.navigateTo({ uni.navigateTo({
url: './productReceiptDetail?id=' + item.id + '&status=' + item.status url: './productReceiptDetail?id=' + item.id + '&status=' + item.status
}); });
} else {
uni.navigateTo({
url: './fgProductReceiptDetail?id=' + item.id + '&status=' + item.status
});
}
}, },
showItemList(itemList) { showItemList(itemList) {

Loading…
Cancel
Save