Browse Source

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -83,8 +83,8 @@
import { ref, onMounted, onBeforeUnmount } from 'vue'; import { ref, onMounted, onBeforeUnmount } from 'vue';
import { onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app'; import { onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap } from '@dcloudio/uni-app';
import {useCountStore} from '@/store'
// const store = useCountStore();
const id = ref(''); const id = ref('');
const receiptJob = ref({}); const receiptJob = ref({});
const toLocationCode = ref(''); const toLocationCode = ref('');
@ -98,12 +98,11 @@ const managementList = ref([]);
const jobStatus = ref(""); const jobStatus = ref("");
const jobToLocationCode = ref(""); const jobToLocationCode = ref("");
//
const scanPopupRef = ref(null); const scanPopupRef = ref(null);
const comMessageRef = ref(null); const comMessageRef = ref(null);
const comScanLocationRef = ref(null); const comScanLocationRef = ref(null);
//
onLoad((option) => { onLoad((option) => {
id.value = option.id; id.value = option.id;
if (id.value !== undefined) { if (id.value !== undefined) {
@ -146,7 +145,7 @@ onPullDownRefresh(() => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}); });
//
const receive = (callback) => { const receive = (callback) => {
if (id.value !== null) { if (id.value !== null) {
takeProductReceiptJob(id.value).then(() => { takeProductReceiptJob(id.value).then(() => {
@ -323,7 +322,7 @@ const submitJob = () => {
const setParams = () => { const setParams = () => {
const subList = []; const subList = [];
const creator = store.state.user.id; const creator = store.id;
detailSource.value.forEach((item) => { detailSource.value.forEach((item) => {
item.subList.forEach((detail) => { 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 winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store
const store = useCountStore() const store = useCountStore()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -385,7 +384,7 @@ const getJobInfoByNumber = (number,scanMessage)=>{
showMessage('未查找到' + '【' + number + '】的发料任务'); showMessage('未查找到' + '【' + number + '】的发料任务');
} else { } else {
let result = res.data.list[0]; 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 => { comMessageRef.value.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) { if (res) {
getList('refresh') getList('refresh')

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

@ -99,7 +99,8 @@
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { onLoad, onNavigationBarButtonTap, onBackPress, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad, onNavigationBarButtonTap, onBackPress, onPullDownRefresh } from '@dcloudio/uni-app';
import {useCountStore} from '@/store'
const store = useCountStore();
const id = ref(''); const id = ref('');
const scanCount = ref(0); const scanCount = ref(0);
const jobContent = ref({}); const jobContent = ref({});
@ -334,7 +335,7 @@ const submitJob = () => {
const setParams = () => { const setParams = () => {
const subList = []; const subList = [];
const createTime = getCurrDateTime(); const createTime = getCurrDateTime();
const creator = $store.state.user.id; const creator = store.id;
detailSource.value.subList.forEach(r => { detailSource.value.subList.forEach(r => {
if (r.scaned) { if (r.scaned) {
const subItem = { ...r }; 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 {ref, onMounted, onBeforeUnmount} from 'vue';
import {onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap} from '@dcloudio/uni-app'; import {onLoad, onPullDownRefresh, onBackPress, onNavigationBarButtonTap} from '@dcloudio/uni-app';
import {useCountStore} from '@/store'
const store = useCountStore();
const id = ref(''); const id = ref('');
const scanCount = ref(0); const scanCount = ref(0);
const jobContent = ref({}); const jobContent = ref({});
@ -426,7 +427,7 @@ const submitJob = () => {
const setParams = () => { const setParams = () => {
const subList = []; const subList = [];
const creator = store.state.user.id; const creator = store.id;
detailSource.value.forEach(item => { detailSource.value.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {

Loading…
Cancel
Save