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> <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"
<view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'"> @click="(...event)=>swipeClick(event, item)">
<view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view> <view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'">
<comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" :isShowRecommendQty="false" @updateData="updateData"> </comCountDetailcards> <view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view>
</view> <comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" :isShowRecommendQty="false" @updateData="updateData"> </comCountDetailcards>
<view class="split_line"></view> </view>
</uni-swipe-action-item> <view class="split_line"></view>
</uni-swipe-action> </u-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,455 +80,386 @@ 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, } else {
pageSize: 20, getDetail()
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
} }
this.index++ }
const list = this.getDataPage(this.index, this.pageSize) detailOptions.value = getDetailOption()
if (list.length > 0) { scanOptions.value = getDetailEditRemoveOption()
// this.showList=list })
this.showList = this.showList.concat(list)
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 { } else {
// uni.navigateBack()
this.loadingType = 'nomore'
} }
}, return true
methods: { }
// })
receive(callback) {
if (this.id != null) { onPullDownRefresh(() => {
takeCountJob(this.id) initList()
.then((res) => { uni.stopPullDownRefresh()
callback() })
})
.catch((error) => { onReachBottom(() => {
this.showErrorMessage(error) 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 receive = (callback) => {
const that = this if (id.value !== null) {
uni.showLoading({ takeCountJob(id.value)
title: '加载中....', .then(callback)
mask: true .catch(error => showErrorMessage(error))
}) }
getCountJobDetail(that.id) }
.then((res) => {
uni.hideLoading() const getDetail = () => {
if (res.data == null) { uni.showLoading({ title: '加载中....', mask: true })
that.showMessage('未获取到详情') getCountJobDetail(id.value)
} else { .then(res => {
that.jobContent = res.data uni.hideLoading()
that.jobStatus = res.data.status if (res.data === null) {
that.fromLocationCode = that.jobContent.countSplitCode showMessage('未获取到详情')
res.data.subList.forEach((item) => { } else {
item.recommendQty = item.qty jobContent.value = res.data
item.handleQty = 0 jobStatus.value = res.data.status
item.countTime = new Date() fromLocationCode.value = jobContent.value.countSplitCode
item.fromLocationCode = that.fromLocationCode res.data.subList.forEach(item => {
}) item.recommendQty = item.qty
that.allDetails = res.data.subList item.handleQty = 0
that.allCount = res.data.subList.length item.countTime = new Date()
that.initList() item.fromLocationCode = fromLocationCode.value
}
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
}) })
}, allDetails.value = res.data.subList
allCount.value = res.data.subList.length
initList() { 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)
} }
}, })
detail(item) { .catch(error => {
this.showItem = item uni.hideLoading()
this.$refs.detailInfoPopup.openPopup(item) showErrorMessage(error)
}, })
}
remove(item, index) {
this.$refs.comMessage.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.handleQty = 0
this.$emit('removePack')
}
})
},
updateData() {}, const initList = () => {
index.value = 1
showList.value = []
loadingType.value = ''
showList.value = getDataPage(index.value, pageSize)
}
openScanPopup() { const getDataPage = (pageNo, pageSize) => {
const fromlocationList = [] const totalPages = Math.ceil(allCount.value / pageSize)
fromlocationList.push(this.fromLocationCode) const start = (pageNo - 1) * pageSize
this.$refs.scanPopup.openScanPopupForJob(this.fromLocationCode, fromlocationList, this.jobContent) const end = start + pageSize
}, return allDetails.value.slice(start, end)
}
closeScanPopup() { const swipeClick = (e, item) => {
if (this.$refs.scanPopup != undefined) { if (e.content.text === '详情') {
this.$refs.scanPopup.closeScanPopup() detail(item)
} } else if (e.content.text === '编辑') {
}, editItem(item)
} else if (e.content.text === '移除') {
remove(item)
}
}
scanPopupGetFocus() { const detail = (item) => {
if (this.$refs.scanPopup != undefined) { showItem.value = item
this.$refs.scanPopup.packGetFocus() detailInfoPopup.value.openPopup(item)
} }
},
scanPopupLoseFocus() { const remove = (item, index) => {
if (this.$refs.scanPopup != undefined) { comMessage.value.showQuestionMessage('确定移除扫描信息?', res => {
this.$refs.scanPopup.packLoseFocus() if (res) {
} item.scaned = false
}, item.handleQty = 0
emit('removePack')
// }
getScanResult(result) { })
const { itemCode } = result.label }
const { packingNumber } = result.label
const pack = result.package const updateData = () => {}
const { batch } = result.label
const inventoryStatus = result.balance ? result.balance.inventoryStatus : 'OK' const openScanPopup = () => {
const qty = result.balance ? result.balance.qty : 0 const fromlocationList = [fromLocationCode.value]
scanPopup.value.openScanPopupForJob(fromLocationCode.value, fromlocationList, jobContent.value)
// }
const items = this.allDetails.filter((r) => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus)
// , const closeScanPopup = () => {
if (items.length == 0) { if (scanPopup.value !== undefined) {
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => { scanPopup.value.closeScanPopup()
// }
if (res) { }
const detail = this.createAddDetailInfo(pack, qty)
detail.countTime = new Date() const scanPopupGetFocus = () => {
this.allDetails.push(detail) if (scanPopup.value !== undefined) {
this.updateList() scanPopup.value.packGetFocus()
this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, null) }
} else { }
this.scanPopupGetFocus()
} 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 { } else {
const selectItem = items[0] scanPopupGetFocus()
//
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()
} }
return detail })
}, } else {
const selectItem = items[0]
commit() { if (selectItem.scaned) {
this.calcAllCount() comMessage.value.showQuestionMessage(`包装【${packingNumber}】已经完成盘点,是否要编辑盘点结果?`, res => {
this.calcScanCount() if (res) {
currentEditItem.value = selectItem
if (this.scanCount == this.allCount) { countQtyEdit.value.openEditPopup(selectItem, null)
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 { } else {
// scanPopupGetFocus()
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
if (res) {
this.openScanPopup()
}
})
} }
}
},
submitJob() {
uni.showLoading({
title: '提交中....',
mask: true
}) })
const params = this.setParams() } else {
console.log('提交参数', JSON.stringify(params)) selectItem.scaned = true
countJobSubmit(params) selectItem.balanceQty = Number(qty)
.then((res) => { selectItem.handleQty = Number(qty)
uni.hideLoading() selectItem.packQty = result.package.packQty
if (res.data) { selectItem.packUnit = result.package.packUnit
this.showCommitSuccessMessage(`提交成功\n生成盘点记录\n${res.data}`) countQtyEdit.value.openEditPopupShowSeconds(selectItem, null)
} else { selectItem.countTime = new Date()
this.showErrorMessage(`提交失败[${res.msg}]`) updateList()
} }
}) }
.catch((error) => { }
uni.hideLoading()
this.showErrorMessage(error) 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 updateList = () => {
const subList = [] allDetails.value.sort(compare('countTime'))
const creator = this.$store.state.user.id initList()
scanPopupLoseFocus()
calcAllCount()
calcScanCount()
}
this.allDetails.forEach((item) => { const calcAllCount = () => {
if (item.scaned) { allCount.value = allDetails.value.length
item.countQty = item.handleQty }
}
subList.push(item) const calcScanCount = () => {
}) scanCount.value = allDetails.value.filter(r => r.scaned === true).length
}
const editClose = () => {
scanPopupGetFocus()
}
this.jobContent.subList = subList const createAddDetailInfo = (pack, qty) => {
this.jobContent.creator = creator return {
return this.jobContent 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) { const commit = () => {
this.$refs.comMessage.showMessage(message, (res) => { 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) { if (res) {
this.afterCloseMessage() allDetails.value.forEach(item => {
if (!item.scaned) {
item.scaned = true
item.handleQty = 0
}
})
submitJob()
} }
}) })
}, } else {
showErrorMessage(message) { comMessage.value.showErrorMessage(`请完成扫描后,再进行提交\n已经扫描[${scanCount.value}]总共[${allCount.value}]`, res => {
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) { if (res) {
this.afterCloseMessage() openScanPopup()
} }
}) })
}, }
}
showScanMessage(message) { }
this.$refs.comMessage.showScanMessage(message)
},
afterCloseMessage() { const submitJob = () => {
this.scanPopupGetFocus() 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() { const setParams = () => {
this.scanPopupGetFocus() 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) { const showMessage = (message) => {
this.currentEditItem = item comMessage.value.showMessage(message, res => {
this.$refs.countQtyEdit.openEditPopup(this.currentEditItem, null) if (res) {
}, afterCloseMessage()
}
})
}
showCommitSuccessMessage(hint) { const showErrorMessage = (message) => {
this.$refs.comMessage.showSuccessMessage(hint, (res) => { comMessage.value.showErrorMessage(message, res => {
navigateBack(1) if (res) {
}) afterCloseMessage()
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == 'TRUE' ? '明盘' : '盲盘'
} }
} })
}
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> </script>

779
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"
<view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'"> @click="(...event)=>swipeClick(event, item)">
<view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view> <view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'">
<comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" @updateData="updateData"> </comCountDetailcards> <view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view>
</view> <comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" @updateData="updateData"> </comCountDetailcards>
<view class="split_line"></view> </view>
</uni-swipe-action-item> <view class="split_line"></view>
</uni-swipe-action> </u-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,446 +83,383 @@ 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, } else {
pageSize: 20, getDetail()
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
} }
this.index++ }
const list = this.getDataPage(this.index, this.pageSize) detailOptions.value = getDetailOption()
if (list.length > 0) { scanOptions.value = getDetailEditRemoveOption()
// this.showList=list })
this.showList = this.showList.concat(list)
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 { } else {
// uni.navigateBack()
this.loadingType = 'nomore'
} }
}, return true
methods: { }
// })
receive(callback) {
if (this.id != null) { onPullDownRefresh(() => {
takeCountJob(this.id) initList()
.then((res) => { uni.stopPullDownRefresh()
callback() })
})
.catch((error) => { onReachBottom(() => {
this.showErrorMessage(error) 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 receive = (callback) => {
const that = this if (id.value !== null) {
uni.showLoading({ takeCountJob(id.value)
title: '加载中....', .then(callback)
mask: true .catch(error => showErrorMessage(error))
}) }
getCountJobDetail(that.id) }
.then((res) => {
uni.hideLoading() const getDetail = () => {
if (res.data == null) { uni.showLoading({ title: '加载中....', mask: true })
that.showMessage('未获取到详情') getCountJobDetail(id.value)
} else { .then(res => {
that.jobContent = res.data uni.hideLoading()
that.jobStatus = res.data.status if (res.data === null) {
that.fromLocationCode = that.jobContent.locationCode showMessage('未获取到详情')
res.data.subList.forEach((item) => { } else {
item.recommendQty = item.qty jobContent.value = res.data
item.handleQty = 0 jobStatus.value = res.data.status
item.countTime = new Date() fromLocationCode.value = jobContent.value.locationCode
item.fromLocationCode = that.fromLocationCode res.data.subList.forEach(item => {
}) item.recommendQty = item.qty
that.allDetails = res.data.subList item.handleQty = 0
that.allCount = res.data.subList.length item.countTime = new Date()
that.initList() item.fromLocationCode = fromLocationCode.value
}
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
}) })
}, allDetails.value = res.data.subList
allCount.value = res.data.subList.length
initList() { 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)
} }
}, })
detail(item) { .catch(error => {
this.showItem = item uni.hideLoading()
this.$refs.detailInfoPopup.openPopup(item) showErrorMessage(error)
}, })
}
remove(item, index) {
this.$refs.comMessage.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.handleQty = 0
this.$emit('removePack')
}
})
},
updateData() {}, const initList = () => {
index.value = 1
showList.value = []
loadingType.value = ''
showList.value = getDataPage(index.value, pageSize)
}
openScanPopup() { const getDataPage = (pageNo, pageSize) => {
const fromlocationList = [] const totalPages = Math.ceil(allCount.value / pageSize)
fromlocationList.push(this.fromLocationCode) const start = (pageNo - 1) * pageSize
this.$refs.scanPopup.openScanPopupForJob(this.fromLocationCode, fromlocationList, this.jobContent) const end = start + pageSize
}, return allDetails.value.slice(start, end)
}
closeScanPopup() { const swipeClick = (e, item) => {
if (this.$refs.scanPopup != undefined) { if (e.content.text === '详情') {
this.$refs.scanPopup.closeScanPopup() detail(item)
} } else if (e.content.text === '编辑') {
}, editItem(item)
} else if (e.content.text === '移除') {
remove(item)
}
}
scanPopupGetFocus() { const detail = (item) => {
if (this.$refs.scanPopup != undefined) { showItem.value = item
this.$refs.scanPopup.packGetFocus() detailInfoPopup.value.openPopup(item)
} }
},
scanPopupLoseFocus() { const remove = (item, index) => {
if (this.$refs.scanPopup != undefined) { comMessage.value.showQuestionMessage('确定移除扫描信息?', res => {
this.$refs.scanPopup.packLoseFocus() if (res) {
} item.scaned = false
}, item.handleQty = 0
emit('removePack')
// }
getScanResult(result) { })
const { itemCode } = result.label }
const { packingNumber } = result.label
const pack = result.package const updateData = () => {}
const { batch } = result.label
const inventoryStatus = result.balance ? result.balance.inventoryStatus : 'OK' const openScanPopup = () => {
const qty = result.balance ? result.balance.qty : 0 const fromlocationList = [fromLocationCode.value]
scanPopup.value.openScanPopupForJob(fromLocationCode.value, fromlocationList, jobContent.value)
// }
const items = this.allDetails.filter((r) => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus)
// , const closeScanPopup = () => {
if (items.length == 0) { if (scanPopup.value !== undefined) {
this.$refs.comMessage.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => { scanPopup.value.closeScanPopup()
// }
if (res) { }
const detail = this.createAddDetailInfo(pack)
detail.countTime = new Date() const scanPopupGetFocus = () => {
this.allDetails.push(detail) if (scanPopup.value !== undefined) {
this.updateList() scanPopup.value.packGetFocus()
this.$refs.countQtyEdit.openEditPopupShowSeconds(detail, null) }
} else { }
this.scanPopupGetFocus()
} 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 { } else {
const selectItem = items[0] scanPopupGetFocus()
//
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()
}
} }
}, })
} else {
editConfirm(qty, inventoryStatus, mode) { const selectItem = items[0]
const that = this if (selectItem.scaned) {
// comMessage.value.showQuestionMessage(`包装【${packingNumber}】已经完成盘点,是否要编辑盘点结果?`, res => {
if (mode == 'edit') { if (res) {
this.currentEditItem.handleQty = qty currentEditItem.value = selectItem
this.currentEditItem.inventoryStatus = inventoryStatus countQtyEdit.value.openEditPopup(selectItem, null)
}
//
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 { } else {
// scanPopupGetFocus()
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
if (res) {
this.openScanPopup()
}
})
} }
}
},
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 const editConfirm = (qty, inventoryStatus, mode) => {
this.jobContent.creator = creator if (mode === 'edit') {
return this.jobContent 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) { const editClose = () => {
this.$refs.comMessage.showMessage(message, (res) => { 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) { if (res) {
this.afterCloseMessage() allDetails.value.forEach(item => {
if (!item.scaned) {
item.scaned = true
item.handleQty = 0
}
})
submitJob()
} }
}) })
}, } else {
showErrorMessage(message) { comMessage.value.showErrorMessage(`请完成扫描后,再进行提交\n已经扫描[${scanCount.value}]总共[${allCount.value}]`, res => {
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) { if (res) {
this.afterCloseMessage() openScanPopup()
} }
}) })
}, }
}
showScanMessage(message) { }
this.$refs.comMessage.showScanMessage(message)
},
afterCloseMessage() { const submitJob = () => {
this.scanPopupGetFocus() 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() { const setParams = () => {
this.scanPopupGetFocus() 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) { const showMessage = (message) => {
this.currentEditItem = item comMessage.value.showMessage(message, res => {
this.$refs.countQtyEdit.openEditPopup(this.currentEditItem, null) if (res) {
}, afterCloseMessage()
}
})
}
showCommitSuccessMessage(hint) { const showErrorMessage = (message) => {
this.$refs.comMessage.showSuccessMessage(hint, (res) => { comMessage.value.showErrorMessage(message, res => {
navigateBack(1) if (res) {
}) afterCloseMessage()
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == 'TRUE' ? '明盘' : '盲盘'
} }
} })
}
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> </script>

815
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"
<view class=""> @click="(...event)=>swipeClick(event, item, index)">
<package-and-item-card :dataContent="item"></package-and-item-card> <view class="detail-list">
</view> <view class="">
<view class="split_line"></view> <package-and-item-card :dataContent="item"></package-and-item-card>
</uni-swipe-action-item> </view>
<view class="split_line"></view>
</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,453 +85,405 @@ 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: [], } else {
itemRangeValue: '' getDetail(() => showFromLocationPopup())
}
},
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()
})
}
} }
this.editRemoveOption = getEditRemoveOption() }
}, editRemoveOption.value = getEditRemoveOption()
// })
onNavigationBarButtonTap(e) {
if (e.index === 0) { onNavigationBarButtonTap(e => {
goHome() 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()
} }
}, return true
// }
onBackPress(e) { })
//
if (e.from === 'backbutton') { onPullDownRefresh(() => {
if (this.jobStatus == '2') { // uni.stopPullDownRefresh();
// })
cancleTakeCountJob(this.id)
.then((res) => { const receive = (callback) => {
uni.navigateBack() if (id.value !== null) {
}) takeCountJob(id.value)
.catch((error) => { .then(callback)
uni.navigateBack() .catch(error => showErrorMessage(error))
}) }
} else { }
uni.navigateBack()
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 callback()
} })
}, .catch(error => {
uni.hideLoading()
onPullDownRefresh() { showErrorMessage(error)
// uni.stopPullDownRefresh(); })
}, }
mounted() {}, const showFromLocationPopup = () => {
methods: { // this.$refs.scanLocationCode.openScanPopup();
// nextTick(() => {
receive(callback) { scanLocationCode.value.openScanPopup()
if (this.id != null) { })
takeCountJob(this.id) }
.then((res) => {
callback() const getLocation = (location, code) => {
}) const { countRange } = jobContent.value
.catch((error) => {
this.showErrorMessage(error) 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
} }
}, } else {
range = countRange.find(r => r.type === 'LOCATIONGROUP_CODE')
getDetail(callback) { if (range !== undefined) {
const that = this const rangeValue = range.value
uni.showLoading({ const index = rangeValue.indexOf(location.locationGroupCode)
title: '加载中....', if (index < 0) {
mask: true afterScanLocation(`库位组代码【${location.locationGroupCode}】,不在盘点库位组范围【${rangeValue}】内`)
}) return
getFuuzyCountJobDetail(that.id) }
.then((res) => { } else {
uni.hideLoading() range = countRange.find(r => r.type === 'AREABASIC_CODE')
that.jobContent = res.data if (range !== undefined) {
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) {
const rangeValue = range.value const rangeValue = range.value
const index = rangeValue.indexOf(location.code) const index = rangeValue.indexOf(location.areaCode)
if (index < 0) { if (index < 0) {
this.afterScanLocation(`代码【${location.code}】,不在盘点库位范围【${rangeValue}】内`) afterScanLocation(`库区代码【${location.areaCode}】,不在盘点库区范围【${rangeValue}】内`)
return return
} }
} else { } else {
range = countRange.find((r) => r.type == 'LOCATIONGROUP_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.locationGroupCode) const index = rangeValue.indexOf(location.warehouseCode)
if (index < 0) { if (index < 0) {
this.afterScanLocation(`位组代码【${location.locationGroupCode}】,不在盘点库位组范围【${rangeValue}】内`) afterScanLocation(`仓库代码【${location.warehouseCode}】,不在盘点仓库范围【${rangeValue}】内`)
return 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) }
}, }
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()
}
},
closeScanPopup() { const afterScanLocation = (message) => {
if (this.$refs.scanPopup != undefined) { showErrorMessage(message)
this.$refs.scanPopup.closeScanPopup() showFromLocationPopup()
} }
},
scanPopupLoseFocus() { const getFromLocationCode = (location, code) => {
if (this.$refs.scanPopup != undefined) { fromLocation.value = location
this.$refs.scanPopup.losefocus() fromLocationCode.value = code
} openScanPopup()
}, }
getScanResult(result) { const openScanPopup = () => {
const that = this scanPopup.value.openScanPopup()
const packInfo = result.package }
if (this.itemRangeValue != '') {
const index = this.itemRangeValue.indexOf(packInfo.itemCode) const scanPopupGetFocus = () => {
if (index < 0) { if (scanPopup.value !== undefined) {
this.showErrorMessage(`物料代码【${packInfo.itemCode}】,不在盘点范围【${this.itemRangeValue}】内`) 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 { } 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 { } else {
this.onScan(packInfo) 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)
async onScan(packInfo) { scanPopupGetFocus()
console.log(packInfo) } else {
//\ let index = detailSource.value.findIndex(r => r.itemCode === packInfo.itemCode && r.packingNumber === packInfo.number && r.batch === packInfo.batch && r.inventoryStatus === 'OK')
await getManagementPrecisions([packInfo.itemCode], packInfo.toLocationCode, res => { if (index >= 0) {
if (res.success) { detailSource.value.unshift(detailSource.value.splice(index, 1)[0]) //
this.managementList = res.list; //
this.managementType = this.managementList.some(item => item.ManagementPrecision == comMessage.value.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => {
'BY_BATCH') ? 'BY_BATCH' : '' if (res) {
if (this.managementType == 'BY_BATCH') { closeScanPopup()
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.batch == packInfo edit(detail)
.batch && r.inventoryStatus == "OK"); } else {
if (detail == undefined) { scanPopupGetFocus()
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();
}
});
} }
} })
} }
} }
})
},
//
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 == '编辑') { const createDetailInfo = (packInfo) => {
this.edit(item) return {
} else if (e.content.text == '移除') { scaned: true,
this.remove(item) 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()
} }
}, })
} else {
// commitJob()
edit(item) { }
const that = this }
this.currentEditItem = item
item.handleQty = item.qty const commitJob = () => {
this.$refs.countQtyEdit.openEditPopup(item, null) uni.showLoading({ title: '提交中....', mask: true })
}, const params = setParams()
console.log('提交参数', JSON.stringify(params))
editConfirm(qty, inventoryStatus, mode) { countJobSubmit(params)
const that = this .then(res => {
this.currentEditItem.countQty = qty uni.hideLoading()
this.currentEditItem.qty = qty if (res.data === null) {
this.currentEditItem.inventoryStatus = inventoryStatus showCommitSuccessMessage('提交成功')
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 { } else {
this.commitJob() showErrorMessage(`提交失败[${res.msg}]`)
} }
}, })
.catch(error => {
commitJob() { uni.hideLoading()
uni.showLoading({ showErrorMessage(error)
title: '提交中....', })
mask: true }
})
const params = this.setParams() const setParams = () => {
console.log('提交参数', JSON.stringify(params)) const creator = store.id
countJobSubmit(params) jobContent.value.subList = detailSource.value
.then((res) => { // jobContent.value.creator = creator;
uni.hideLoading() return jobContent.value
if (res.data == null) { }
this.showCommitSuccessMessage('提交成功')
} else { const showMessage = (message) => {
this.showErrorMessage(`提交失败[${res.msg}]`) scanPopupLoseFocus()
} comMessage.value.showMessage(message, res => {
}) if (res) {
.catch((error) => { afterCloseMessage()
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)
})
} }
} })
}
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> </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 {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 };

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

