Browse Source

store引用 文件迁移Vue2升级Vue3 8/2-10/25

hella_vue3
王志国 3 weeks ago
parent
commit
cee85c60ff
  1. 787
      src/pages/count/job/countBlindDetail.vue
  2. 779
      src/pages/count/job/countDetail1.vue
  3. 815
      src/pages/count/job/fuzzyCountDetail.vue
  4. 6
      src/pages/issue/record/directIssue2.vue
  5. 15
      src/pages/package/record/splitPackageRecord.vue
  6. 81
      src/pages/productReceipt/job/completeReceiveJobDetail.vue
  7. 3
      src/pages/productReceipt/job/productReceiptJob.vue
  8. 93
      src/pages/purchaseReturn/job/returnDetailBatch.vue
  9. 5
      src/pages/putaway/job/quantityPutawayJobDetail.vue

787
src/pages/count/job/countBlindDetail.vue

@ -32,15 +32,15 @@
<u-line color="#D8D8D8" style="margin-bottom: 15rpx"></u-line>
<scroll-view scroll-y="true" class="" style="margin-bottom: 50px">
<view class="detail-list" v-for="(item, index) in showList" :key="item.id">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event, item)" :right-options="item.scaned ? scanOptions : detailOptions">
<view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'">
<view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view>
<comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" :isShowRecommendQty="false" @updateData="updateData"> </comCountDetailcards>
</view>
<view class="split_line"></view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-swipe-action ref="swipeAction"
:options="item.scaned ? scanOptions : detailOptions"
@click="(...event)=>swipeClick(event, item)">
<view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'">
<view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view>
<comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" :isShowRecommendQty="false" @updateData="updateData"> </comCountDetailcards>
</view>
<view class="split_line"></view>
</u-swipe-action>
</view>
</scroll-view>
<uni-load-more :status="loadingType" v-if="showList.length > 0" />
@ -63,7 +63,7 @@
</view>
</template>
<script>
<script setup>
import { Decimal } from 'decimal.js' //
import { getCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js'
import { calc } from '@/common/calc.js'
@ -80,455 +80,386 @@ import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.v
import countQtyEdit from '@/mycomponents/qty/countQtyEdit.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import detailInfoPopup from '@/pages/count/coms/detailInfoPopup.vue'
export default {
name: 'receipt_detail',
components: {
winScanButton,
winScanPack,
comCountDetailcards,
winScanPackAndLocation,
countQtyEdit,
jobTop,
detailInfoPopup
},
data() {
return {
id: '',
receiptJob: {},
fromLocationCode: '',
isShowPackingCode: true,
jobContent: {}, //
subList: [], // subList
detailSource: [], //
balance: {}, //
editInventoryStatus: false,
package: {}, //
label: {}, //
currentEditItem: {},
jobStatus: '',
allCount: 0,
scanCount: 0,
index: 0,
pageSize: 20,
showList: [],
loadingType: '',
allDetails: [],
scanOptions: [],
detailOptions: []
}
},
onLoad(option) {
uni.setNavigationBarTitle({
title: `${option.title}详情`
})
this.id = option.id
if (this.id != undefined) {
//
if (option.status == '1') {
this.receive((callback) => {
this.getDetail()
})
} else {
this.getDetail()
}
}
this.detailOptions = getDetailOption()
this.scanOptions = getDetailEditRemoveOption()
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome()
}
},
//
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.jobStatus == '2') {
//
cancleTakeCountJob(this.id)
.then((res) => {
uni.navigateBack()
})
.catch((error) => {
uni.navigateBack()
})
} else {
uni.navigateBack()
}
return true
}
},
onPullDownRefresh() {
this.initList()
uni.stopPullDownRefresh()
},
mounted() {},
onReachBottom() {
console.log('onReachBottom')
//
if (this.loadingType == 'nomore') {
return
import { ref } from 'vue'
import { onLoad, onPullDownRefresh, onReachBottom, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app'
import { useCountStore } from "@/store";
const store = useCountStore()
const id = ref(null)
const jobStatus = ref('')
const detailOptions = ref(getDetailOption())
const scanOptions = ref(getDetailEditRemoveOption())
const loadingType = ref('')
const index = ref(1)
const showList = ref([])
const allDetails = ref([])
const allCount = ref(0)
const fromLocationCode = ref('')
const jobContent = ref({})
const currentEditItem = ref(null)
const showItem = ref(null)
const detailInfoPopup = ref(null)
const scanPopup = ref(null)
const comMessage = ref(null)
const countQtyEdit = ref(null)
onLoad(option => {
uni.setNavigationBarTitle({ title: `${option.title}详情` })
id.value = option.id
if (id.value !== undefined) {
if (option.status === '1') {
receive(() => getDetail())
} else {
getDetail()
}
this.index++
const list = this.getDataPage(this.index, this.pageSize)
if (list.length > 0) {
// this.showList=list
this.showList = this.showList.concat(list)
}
detailOptions.value = getDetailOption()
scanOptions.value = getDetailEditRemoveOption()
})
onNavigationBarButtonTap(e => {
if (e.index === 0) {
goHome()
}
})
onBackPress(e => {
if (e.from === 'backbutton') {
if (jobStatus.value === '2') {
cancleTakeCountJob(id.value)
.then(() => uni.navigateBack())
.catch(() => uni.navigateBack())
} else {
//
this.loadingType = 'nomore'
uni.navigateBack()
}
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeCountJob(this.id)
.then((res) => {
callback()
})
.catch((error) => {
this.showErrorMessage(error)
})
}
},
return true
}
})
onPullDownRefresh(() => {
initList()
uni.stopPullDownRefresh()
})
onReachBottom(() => {
console.log('onReachBottom')
if (loadingType.value === 'nomore') return
index.value++
const list = getDataPage(index.value, pageSize)
if (list.length > 0) {
showList.value = showList.value.concat(list)
} else {
loadingType.value = 'nomore'
}
})
getDetail() {
const that = this
uni.showLoading({
title: '加载中....',
mask: true
})
getCountJobDetail(that.id)
.then((res) => {
uni.hideLoading()
if (res.data == null) {
that.showMessage('未获取到详情')
} else {
that.jobContent = res.data
that.jobStatus = res.data.status
that.fromLocationCode = that.jobContent.countSplitCode
res.data.subList.forEach((item) => {
item.recommendQty = item.qty
item.handleQty = 0
item.countTime = new Date()
item.fromLocationCode = that.fromLocationCode
})
that.allDetails = res.data.subList
that.allCount = res.data.subList.length
that.initList()
}
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
const receive = (callback) => {
if (id.value !== null) {
takeCountJob(id.value)
.then(callback)
.catch(error => showErrorMessage(error))
}
}
const getDetail = () => {
uni.showLoading({ title: '加载中....', mask: true })
getCountJobDetail(id.value)
.then(res => {
uni.hideLoading()
if (res.data === null) {
showMessage('未获取到详情')
} else {
jobContent.value = res.data
jobStatus.value = res.data.status
fromLocationCode.value = jobContent.value.countSplitCode
res.data.subList.forEach(item => {
item.recommendQty = item.qty
item.handleQty = 0
item.countTime = new Date()
item.fromLocationCode = fromLocationCode.value
})
},
initList() {
this.index = 1
this.showList = []
this.loadingType = ''
this.showList = this.getDataPage(this.index, this.pageSize)
},
getDataPage(pageNo, pageSize) {
//
const totalPages = Math.ceil(this.allCount / pageSize)
//
const start = (pageNo - 1) * pageSize
const end = start + pageSize //
return this.allDetails.slice(start, end)
},
swipeClick(e, item) {
if (e.content.text == '详情') {
this.detail(item)
} else if (e.content.text == '编辑') {
this.editItem(item)
} else if (e.content.text == '移除') {
this.remove(item)
allDetails.value = res.data.subList
allCount.value = res.data.subList.length
initList()
}
},
detail(item) {
this.showItem = item
this.$refs.detailInfoPopup.openPopup(item)
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.handleQty = 0
this.$emit('removePack')
}
})
},
})
.catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
}
updateData() {},
const initList = () => {
index.value = 1
showList.value = []
loadingType.value = ''
showList.value = getDataPage(index.value, pageSize)
}
openScanPopup() {
const fromlocationList = []
fromlocationList.push(this.fromLocationCode)
this.$refs.scanPopup.openScanPopupForJob(this.fromLocationCode, fromlocationList, this.jobContent)
},
const getDataPage = (pageNo, pageSize) => {
const totalPages = Math.ceil(allCount.value / pageSize)
const start = (pageNo - 1) * pageSize
const end = start + pageSize
return allDetails.value.slice(start, end)
}
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup()
}
},
const swipeClick = (e, item) => {
if (e.content.text === '详情') {
detail(item)
} else if (e.content.text === '编辑') {
editItem(item)
} else if (e.content.text === '移除') {
remove(item)
}
}
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus()
}
},
const detail = (item) => {
showItem.value = item
detailInfoPopup.value.openPopup(item)
}
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus()
}
},
//
getScanResult(result) {
const { itemCode } = result.label
const { packingNumber } = result.label
const pack = result.package
const { batch } = result.label
const inventoryStatus = result.balance ? result.balance.inventoryStatus : 'OK'
const qty = result.balance ? result.balance.qty : 0
//
const items = this.allDetails.filter((r) => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus)
// ,
if (items.length == 0) {
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => {
//
if (res) {
const detail = this.createAddDetailInfo(pack, qty)
detail.countTime = new Date()
this.allDetails.push(detail)
this.updateList()
this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, null)
} else {
this.scanPopupGetFocus()
}
})
const remove = (item, index) => {
comMessage.value.showQuestionMessage('确定移除扫描信息?', res => {
if (res) {
item.scaned = false
item.handleQty = 0
emit('removePack')
}
})
}
const updateData = () => {}
const openScanPopup = () => {
const fromlocationList = [fromLocationCode.value]
scanPopup.value.openScanPopupForJob(fromLocationCode.value, fromlocationList, jobContent.value)
}
const closeScanPopup = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.closeScanPopup()
}
}
const scanPopupGetFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.packGetFocus()
}
}
const scanPopupLoseFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.packLoseFocus()
}
}
const getScanResult = (result) => {
const { itemCode, packingNumber, batch, inventoryStatus, qty } = result.label
const items = allDetails.value.filter(r => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus)
if (items.length === 0) {
comMessage.value.showQuestionMessage(`包装【${packingNumber}】不在任务列表中,是否要添加到列表中?`, res => {
if (res) {
const detail = createAddDetailInfo(result.package, qty)
detail.countTime = new Date()
allDetails.value.push(detail)
updateList()
countQtyEdit.value.openEditPopupShowSeconds(detail, null)
} else {
const selectItem = items[0]
//
if (selectItem.scaned) {
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => {
if (res) {
this.currentEditItem = selectItem
this.$refs.countQtyEdit.openEditPopup(selectItem, null)
} else {
this.scanPopupGetFocus()
}
})
} else {
//
selectItem.scaned = true
selectItem.balanceQty = Number(qty)
selectItem.handleQty = Number(qty)
selectItem.packQty = pack.packQty
selectItem.packUnit = pack.packUnit
this.$refs.countQtyEdit.openEditPopupShowSeconds(selectItem, null)
selectItem.countTime = new Date()
this.updateList()
}
}
},
editConfirm(qty, inventoryStatus, mode) {
const that = this
//
if (mode == 'edit') {
this.currentEditItem.handleQty = qty
this.currentEditItem.inventoryStatus = inventoryStatus
}
//
this.currentEditItem.countTime = new Date()
this.updateList()
this.scanPopupGetFocus()
},
updateList() {
this.allDetails.sort(compare('countTime')) //
this.initList()
this.scanPopupLoseFocus()
this.calcAllCount()
this.calcScanCount()
},
calcAllCount() {
this.allCount = this.allDetails.length
},
calcScanCount() {
this.scanCount = this.allDetails.filter((r) => r.scaned === true).length
},
editClose() {
this.scanPopupGetFocus()
},
//
createAddDetailInfo(pack, qty) {
const detail = {
masterId: this.jobContent.id, //
scaned: true,
countDetailNumber: '',
ownerCode: '',
packingNumber: pack.number,
containerNumber: '',
batch: pack.batch,
inventoryStatus: 'OK',
itemCode: pack.itemCode,
itemName: pack.itemName,
itemDesc1: pack.itemDesc1,
itemDesc2: pack.itemDesc2,
packQty: pack.packQty,
packUnit: pack.packUnit,
projectCode: '',
recommendQty: Number(qty),
qty: Number(qty),
handleQty: Number(qty),
uom: pack.uom,
number: pack.number,
remark: '',
countQty: 0,
balanceQty: 0,
fromLocationCode: this.fromLocationCode,
locationCode: this.fromLocationCode,
creator: this.$store.state.user.id,
countTime: new Date()
scanPopupGetFocus()
}
return detail
},
commit() {
this.calcAllCount()
this.calcScanCount()
if (this.scanCount == this.allCount) {
this.submitJob()
} else if (this.scanCount < this.allCount) {
//
if (this.jobContent.allowPartialComplete == 'TRUE') {
//
this.$refs.comMessage.showQuestionMessage(`已经扫描[${this.scanCount}]总共[${this.allCount}],是否把未扫描的盘点数量设置为0?`, (res) => {
if (res) {
this.allDetails.forEach((item) => {
if (!item.scaned) {
item.scaned = true
item.handleQty = 0
}
})
this.submitJob()
}
})
})
} else {
const selectItem = items[0]
if (selectItem.scaned) {
comMessage.value.showQuestionMessage(`包装【${packingNumber}】已经完成盘点,是否要编辑盘点结果?`, res => {
if (res) {
currentEditItem.value = selectItem
countQtyEdit.value.openEditPopup(selectItem, null)
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
if (res) {
this.openScanPopup()
}
})
scanPopupGetFocus()
}
}
},
submitJob() {
uni.showLoading({
title: '提交中....',
mask: true
})
const params = this.setParams()
console.log('提交参数', JSON.stringify(params))
countJobSubmit(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 {
selectItem.scaned = true
selectItem.balanceQty = Number(qty)
selectItem.handleQty = Number(qty)
selectItem.packQty = result.package.packQty
selectItem.packUnit = result.package.packUnit
countQtyEdit.value.openEditPopupShowSeconds(selectItem, null)
selectItem.countTime = new Date()
updateList()
}
}
}
const editConfirm = (qty, inventoryStatus, mode) => {
if (mode === 'edit') {
currentEditItem.value.handleQty = qty
currentEditItem.value.inventoryStatus = inventoryStatus
}
currentEditItem.value.countTime = new Date()
updateList()
scanPopupGetFocus()
}
setParams() {
const subList = []
const creator = this.$store.state.user.id
const updateList = () => {
allDetails.value.sort(compare('countTime'))
initList()
scanPopupLoseFocus()
calcAllCount()
calcScanCount()
}
this.allDetails.forEach((item) => {
if (item.scaned) {
item.countQty = item.handleQty
}
subList.push(item)
})
const calcAllCount = () => {
allCount.value = allDetails.value.length
}
const calcScanCount = () => {
scanCount.value = allDetails.value.filter(r => r.scaned === true).length
}
const editClose = () => {
scanPopupGetFocus()
}
this.jobContent.subList = subList
this.jobContent.creator = creator
return this.jobContent
},
const createAddDetailInfo = (pack, qty) => {
return {
masterId: jobContent.value.id,
scaned: true,
countDetailNumber: '',
ownerCode: '',
packingNumber: pack.number,
containerNumber: '',
batch: pack.batch,
inventoryStatus: 'OK',
itemCode: pack.itemCode,
itemName: pack.itemName,
itemDesc1: pack.itemDesc1,
itemDesc2: pack.itemDesc2,
packQty: pack.packQty,
packUnit: pack.packUnit,
projectCode: '',
recommendQty: Number(qty),
qty: Number(qty),
handleQty: Number(qty),
uom: pack.uom,
number: pack.number,
remark: '',
countQty: 0,
balanceQty: 0,
fromLocationCode: fromLocationCode.value,
locationCode: fromLocationCode.value,
creator: store.id,
countTime: new Date()
}
}
showMessage(message) {
this.$refs.comMessage.showMessage(message, (res) => {
const commit = () => {
calcAllCount()
calcScanCount()
if (scanCount.value === allCount.value) {
submitJob()
} else if (scanCount.value < allCount.value) {
if (jobContent.value.allowPartialComplete === 'TRUE') {
comMessage.value.showQuestionMessage(`已经扫描[${scanCount.value}]总共[${allCount.value}],是否把未扫描的盘点数量设置为0?`, res => {
if (res) {
this.afterCloseMessage()
allDetails.value.forEach(item => {
if (!item.scaned) {
item.scaned = true
item.handleQty = 0
}
})
submitJob()
}
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => {
} else {
comMessage.value.showErrorMessage(`请完成扫描后,再进行提交\n已经扫描[${scanCount.value}]总共[${allCount.value}]`, res => {
if (res) {
this.afterCloseMessage()
openScanPopup()
}
})
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message)
},
}
}
}
afterCloseMessage() {
this.scanPopupGetFocus()
},
const submitJob = () => {
uni.showLoading({ title: '提交中....', mask: true })
const params = setParams()
console.log('提交参数', JSON.stringify(params))
countJobSubmit(params)
.then(res => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功\n生成盘点记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
}
closeScanMessage() {
this.scanPopupGetFocus()
},
const setParams = () => {
const subList = []
const creator = store.id
allDetails.value.forEach(item => {
if (item.scaned) {
item.countQty = item.handleQty
}
subList.push(item)
})
jobContent.value.subList = subList
jobContent.value.creator = creator
return jobContent.value
}
editItem(item) {
this.currentEditItem = item
this.$refs.countQtyEdit.openEditPopup(this.currentEditItem, null)
},
const showMessage = (message) => {
comMessage.value.showMessage(message, res => {
if (res) {
afterCloseMessage()
}
})
}
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, (res) => {
navigateBack(1)
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == 'TRUE' ? '明盘' : '盲盘'
const showErrorMessage = (message) => {
comMessage.value.showErrorMessage(message, res => {
if (res) {
afterCloseMessage()
}
}
})
}
const showScanMessage = (message) => {
comMessage.value.showScanMessage(message)
}
const afterCloseMessage = () => {
scanPopupGetFocus()
}
const closeScanMessage = () => {
scanPopupGetFocus()
}
const editItem = (item) => {
currentEditItem.value = item
countQtyEdit.value.openEditPopup(currentEditItem.value, null)
}
const showCommitSuccessMessage = (hint) => {
comMessage.value.showSuccessMessage(hint, res => {
navigateBack(1)
})
}
const getCountStageName = (value) => {
return getCountStageName(value)
}
const isOpenCount = (value) => {
return value === 'TRUE' ? '明盘' : '盲盘'
}
</script>

779
src/pages/count/job/countDetail1.vue

@ -34,15 +34,15 @@
<u-line color="#D8D8D8" style="margin-bottom: 15rpx"></u-line>
<scroll-view scroll-y="true" class="" style="margin-bottom: 50px">
<view class="detail-list" v-for="(item, index) in showList" :key="item.id">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event, item)" :right-options="item.scaned ? scanOptions : detailOptions">
<view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'">
<view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view>
<comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" @updateData="updateData"> </comCountDetailcards>
</view>
<view class="split_line"></view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-swipe-action ref="swipeAction"
:options="item.scaned ? scanOptions : detailOptions"
@click="(...event)=>swipeClick(event, item)">
<view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'">
<view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view>
<comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" @updateData="updateData"> </comCountDetailcards>
</view>
<view class="split_line"></view>
</u-swipe-action>
</view>
</scroll-view>
<uni-load-more :status="loadingType" v-if="showList.length > 0" />
@ -65,7 +65,7 @@
</view>
</template>
<script>
<script setup>
import { Decimal } from 'decimal.js' //
import { getCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js'
import { calc } from '@/common/calc.js'
@ -83,446 +83,383 @@ import countQtyEdit from '@/mycomponents/qty/countQtyEdit.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import detailInfoPopup from '@/pages/count/coms/detailInfoPopup.vue'
export default {
name: 'receipt_detail',
components: {
winScanButton,
winScanPack,
comCountDetailcards,
winScanPackAndLocation,
countQtyEdit,
jobTop,
detailInfoPopup
},
data() {
return {
id: '',
receiptJob: {},
fromLocationCode: '',
isShowPackingCode: true,
jobContent: {}, //
subList: [], // subList
detailSource: [], //
balance: {}, //
editInventoryStatus: false,
package: {}, //
label: {}, //
currentEditItem: {},
jobStatus: '',
allCount: 0,
scanCount: 0,
index: 0,
pageSize: 20,
showList: [],
loadingType: '',
allDetails: [],
scanOptions: [],
detailOptions: []
}
},
onLoad(option) {
this.id = option.id
if (this.id != undefined) {
//
if (option.status == '1') {
this.receive((callback) => {
this.getDetail()
})
} else {
this.getDetail()
}
}
this.detailOptions = getDetailOption()
this.scanOptions = getDetailEditRemoveOption()
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome()
}
},
//
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.jobStatus == '2') {
//
cancleTakeCountJob(this.id)
.then((res) => {
uni.navigateBack()
})
.catch((error) => {
uni.navigateBack()
})
} else {
uni.navigateBack()
}
return true
}
},
onPullDownRefresh() {
this.initList()
uni.stopPullDownRefresh()
},
mounted() {},
onReachBottom() {
console.log('onReachBottom')
//
if (this.loadingType == 'nomore') {
return
import { ref, onMounted } from 'vue'
import { onLoad, onPullDownRefresh, onReachBottom, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app'
import { useCountStore } from '@/store'
const store = useCountStore()
const id = ref(null)
const jobStatus = ref('')
const detailOptions = ref(getDetailOption())
const scanOptions = ref(getDetailEditRemoveOption())
const loadingType = ref('')
const index = ref(1)
const showList = ref([])
const allDetails = ref([])
const allCount = ref(0)
const fromLocationCode = ref('')
const jobContent = ref({})
const currentEditItem = ref(null)
const showItem = ref(null)
const detailInfoPopup = ref(null)
const scanPopup = ref(null)
const comMessage = ref(null)
const countQtyEdit = ref(null)
onLoad(option => {
id.value = option.id
if (id.value !== undefined) {
if (option.status === '1') {
receive(() => getDetail())
} else {
getDetail()
}
this.index++
const list = this.getDataPage(this.index, this.pageSize)
if (list.length > 0) {
// this.showList=list
this.showList = this.showList.concat(list)
}
detailOptions.value = getDetailOption()
scanOptions.value = getDetailEditRemoveOption()
})
onNavigationBarButtonTap(e => {
if (e.index === 0) {
goHome()
}
})
onBackPress(e => {
if (e.from === 'backbutton') {
if (jobStatus.value === '2') {
cancleTakeCountJob(id.value)
.then(() => uni.navigateBack())
.catch(() => uni.navigateBack())
} else {
//
this.loadingType = 'nomore'
uni.navigateBack()
}
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeCountJob(this.id)
.then((res) => {
callback()
})
.catch((error) => {
this.showErrorMessage(error)
})
}
},
return true
}
})
onPullDownRefresh(() => {
initList()
uni.stopPullDownRefresh()
})
onReachBottom(() => {
console.log('onReachBottom')
if (loadingType.value === 'nomore') return
index.value++
const list = getDataPage(index.value, pageSize)
if (list.length > 0) {
showList.value = showList.value.concat(list)
} else {
loadingType.value = 'nomore'
}
})
getDetail() {
const that = this
uni.showLoading({
title: '加载中....',
mask: true
})
getCountJobDetail(that.id)
.then((res) => {
uni.hideLoading()
if (res.data == null) {
that.showMessage('未获取到详情')
} else {
that.jobContent = res.data
that.jobStatus = res.data.status
that.fromLocationCode = that.jobContent.locationCode
res.data.subList.forEach((item) => {
item.recommendQty = item.qty
item.handleQty = 0
item.countTime = new Date()
item.fromLocationCode = that.fromLocationCode
})
that.allDetails = res.data.subList
that.allCount = res.data.subList.length
that.initList()
}
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
const receive = (callback) => {
if (id.value !== null) {
takeCountJob(id.value)
.then(callback)
.catch(error => showErrorMessage(error))
}
}
const getDetail = () => {
uni.showLoading({ title: '加载中....', mask: true })
getCountJobDetail(id.value)
.then(res => {
uni.hideLoading()
if (res.data === null) {
showMessage('未获取到详情')
} else {
jobContent.value = res.data
jobStatus.value = res.data.status
fromLocationCode.value = jobContent.value.locationCode
res.data.subList.forEach(item => {
item.recommendQty = item.qty
item.handleQty = 0
item.countTime = new Date()
item.fromLocationCode = fromLocationCode.value
})
},
initList() {
this.index = 1
this.showList = []
this.loadingType = ''
this.showList = this.getDataPage(this.index, this.pageSize)
},
getDataPage(pageNo, pageSize) {
//
const totalPages = Math.ceil(this.allCount / pageSize)
//
const start = (pageNo - 1) * pageSize
const end = start + pageSize //
return this.allDetails.slice(start, end)
},
swipeClick(e, item) {
if (e.content.text == '详情') {
this.detail(item)
} else if (e.content.text == '编辑') {
this.editItem(item)
} else if (e.content.text == '移除') {
this.remove(item)
allDetails.value = res.data.subList
allCount.value = res.data.subList.length
initList()
}
},
detail(item) {
this.showItem = item
this.$refs.detailInfoPopup.openPopup(item)
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.handleQty = 0
this.$emit('removePack')
}
})
},
})
.catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
}
updateData() {},
const initList = () => {
index.value = 1
showList.value = []
loadingType.value = ''
showList.value = getDataPage(index.value, pageSize)
}
openScanPopup() {
const fromlocationList = []
fromlocationList.push(this.fromLocationCode)
this.$refs.scanPopup.openScanPopupForJob(this.fromLocationCode, fromlocationList, this.jobContent)
},
const getDataPage = (pageNo, pageSize) => {
const totalPages = Math.ceil(allCount.value / pageSize)
const start = (pageNo - 1) * pageSize
const end = start + pageSize
return allDetails.value.slice(start, end)
}
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup()
}
},
const swipeClick = (e, item) => {
if (e.content.text === '详情') {
detail(item)
} else if (e.content.text === '编辑') {
editItem(item)
} else if (e.content.text === '移除') {
remove(item)
}
}
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus()
}
},
const detail = (item) => {
showItem.value = item
detailInfoPopup.value.openPopup(item)
}
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus()
}
},
//
getScanResult(result) {
const { itemCode } = result.label
const { packingNumber } = result.label
const pack = result.package
const { batch } = result.label
const inventoryStatus = result.balance ? result.balance.inventoryStatus : 'OK'
const qty = result.balance ? result.balance.qty : 0
//
const items = this.allDetails.filter((r) => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus)
// ,
if (items.length == 0) {
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => {
//
if (res) {
const detail = this.createAddDetailInfo(pack)
detail.countTime = new Date()
this.allDetails.push(detail)
this.updateList()
this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, null)
} else {
this.scanPopupGetFocus()
}
})
const remove = (item, index) => {
comMessage.value.showQuestionMessage('确定移除扫描信息?', res => {
if (res) {
item.scaned = false
item.handleQty = 0
emit('removePack')
}
})
}
const updateData = () => {}
const openScanPopup = () => {
const fromlocationList = [fromLocationCode.value]
scanPopup.value.openScanPopupForJob(fromLocationCode.value, fromlocationList, jobContent.value)
}
const closeScanPopup = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.closeScanPopup()
}
}
const scanPopupGetFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.packGetFocus()
}
}
const scanPopupLoseFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.packLoseFocus()
}
}
const getScanResult = (result) => {
const { itemCode, packingNumber, batch, inventoryStatus, qty } = result.label
const items = allDetails.value.filter(r => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus)
if (items.length === 0) {
comMessage.value.showQuestionMessage(`包装【${packingNumber}】不在任务列表中,是否要添加到列表中?`, res => {
if (res) {
const detail = createAddDetailInfo(result.package)
detail.countTime = new Date()
allDetails.value.push(detail)
updateList()
countQtyEdit.value.openEditPopupShowSeconds(detail, null)
} else {
const selectItem = items[0]
//
if (selectItem.scaned) {
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => {
if (res) {
this.currentEditItem = selectItem
this.$refs.countQtyEdit.openEditPopup(selectItem, null)
} else {
this.scanPopupGetFocus()
}
})
} else {
//
selectItem.scaned = true
selectItem.handleQty = Number(qty)
selectItem.packQty = pack.packQty
selectItem.packUnit = pack.packUnit
this.$refs.countQtyEdit.openEditPopupShowSeconds(selectItem, null)
selectItem.countTime = new Date()
this.updateList()
}
scanPopupGetFocus()
}
},
editConfirm(qty, inventoryStatus, mode) {
const that = this
//
if (mode == 'edit') {
this.currentEditItem.handleQty = qty
this.currentEditItem.inventoryStatus = inventoryStatus
}
//
this.currentEditItem.countTime = new Date()
this.updateList()
this.scanPopupGetFocus()
},
updateList() {
this.allDetails.sort(compare('countTime')) //
this.initList()
this.scanPopupLoseFocus()
this.calcAllCount()
this.calcScanCount()
},
calcAllCount() {
this.allCount = this.allDetails.length
},
calcScanCount() {
this.scanCount = this.allDetails.filter((r) => r.scaned === true).length
},
editClose() {
this.scanPopupGetFocus()
},
//
createAddDetailInfo(pack) {
const detail = {
id: this.jobContent.masterId, //
scaned: true,
countDetailNumber: '',
ownerCode: '',
packingNumber: pack.number,
containerNumber: '',
batch: pack.batch,
inventoryStatus: 'OK',
itemCode: pack.itemCode,
itemName: pack.itemName,
itemDesc1: pack.itemDesc1,
itemDesc2: pack.itemDesc2,
packQty: pack.packQty,
packUnit: pack.packUnit,
projectCode: '',
qty: 0,
handleQty: 0,
uom: pack.uom,
number: pack.number,
remark: '',
countQty: 0,
balanceQty: 0,
fromLocationCode: this.fromLocationCode,
creator: this.$store.state.user.id,
countTime: new Date()
}
return detail
},
commit() {
this.calcAllCount()
this.calcScanCount()
if (this.scanCount == this.allCount) {
this.submitJob()
} else if (this.scanCount < this.allCount) {
//
if (this.jobContent.allowPartialComplete == 'TRUE') {
//
this.$refs.comMessage.showQuestionMessage(`已经扫描[${this.scanCount}]总共[${this.allCount}],是否把未扫描的盘点数量设置为0?`, (res) => {
if (res) {
this.allDetails.forEach((item) => {
if (!item.scaned) {
item.scaned = true
item.handleQty = 0
}
})
this.submitJob()
}
})
})
} else {
const selectItem = items[0]
if (selectItem.scaned) {
comMessage.value.showQuestionMessage(`包装【${packingNumber}】已经完成盘点,是否要编辑盘点结果?`, res => {
if (res) {
currentEditItem.value = selectItem
countQtyEdit.value.openEditPopup(selectItem, null)
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
if (res) {
this.openScanPopup()
}
})
scanPopupGetFocus()
}
}
},
submitJob() {
uni.showLoading({
title: '提交中....',
mask: true
})
const params = this.setParams()
console.log('提交参数', JSON.stringify(params))
// countJobSubmit(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)
// })
},
setParams() {
const subList = []
const creator = this.$store.state.user.id
this.allDetails.forEach((item) => {
if (item.scaned) {
item.countQty = item.handleQty
}
subList.push(item)
})
} else {
selectItem.scaned = true
selectItem.handleQty = Number(qty)
selectItem.packQty = result.package.packQty
selectItem.packUnit = result.package.packUnit
countQtyEdit.value.openEditPopupShowSeconds(selectItem, null)
selectItem.countTime = new Date()
updateList()
}
}
}
this.jobContent.subList = subList
this.jobContent.creator = creator
return this.jobContent
},
const editConfirm = (qty, inventoryStatus, mode) => {
if (mode === 'edit') {
currentEditItem.value.handleQty = qty
currentEditItem.value.inventoryStatus = inventoryStatus
}
currentEditItem.value.countTime = new Date()
updateList()
scanPopupGetFocus()
}
const updateList = () => {
allDetails.value.sort(compare('countTime'))
initList()
scanPopupLoseFocus()
calcAllCount()
calcScanCount()
}
const calcAllCount = () => {
allCount.value = allDetails.value.length
}
const calcScanCount = () => {
scanCount.value = allDetails.value.filter(r => r.scaned === true).length
}
showMessage(message) {
this.$refs.comMessage.showMessage(message, (res) => {
const editClose = () => {
scanPopupGetFocus()
}
const createAddDetailInfo = (pack) => {
return {
id: jobContent.value.masterId,
scaned: true,
countDetailNumber: '',
ownerCode: '',
packingNumber: pack.number,
containerNumber: '',
batch: pack.batch,
inventoryStatus: 'OK',
itemCode: pack.itemCode,
itemName: pack.itemName,
itemDesc1: pack.itemDesc1,
itemDesc2: pack.itemDesc2,
packQty: pack.packQty,
packUnit: pack.packUnit,
projectCode: '',
qty: 0,
handleQty: 0,
uom: pack.uom,
number: pack.number,
remark: '',
countQty: 0,
balanceQty: 0,
fromLocationCode: fromLocationCode.value,
creator: store.id,
countTime: new Date()
}
}
const commit = () => {
calcAllCount()
calcScanCount()
if (scanCount.value === allCount.value) {
submitJob()
} else if (scanCount.value < allCount.value) {
if (jobContent.value.allowPartialComplete === 'TRUE') {
comMessage.value.showQuestionMessage(`已经扫描[${scanCount.value}]总共[${allCount.value}],是否把未扫描的盘点数量设置为0?`, res => {
if (res) {
this.afterCloseMessage()
allDetails.value.forEach(item => {
if (!item.scaned) {
item.scaned = true
item.handleQty = 0
}
})
submitJob()
}
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => {
} else {
comMessage.value.showErrorMessage(`请完成扫描后,再进行提交\n已经扫描[${scanCount.value}]总共[${allCount.value}]`, res => {
if (res) {
this.afterCloseMessage()
openScanPopup()
}
})
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message)
},
}
}
}
afterCloseMessage() {
this.scanPopupGetFocus()
},
const submitJob = () => {
uni.showLoading({ title: '提交中....', mask: true })
const params = setParams()
console.log('提交参数', JSON.stringify(params))
countJobSubmit(params)
.then(res => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功\n生成盘点记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
}
closeScanMessage() {
this.scanPopupGetFocus()
},
const setParams = () => {
const subList = []
const creator = store.id
allDetails.value.forEach(item => {
if (item.scaned) {
item.countQty = item.handleQty
}
subList.push(item)
})
jobContent.value.subList = subList
jobContent.value.creator = creator
return jobContent.value
}
editItem(item) {
this.currentEditItem = item
this.$refs.countQtyEdit.openEditPopup(this.currentEditItem, null)
},
const showMessage = (message) => {
comMessage.value.showMessage(message, res => {
if (res) {
afterCloseMessage()
}
})
}
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, (res) => {
navigateBack(1)
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == 'TRUE' ? '明盘' : '盲盘'
const showErrorMessage = (message) => {
comMessage.value.showErrorMessage(message, res => {
if (res) {
afterCloseMessage()
}
}
})
}
const showScanMessage = (message) => {
comMessage.value.showScanMessage(message)
}
const afterCloseMessage = () => {
scanPopupGetFocus()
}
const closeScanMessage = () => {
scanPopupGetFocus()
}
const editItem = (item) => {
currentEditItem.value = item
countQtyEdit.value.openEditPopup(currentEditItem.value, null)
}
const showCommitSuccessMessage = (hint) => {
comMessage.value.showSuccessMessage(hint, res => {
navigateBack(1)
})
}
const getCountStageName = (value) => {
return getCountStageName(value)
}
const isOpenCount = (value) => {
return value === 'TRUE' ? '明盘' : '盲盘'
}
</script>

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

@ -4,8 +4,8 @@
<view class="header_job_top">
<view class="header-view">
<job-top :dataContent="jobContent"></job-top>
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<u-collapse ref="collapse">
<u-collapse-item :open="true">
<template v-slot:title>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx"> 盘点范围 </view>
</template>
@ -15,8 +15,8 @@
<text class="card_content">{{ range.value }}</text>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</u-collapse-item>
</u-collapse>
</view>
</view>
<view class="card_view" v-if="fromLocationCode != ''">
@ -27,16 +27,17 @@
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<uni-swipe-action ref="swipeAction">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<uni-swipe-action-item @click="swipeClick($event, item, index)" :right-options="editRemoveOption">
<view class="">
<package-and-item-card :dataContent="item"></package-and-item-card>
</view>
<view class="split_line"></view>
</uni-swipe-action-item>
<u-swipe-action ref="swipeAction"
v-for="(item, index) in detailSource" :key="item.id"
:options="editRemoveOption"
@click="(...event)=>swipeClick(event, item, index)">
<view class="detail-list">
<view class="">
<package-and-item-card :dataContent="item"></package-and-item-card>
</view>
<view class="split_line"></view>
</view>
</uni-swipe-action>
</u-swipe-action>
</scroll-view>
</view>
@ -63,7 +64,7 @@
</view>
</template>
<script>
<script setup>
import { Decimal } from 'decimal.js' //
import { getFuuzyCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js'
import { calc } from '@/common/calc.js'
@ -84,453 +85,405 @@ import jobTop from '@/mycomponents/job/jobTop.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue'
export default {
name: 'fuzzycountdetail',
components: {
winScanButton,
winScanPack,
comCountDetailCard,
// winScanPackAndLocation,
winScanLocation,
countQtyEdit,
jobTop,
comBlankView,
PackageAndItemCard
},
data() {
return {
id: '',
scanCount: 0,
jobContent: {}, //
subList: [], // subList
detailSource: [], //
balance: {}, //
editInventoryStatus: false,
package: {}, //
label: {}, //
currentEditItem: {},
jobStatus: '',
fromLocation: {},
fromLocationCode: '',
editRemoveOption: [],
itemRangeValue: ''
}
},
onLoad(option) {
this.id = option.id
if (this.id != undefined) {
//
if (option.status == '1') {
this.receive((callback) => {
this.getDetail((r) => {
this.showFromLocationPopup()
})
})
} else {
this.getDetail((r) => {
this.showFromLocationPopup()
})
}
import { ref, nextTick } from 'vue'
import { onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app'
import {useCountStore} from '@/store'
const store = useCountStore()
const id = ref(null)
const jobStatus = ref('')
const editRemoveOption = ref(getEditRemoveOption())
const jobContent = ref({})
const itemRangeValue = ref('')
const fromLocation = ref({})
const fromLocationCode = ref('')
const detailSource = ref([])
const managementList = ref([])
const managementType = ref('')
const currentEditItem = ref(null)
const showItem = ref(null)
const scanLocationCode = ref(null)
const scanPopup = ref(null)
const comMessage = ref(null)
const countQtyEdit = ref(null)
const detailInfoPopup = ref(null)
onLoad(option => {
id.value = option.id
if (id.value !== undefined) {
if (option.status === '1') {
receive(() => getDetail(() => showFromLocationPopup()))
} else {
getDetail(() => showFromLocationPopup())
}
this.editRemoveOption = getEditRemoveOption()
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome()
}
editRemoveOption.value = getEditRemoveOption()
})
onNavigationBarButtonTap(e => {
if (e.index === 0) {
goHome()
}
})
onBackPress(e => {
if (e.from === 'backbutton') {
if (jobStatus.value === '2') {
cancleTakeCountJob(id.value)
.then(() => uni.navigateBack())
.catch(() => uni.navigateBack())
} else {
uni.navigateBack()
}
},
//
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.jobStatus == '2') {
//
cancleTakeCountJob(this.id)
.then((res) => {
uni.navigateBack()
})
.catch((error) => {
uni.navigateBack()
})
} else {
uni.navigateBack()
return true
}
})
onPullDownRefresh(() => {
// uni.stopPullDownRefresh();
})
const receive = (callback) => {
if (id.value !== null) {
takeCountJob(id.value)
.then(callback)
.catch(error => showErrorMessage(error))
}
}
const getDetail = (callback) => {
uni.showLoading({ title: '加载中....', mask: true })
getFuuzyCountJobDetail(id.value)
.then(res => {
uni.hideLoading()
jobContent.value = res.data
jobStatus.value = res.data.status
const range = jobContent.value.countRange.find(r => r.type === 'ITEM_CODE')
if (range !== undefined) {
itemRangeValue.value = range.value
}
return true
}
},
onPullDownRefresh() {
// uni.stopPullDownRefresh();
},
mounted() {},
methods: {
//
receive(callback) {
if (this.id != null) {
takeCountJob(this.id)
.then((res) => {
callback()
})
.catch((error) => {
this.showErrorMessage(error)
})
callback()
})
.catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
}
const showFromLocationPopup = () => {
// this.$refs.scanLocationCode.openScanPopup();
nextTick(() => {
scanLocationCode.value.openScanPopup()
})
}
const getLocation = (location, code) => {
const { countRange } = jobContent.value
if (countRange !== null) {
let range = countRange.find(r => r.type === 'LOCATION_CODE')
if (range !== undefined) {
const rangeValue = range.value
const index = rangeValue.indexOf(location.code)
if (index < 0) {
afterScanLocation(`库位代码【${location.code}】,不在盘点库位范围【${rangeValue}】内`)
return
}
},
getDetail(callback) {
const that = this
uni.showLoading({
title: '加载中....',
mask: true
})
getFuuzyCountJobDetail(that.id)
.then((res) => {
uni.hideLoading()
that.jobContent = res.data
that.jobStatus = res.data.status
const range = that.jobContent.countRange.find((r) => r.type == 'ITEM_CODE')
if (range != undefined) {
that.itemRangeValue = range.value
}
callback()
})
.catch((error) => {
uni.hideLoading()
that.showErrorMessage(error)
})
},
showFromLocationPopup() {
const as = ''
// this.$refs.scanLocationCode.openScanPopup();
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup()
})
},
getLocation(location, code) {
const { countRange } = this.jobContent
if (countRange != null) {
let range = countRange.find((r) => r.type == 'LOCATION_CODE')
if (range != undefined) {
} else {
range = countRange.find(r => r.type === 'LOCATIONGROUP_CODE')
if (range !== undefined) {
const rangeValue = range.value
const index = rangeValue.indexOf(location.locationGroupCode)
if (index < 0) {
afterScanLocation(`库位组代码【${location.locationGroupCode}】,不在盘点库位组范围【${rangeValue}】内`)
return
}
} else {
range = countRange.find(r => r.type === 'AREABASIC_CODE')
if (range !== undefined) {
const rangeValue = range.value
const index = rangeValue.indexOf(location.code)
const index = rangeValue.indexOf(location.areaCode)
if (index < 0) {
this.afterScanLocation(`代码【${location.code}】,不在盘点库位范围【${rangeValue}】内`)
afterScanLocation(`库区代码【${location.areaCode}】,不在盘点库区范围【${rangeValue}】内`)
return
}
} else {
range = countRange.find((r) => r.type == 'LOCATIONGROUP_CODE')
if (range != undefined) {
range = countRange.find(r => r.type === 'WAREHOUSE_CODE')
if (range !== undefined) {
const rangeValue = range.value
const index = rangeValue.indexOf(location.locationGroupCode)
const index = rangeValue.indexOf(location.warehouseCode)
if (index < 0) {
this.afterScanLocation(`位组代码【${location.locationGroupCode}】,不在盘点库位组范围【${rangeValue}】内`)
afterScanLocation(`仓库代码【${location.warehouseCode}】,不在盘点仓库范围【${rangeValue}】内`)
return
}
} else {
range = countRange.find((r) => r.type == 'AREABASIC_CODE')
if (range != undefined) {
const rangeValue = range.value
const index = rangeValue.indexOf(location.areaCode)
if (index < 0) {
this.afterScanLocation(`库区代码【${location.areaCode}】,不在盘点库区范围【${rangeValue}】内`)
return
}
} else {
range = countRange.find((r) => r.type == 'WAREHOUSE_CODE')
if (range != undefined) {
const rangeValue = range.value
const index = rangeValue.indexOf(location.warehouseCode)
if (index < 0) {
this.afterScanLocation(`仓库代码【${location.warehouseCode}】,不在盘点仓库范围【${rangeValue}】内`)
return
}
}
}
}
}
}
this.getFromLocationCode(location, code)
},
afterScanLocation(message) {
this.showErrorMessage(message)
this.showFromLocationPopup()
},
getFromLocationCode(location, code) {
this.fromLocation = location
this.fromLocationCode = code
this.openScanPopup()
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup()
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus()
}
},
}
}
getFromLocationCode(location, code)
}
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup()
}
},
const afterScanLocation = (message) => {
showErrorMessage(message)
showFromLocationPopup()
}
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus()
}
},
const getFromLocationCode = (location, code) => {
fromLocation.value = location
fromLocationCode.value = code
openScanPopup()
}
getScanResult(result) {
const that = this
const packInfo = result.package
if (this.itemRangeValue != '') {
const index = this.itemRangeValue.indexOf(packInfo.itemCode)
if (index < 0) {
this.showErrorMessage(`物料代码【${packInfo.itemCode}】,不在盘点范围【${this.itemRangeValue}】内`)
const openScanPopup = () => {
scanPopup.value.openScanPopup()
}
const scanPopupGetFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.getfocus()
}
}
const closeScanPopup = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.closeScanPopup()
}
}
const scanPopupLoseFocus = () => {
if (scanPopup.value !== undefined) {
scanPopup.value.losefocus()
}
}
const getScanResult = (result) => {
const packInfo = result.package
if (itemRangeValue.value !== '') {
const index = itemRangeValue.value.indexOf(packInfo.itemCode)
if (index < 0) {
showErrorMessage(`物料代码【${packInfo.itemCode}】,不在盘点范围【${itemRangeValue.value}】内`)
} else {
onScan(packInfo)
}
} else {
onScan(packInfo)
}
}
const onScan = async (packInfo) => {
console.log(packInfo)
//
await getManagementPrecisions([packInfo.itemCode], packInfo.toLocationCode, res => {
if (res.success) {
managementList.value = res.list
managementType.value = managementList.value.some(item => item.ManagementPrecision === 'BY_BATCH') ? 'BY_BATCH' : ''
if (managementType.value === 'BY_BATCH') {
let detail = detailSource.value.find(r => r.itemCode === packInfo.itemCode && r.batch === packInfo.batch && r.inventoryStatus === 'OK')
if (detail === undefined) {
detail = createDetailInfo(packInfo)
detail.packingNumber = ''
detail.packUnit = ''
detailSource.value.unshift(detail)
scanPopupGetFocus()
} else {
this.onScan(packInfo)
let index = detailSource.value.findIndex(r => r.itemCode === packInfo.itemCode && r.batch === packInfo.batch && r.inventoryStatus === 'OK')
if (index >= 0) {
detailSource.value.unshift(detailSource.value.splice(index, 1)[0]) //
detailSource.value[0].qty = calc.add(detailSource.value[0].qty, packInfo.qty)
}
}
} else {
this.onScan(packInfo)
}
},
async onScan(packInfo) {
console.log(packInfo)
//\
await getManagementPrecisions([packInfo.itemCode], packInfo.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
if (this.managementType == 'BY_BATCH') {
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.batch == packInfo
.batch && r.inventoryStatus == "OK");
if (detail == undefined) {
detail = this.createDetailInfo(packInfo);
detail.packingNumber = ''
detail.packUnit = ''
this.detailSource.unshift(detail)
this.scanPopupGetFocus();
} else {
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.batch == packInfo
.batch && r.inventoryStatus == "OK");
if (index >= 0) {
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //
this.detailSource[0].qty = calc.add(this.detailSource[0].qty, packInfo.qty)
}
}
} else {
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber ==
packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == "OK");
if (detail == undefined) {
detail = this.createDetailInfo(packInfo);
this.detailSource.unshift(detail)
this.scanPopupGetFocus();
} else {
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.packingNumber ==
packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == "OK");
if (index >= 0) {
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //
//
this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => {
if (res) {
this.closeScanPopup();
this.edit(detail);
} else {
this.scanPopupGetFocus();
}
});
let detail = detailSource.value.find(r => r.itemCode === packInfo.itemCode && r.packingNumber === packInfo.number && r.batch === packInfo.batch && r.inventoryStatus === 'OK')
if (detail === undefined) {
detail = createDetailInfo(packInfo)
detailSource.value.unshift(detail)
scanPopupGetFocus()
} else {
let index = detailSource.value.findIndex(r => r.itemCode === packInfo.itemCode && r.packingNumber === packInfo.number && r.batch === packInfo.batch && r.inventoryStatus === 'OK')
if (index >= 0) {
detailSource.value.unshift(detailSource.value.splice(index, 1)[0]) //
//
comMessage.value.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => {
if (res) {
closeScanPopup()
edit(detail)
} else {
scanPopupGetFocus()
}
}
})
}
}
})
},
//
createDetailInfo(packInfo) {
const detail = {
scaned: true,
// countDetailNumber: "",
number: this.jobContent.number,
packingNumber: packInfo.number,
batch: packInfo.batch,
inventoryStatus: 'OK',
itemCode: packInfo.itemCode,
itemName: packInfo.itemName,
itemDesc1: packInfo.itemDesc1,
itemDesc2: packInfo.itemDesc2,
projectCode: '',
qty: packInfo.qty,
packUnit: packInfo.packUnit,
packQty: packInfo.packQty,
packUom: packInfo.packUom,
uom: packInfo.uom,
remark: '',
locationCode: this.fromLocationCode,
creator: this.$store.state.user.id,
warehouseCode: this.fromLocation.warehouseCode,
areaCode: this.fromLocation.areaCode,
locationGroupCode: this.fromLocation.locationGroupCode,
createTime: new Date().getTime(),
countTime: new Date().getTime(),
countUser: this.$store.state.user.id,
countDescription: '',
countQty: packInfo.qty
}
return detail
},
swipeClick(e, item, index) {
if (e.content.text == '编辑') {
this.edit(item)
} else if (e.content.text == '移除') {
this.remove(item)
}
})
}
const createDetailInfo = (packInfo) => {
return {
scaned: true,
number: jobContent.value.number,
packingNumber: packInfo.number,
batch: packInfo.batch,
inventoryStatus: 'OK',
itemCode: packInfo.itemCode,
itemName: packInfo.itemName,
itemDesc1: packInfo.itemDesc1,
itemDesc2: packInfo.itemDesc2,
projectCode: '',
qty: packInfo.qty,
packUnit: packInfo.packUnit,
packQty: packInfo.packQty,
packUom: packInfo.packUom,
uom: packInfo.uom,
remark: '',
locationCode: fromLocationCode.value,
creator: store.id,
warehouseCode: fromLocation.value.warehouseCode,
areaCode: fromLocation.value.areaCode,
locationGroupCode: fromLocation.value.locationGroupCode,
createTime: new Date().getTime(),
countTime: new Date().getTime(),
countUser: store.id,
countDescription: '',
countQty: packInfo.qty
}
}
const swipeClick = (e, item, index) => {
if (e.content.text === '编辑') {
edit(item)
} else if (e.content.text === '移除') {
remove(item, index)
}
}
const edit = (item) => {
currentEditItem.value = item
item.handleQty = item.qty
countQtyEdit.value.openEditPopup(item, null)
}
const editConfirm = (qty, inventoryStatus, mode) => {
currentEditItem.value.countQty = qty
currentEditItem.value.qty = qty
currentEditItem.value.inventoryStatus = inventoryStatus
openScanPopup()
}
const editClose = () => {
scanPopupGetFocus()
}
const remove = (item, index) => {
scanPopupLoseFocus()
comMessage.value.showQuestionMessage('是否要移除扫描信息?', res => {
if (res) {
detailSource.value.splice(index, 1)
}
scanPopupGetFocus()
})
}
const detail = (item) => {
showItem.value = item
detailInfoPopup.value.openPopup(item)
}
const commit = () => {
if (detailSource.value.length === 0) {
comMessage.value.showMessage('还未扫描,是否要继续提交', res => {
if (res) {
commitJob()
}
},
//
edit(item) {
const that = this
this.currentEditItem = item
item.handleQty = item.qty
this.$refs.countQtyEdit.openEditPopup(item, null)
},
editConfirm(qty, inventoryStatus, mode) {
const that = this
this.currentEditItem.countQty = qty
this.currentEditItem.qty = qty
this.currentEditItem.inventoryStatus = inventoryStatus
this.openScanPopup()
},
editClose() {
this.scanPopupGetFocus()
},
remove(item, index) {
this.scanPopupLoseFocus();
this.showQuestionMessage('是否要移除扫描信息?', (res) => {
if (res) {
this.detailSource.splice(index, 1)
}
this.scanPopupGetFocus();
})
},
detail(item) {
this.showItem = item
this.$refs.detailInfoPopup.openPopup(item)
},
commit() {
if (this.detailSource.length == 0) {
this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', (res) => {
if (res) {
this.commitJob()
}
})
})
} else {
commitJob()
}
}
const commitJob = () => {
uni.showLoading({ title: '提交中....', mask: true })
const params = setParams()
console.log('提交参数', JSON.stringify(params))
countJobSubmit(params)
.then(res => {
uni.hideLoading()
if (res.data === null) {
showCommitSuccessMessage('提交成功')
} else {
this.commitJob()
showErrorMessage(`提交失败[${res.msg}]`)
}
},
commitJob() {
uni.showLoading({
title: '提交中....',
mask: true
})
const params = this.setParams()
console.log('提交参数', JSON.stringify(params))
countJobSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data == null) {
this.showCommitSuccessMessage('提交成功')
} else {
this.showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
const creator = this.$store.state.user.id
this.jobContent.subList = this.detailSource
// this.jobContent.creator = creator;
return this.jobContent
},
showMessage(message) {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, (res) => {
if (res) {
this.afterCloseMessage()
}
})
},
showErrorMessage(message) {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) {
this.afterCloseMessage()
}
})
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message)
},
afterCloseMessage() {
this.scanPopupGetFocus()
},
closeScanMessage() {
this.scanPopupGetFocus()
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, (res) => {
this.fromLocationCode = ''
this.fromLocation = {}
this.detailSource = []
this.showFromLocationPopup()
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == 'TRUE' ? '明盘' : '盲盘'
},
getCountScopeName(value) {
const item = getCountScopeType(value)
return item.label
},
showQuestionMessage(message, callback) {
this.$refs.comMessage.showQuestionMessage(message, (res) => {
callback(res)
})
})
.catch(error => {
uni.hideLoading()
showErrorMessage(error)
})
}
const setParams = () => {
const creator = store.id
jobContent.value.subList = detailSource.value
// jobContent.value.creator = creator;
return jobContent.value
}
const showMessage = (message) => {
scanPopupLoseFocus()
comMessage.value.showMessage(message, res => {
if (res) {
afterCloseMessage()
}
}
})
}
const showErrorMessage = (message) => {
scanPopupLoseFocus()
comMessage.value.showErrorMessage(message, res => {
if (res) {
afterCloseMessage()
}
})
}
const showScanMessage = (message) => {
comMessage.value.showScanMessage(message)
}
const afterCloseMessage = () => {
scanPopupGetFocus()
}
const closeScanMessage = () => {
scanPopupGetFocus()
}
const showCommitSuccessMessage = (hint) => {
comMessage.value.showSuccessMessage(hint, res => {
fromLocationCode.value = ''
fromLocation.value = {}
detailSource.value = []
showFromLocationPopup()
})
}
const getCountStageName = (value) => {
return getCountStageName(value)
}
const isOpenCount = (value) => {
return value === 'TRUE' ? '明盘' : '盲盘'
}
const getCountScopeName = (value) => {
const item = getCountScopeType(value)
return item.label
}
const showQuestionMessage = (message, callback) => {
comMessage.value.showQuestionMessage(message, res => {
callback(res)
})
}
</script>

