|
@ -19,14 +19,14 @@
|
|
|
<div class="title">
|
|
|
药品追溯码(
|
|
|
<span class="c-17b3ec">{{ fillNum }}</span>
|
|
|
/{{ allNum }})
|
|
|
/ {{ allNum }})
|
|
|
</div>
|
|
|
<div class="fs-12 c-999">请按照追溯码录入的位次进行顺序摆放,序号为最里的位次摆放在该号位的最里层,以此类推</div>
|
|
|
<div class="line"></div>
|
|
|
<div v-for="item in inventoryList" :key="item.id">
|
|
|
<div class="title">{{ item.layerNo }}层{{ item.wayerNo }}号位</div>
|
|
|
<div class="code-box">
|
|
|
<code-list :codeList="item.codeList"></code-list>
|
|
|
<code-list :codeList="item.codeList" @scan="scan($event, item)"></code-list>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@ -36,7 +36,7 @@
|
|
|
<div class="plain-btn" @click="backFn">
|
|
|
返回上一步
|
|
|
</div>
|
|
|
<div class="primary-btn" @click="finish">完成{{ type == 1 ? '补货' : '入库' }}</div>
|
|
|
<div class="primary-btn" @click="finish">完成{{ type == 1 ? '补货' : '入库' }}({{ fillNum }})</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@ -84,6 +84,15 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.drugTraceabilityCodeDetail()
|
|
|
this.$EventBus.$on('getScanData', item => {
|
|
|
const obj = this.inventoryList.find(el => el.id == item.id)
|
|
|
if (obj) {
|
|
|
obj.codeList = item.codeList
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.$EventBus.$off('getScanData')
|
|
|
},
|
|
|
methods: {
|
|
|
getLabel(index, len) {
|
|
@ -102,6 +111,9 @@ export default {
|
|
|
inventoryIds: this.trackId
|
|
|
}
|
|
|
medicineAbinetApi.drugTraceabilityCodeDetail(params).then(res => {
|
|
|
// console.log(res,"Res");
|
|
|
// return
|
|
|
|
|
|
const data = res.obj
|
|
|
this.drug = data.drug
|
|
|
this.inventoryList = data.inventoryList.map(el => {
|
|
@ -109,11 +121,14 @@ export default {
|
|
|
...el,
|
|
|
arr: []
|
|
|
}
|
|
|
var maxNum = el.cargoCapacity * 1 > this.stock * 1 ? this.stock * 1 : el.cargoCapacity * 1
|
|
|
console.log(this.stock, 'this.stock')
|
|
|
// *1 是为了字符串转数字
|
|
|
var maxNum = (this.stock * 1 > el.cargoCapacity * 1 ? el.cargoCapacity : this.stock) * 1
|
|
|
|
|
|
var len = obj.codeList.length
|
|
|
if (obj.codeList.length < maxNum) {
|
|
|
for (let i = 0; i < maxNum - len; i++) {
|
|
|
obj.codeList.push({ code: '' })
|
|
|
obj.codeList.unshift({ code: '' })
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -151,13 +166,13 @@ export default {
|
|
|
let qty = 0
|
|
|
el.codeList.forEach((item, index) => {
|
|
|
// 记录填写了追溯码的数量
|
|
|
if (item.code) {
|
|
|
if (item.code != '') {
|
|
|
qty++
|
|
|
codeList.push({
|
|
|
code: item.code,
|
|
|
sort: el.codeList.length - index
|
|
|
})
|
|
|
}
|
|
|
codeList.push({
|
|
|
code: item.code,
|
|
|
sort: el.codeList.length - index
|
|
|
})
|
|
|
})
|
|
|
list.push({
|
|
|
cargoId: el.id,
|
|
@ -175,6 +190,10 @@ export default {
|
|
|
medicineAbinetApi.batchAddInventory(p).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$toast('操作成功!')
|
|
|
this.$EventBus.$emit('initPage')
|
|
|
this.$emitRefreshPage('replenishmentStartQuick', {
|
|
|
bussiness: 5
|
|
|
})
|
|
|
this.backFn()
|
|
|
}
|
|
|
})
|
|
@ -185,7 +204,7 @@ export default {
|
|
|
this.inventoryList[0].codeList.forEach((el, index) => {
|
|
|
codeList.push({
|
|
|
code: el.code,
|
|
|
sort: el.codeList.length - index
|
|
|
sort: this.inventoryList[0].codeList.length - index
|
|
|
})
|
|
|
})
|
|
|
let p = {
|
|
@ -199,12 +218,27 @@ export default {
|
|
|
medicineAbinetApi.updateMediicinecabineInventory(p).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$toast('入库成功!')
|
|
|
this.$EventBus.$emit('initPage')
|
|
|
// this.$emitRefreshPage('replenishmentDeviceDetail')
|
|
|
this.backFn()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
backFn() {
|
|
|
this.$router.go(-1)
|
|
|
},
|
|
|
scan(data, item) {
|
|
|
sessionStorage.setItem(
|
|
|
'scanData',
|
|
|
JSON.stringify({
|
|
|
...data,
|
|
|
...item
|
|
|
})
|
|
|
)
|
|
|
|
|
|
this.$router.push({
|
|
|
path: '/replenishment/start/scan'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -227,7 +261,7 @@ export default {
|
|
|
width: 200px;
|
|
|
}
|
|
|
.title {
|
|
|
margin-bottom: 6px;
|
|
|
margin: 10px 0;
|
|
|
}
|
|
|
.line {
|
|
|
border: 1px solid #eaeaea;
|