@ -44,47 +44,47 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
getProductReceiptJobDetail, getProductReceiptJobDetail,
takeProductReceiptJob, takeProductReceiptJob,
cancleTakeProductReceiptJob, cancleTakeProductReceiptJob,
productReceiptJobsubmit productReceiptJobsubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
navigateBack, navigateBack,
getPackingNumberAndBatch, getPackingNumberAndBatch,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getDirectoryItemArray, getDirectoryItemArray,
getInventoryStatusName getInventoryStatusName
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
calcHandleQty, calcHandleQty,
getScanCount getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue" import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
import { 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')

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

@ -52,54 +52,55 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import {
getPurchasereturnJobDetail, getPurchasereturnJobDetail,
purchaseReturnJobsubmit, purchaseReturnJobsubmit,
cancleTakePurchasereturnJob, cancleTakePurchasereturnJob,
takePurchasereturnJob takePurchasereturnJob
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
navigateBack, navigateBack,
deepCopyData deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getInventoryStatusName getInventoryStatusName
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
getDataSource getDataSource
} from '@/pages/issue/js/issue.js'; } from '@/pages/issue/js/issue.js';
import { import {
createRecordInfo, createRecordInfo,
calcHandleQty, calcHandleQty,
getScanCount getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import returnDetailInfoPopup from '@/pages/purchaseReturn/coms/returnDetailInfoPopup.vue' import returnDetailInfoPopup from '@/pages/purchaseReturn/coms/returnDetailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comReturnDetailCard from '@/pages/purchaseReturn/coms/comReturnDetailCard.vue' import comReturnDetailCard from '@/pages/purchaseReturn/coms/comReturnDetailCard.vue'
import comReturnDetailCardBatch from '@/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue' import comReturnDetailCardBatch from '@/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue'
import comScanReturnPack from '@/pages/purchaseReturn/coms/comScanReturnPack.vue' import comScanReturnPack from '@/pages/purchaseReturn/coms/comScanReturnPack.vue'
import comScanReturnPackBatch from '@/pages/purchaseReturn/coms/comScanReturnPackBatch.vue' import comScanReturnPackBatch from '@/pages/purchaseReturn/coms/comScanReturnPackBatch.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 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