6
src/pages/issue/record/directIssue2.vue

@ -101,7 +101,8 @@ import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {ref, onMounted} from 'vue';
import {onLoad, onNavigationBarButtonTap, onBackPress, onPullDownRefresh} from '@dcloudio/uni-app';
import {useCountStore} from '@/store'
const store = useCountStore();
const id = ref('');
const dataContent = ref({});
const detailSource = ref([]);
@ -132,6 +133,7 @@ const managementList = ref([]);
const scanPopupRef = ref(null);
const scanLocationCodeRef = ref(null);
const comMessageRef = ref(null);
const fromInventoryStatus = ref('')
const getBusinessType = (code, callback) => {
//
@ -522,7 +524,7 @@ const commit = () => {
const setRecordParams = () => {
let subList = [];
let creator = store.state.user.id;
let creator = store.id;
detailSource.value.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {

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

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan="getBusinessType" v-if="detailSource.length == 0"></com-blank-view>
<com-blank-view @goScan="getBusinessTypeFun" v-if="detailSource.length == 0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length > 0">
@ -65,7 +65,8 @@ import numberBox from '@/mycomponents/qty/numberBox.vue'
import { ref, onMounted, nextTick } from 'vue';
import { onLoad, onNavigationBarButtonTap, onBackPress, onPullDownRefresh } from '@dcloudio/uni-app';
import {useCountStore} from '@/store'
const store = useCountStore()
const id = ref('');
const detailSource = ref([]); //
const fromLocationCode = ref('');
@ -89,7 +90,7 @@ onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
});
getBusinessType();
getBusinessTypeFun();
});
onNavigationBarButtonTap((e) => {
@ -99,8 +100,8 @@ onNavigationBarButtonTap((e) => {
});
const getBusinessType = () => {
getBusinessTypeApi(typeCode.value, (res) => {
const getBusinessTypeFun = () => {
getBusinessType(typeCode.value, (res) => {
if (res.success) {
businessType.value = res.businessType;
fromInventoryStatuses.value = getDirectoryItemArray(res.fromInventoryStatuses);
@ -125,7 +126,7 @@ const openScanPopup = () => {
scanPopupRef.value.openScanPopup(businessType.value);
}
} else {
getBusinessType();
getBusinessTypeFun();
}
};
@ -267,7 +268,7 @@ const commit = () => {
const setParams = () => {
const subList = [];
const creator = store.state.user.id;
const creator = store.id;
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
const subItem = { ...detail };

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

@ -44,47 +44,47 @@
</template>
<script setup lang="ts">
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
getProductReceiptJobDetail,
takeProductReceiptJob,
cancleTakeProductReceiptJob,
productReceiptJobsubmit
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getPackingNumberAndBatch,
} from '@/common/basic.js';
import {
getDirectoryItemArray,
getInventoryStatusName
} from '@/common/directory.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
getProductReceiptJobDetail,
takeProductReceiptJob,
cancleTakeProductReceiptJob,
productReceiptJobsubmit
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getPackingNumberAndBatch,
} from '@/common/basic.js';
import {
getDirectoryItemArray,
getInventoryStatusName
} from '@/common/directory.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
import { ref, onMounted, onBeforeUnmount } from 'vue';
import { onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app';
//
import {useCountStore} from '@/store'
const store = useCountStore();
const id = ref('');
const receiptJob = ref({});
const toLocationCode = ref('');
@ -98,12 +98,11 @@ const managementList = ref([]);
const jobStatus = ref("");
const jobToLocationCode = ref("");
//
const scanPopupRef = ref(null);
const comMessageRef = ref(null);
const comScanLocationRef = ref(null);
//
onLoad((option) => {
id.value = option.id;
if (id.value !== undefined) {
@ -146,7 +145,7 @@ onPullDownRefresh(() => {
uni.stopPullDownRefresh();
});
//
const receive = (callback) => {
if (id.value !== null) {
takeProductReceiptJob(id.value).then(() => {
@ -323,7 +322,7 @@ const submitJob = () => {
const setParams = () => {
const subList = [];
const creator = store.state.user.id;
const creator = store.id;
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {

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

@ -39,7 +39,6 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
const { proxy } = getCurrentInstance()
@ -385,7 +384,7 @@ const getJobInfoByNumber = (number,scanMessage)=>{
showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
let result = res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
if(result.acceptUserId&&result.acceptUserId!=store.id){
comMessageRef.value.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
getList('refresh')

93
src/pages/purchaseReturn/job/returnDetailBatch.vue

@ -52,54 +52,55 @@
</template>
<script setup lang="ts">
import {
getPurchasereturnJobDetail,
purchaseReturnJobsubmit,
cancleTakePurchasereturnJob,
takePurchasereturnJob
} from '@/api/request2.js';
import {
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
navigateBack,
deepCopyData
} from '@/common/basic.js';
import {
getInventoryStatusName
} from '@/common/directory.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import {
calc
} from '@/common/calc.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import returnDetailInfoPopup from '@/pages/purchaseReturn/coms/returnDetailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import comReturnDetailCard from '@/pages/purchaseReturn/coms/comReturnDetailCard.vue'
import comReturnDetailCardBatch from '@/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue'
import comScanReturnPack from '@/pages/purchaseReturn/coms/comScanReturnPack.vue'
import comScanReturnPackBatch from '@/pages/purchaseReturn/coms/comScanReturnPackBatch.vue'
import {
getPurchasereturnJobDetail,
purchaseReturnJobsubmit,
cancleTakePurchasereturnJob,
takePurchasereturnJob
} from '@/api/request2.js';
import {
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
navigateBack,
deepCopyData
} from '@/common/basic.js';
import {
getInventoryStatusName
} from '@/common/directory.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import {
calc
} from '@/common/calc.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import returnDetailInfoPopup from '@/pages/purchaseReturn/coms/returnDetailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import comReturnDetailCard from '@/pages/purchaseReturn/coms/comReturnDetailCard.vue'
import comReturnDetailCardBatch from '@/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue'
import comScanReturnPack from '@/pages/purchaseReturn/coms/comScanReturnPack.vue'
import comScanReturnPackBatch from '@/pages/purchaseReturn/coms/comScanReturnPackBatch.vue'
import { ref, onMounted } from 'vue';
import { onLoad, onNavigationBarButtonTap, onBackPress, onPullDownRefresh } from '@dcloudio/uni-app';
import {useCountStore} from '@/store'
const store = useCountStore();
const id = ref('');
const scanCount = ref(0);
const jobContent = ref({});
@ -334,7 +335,7 @@ const submitJob = () => {
const setParams = () => {
const subList = [];
const createTime = getCurrDateTime();
const creator = $store.state.user.id;
const creator = store.id;
detailSource.value.subList.forEach(r => {
if (r.scaned) {
const subItem = { ...r };

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

@ -91,7 +91,8 @@ import jobTop from '@/mycomponents/job/jobTop.vue'
import {ref, onMounted, onBeforeUnmount} from 'vue';
import {onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap} from '@dcloudio/uni-app';
import {useCountStore} from '@/store'
const store = useCountStore();
const id = ref('');
const scanCount = ref(0);
const jobContent = ref({});
@ -426,7 +427,7 @@ const submitJob = () => {
const setParams = () => {
const subList = [];
const creator = store.state.user.id;
const creator = store.id;
detailSource.value.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {

Loading…
Cancel
Save