Browse Source

出入库管理-入库

master
x_ying 3 years ago
parent
commit
c8689b4a1a
  1. 26
      src/api/archivesManage/outInStorage.js
  2. 34
      src/views/archivesManage/outInStorage/inStorage/module/inDialog.vue

26
src/api/archivesManage/outInStorage.js

@ -1,21 +1,6 @@
import request from '@/utils/request' import request from '@/utils/request'
import qs from 'qs' import qs from 'qs'
// // 拆盒
// export function unpacking(data) {
// return request({
// url: 'api/case/unpacking',
// method: 'post',
// data: data
// })
// }
// // 盒详情
// export function findInCase(params) {
// return request({
// url: 'api/case/findInCase' + '?' + qs.stringify(params, { indices: false }),
// method: 'get'
// })
// }
// 入库 初始化档案盒装盒信息 // 入库 初始化档案盒装盒信息
export function initCaseByArchives(params) { export function initCaseByArchives(params) {
return request({ return request({
@ -24,10 +9,19 @@ export function initCaseByArchives(params) {
}) })
} }
// 判断位置是否被占用
export function isOccupy(params) { export function isOccupy(params) {
return request({ return request({
url: 'api/storage/isOccupy' + '?' + qs.stringify(params, { indices: false }), url: 'api/storage/isOccupy' + '?' + qs.stringify(params, { indices: false }),
method: 'get' method: 'get'
}) })
} }
export default { initCaseByArchives, isOccupy }
// 入库
export function collect(params) {
return request({
url: 'api/storage/collect' + '?' + qs.stringify(params, { indices: false }),
method: 'post'
})
}
export default { initCaseByArchives, isOccupy, collect }

34
src/views/archivesManage/outInStorage/inStorage/module/inDialog.vue

@ -68,6 +68,7 @@
</div> </div>
</li> </li>
<li style="text-align:center;padding:20px 0"><el-button type="primary" :disabled="!(btnChecked.every(item=>item===2))" class="btn-save" @click="handleSave">保存</el-button></li> <li style="text-align:center;padding:20px 0"><el-button type="primary" :disabled="!(btnChecked.every(item=>item===2))" class="btn-save" @click="handleSave">保存</el-button></li>
<!-- <li style="text-align:center;padding:20px 0"><el-button type="primary" class="btn-save" @click="handleSave">保存</el-button></li> -->
</ul> </ul>
<!-- 回转柜 --> <!-- 回转柜 -->
<ul v-if="cnName==='回转柜'"> <ul v-if="cnName==='回转柜'">
@ -118,7 +119,8 @@
</template> </template>
<script> <script>
import { isOccupy } from '@/api/archivesManage/outInStorage'
import { isOccupy, collect } from '@/api/archivesManage/outInStorage'
export default { export default {
data() { data() {
return { return {
@ -143,7 +145,8 @@ export default {
directionOptions: [ directionOptions: [
{ value: '1', label: '左边' }, { value: '1', label: '左边' },
{ value: '2', label: '右边' } { value: '2', label: '右边' }
]
],
isOccupy: [] //
// //
} }
}, },
@ -157,6 +160,7 @@ export default {
console.log(data) console.log(data)
// //
this.btnChecked = this.childArr(1) this.btnChecked = this.childArr(1)
this.isOccupy = this.childArr('')
// //
if (data.cnName === '密集架') { if (data.cnName === '密集架') {
const obj = { colNum: '', sectionNum: '', levelNum: '', direction: '' } const obj = { colNum: '', sectionNum: '', levelNum: '', direction: '' }
@ -188,28 +192,46 @@ export default {
} }
if (bool === 0) { if (bool === 0) {
const params = { const params = {
// false
// deviceId: '3734A977C269ABEF6E284C',
// position: '1-5-6-2-1',
deviceId: 'FA0B05E2728EA8129A9F15', deviceId: 'FA0B05E2728EA8129A9F15',
position: '1-1-3-4-1', position: '1-1-3-4-1',
// deviceId: 'DE1517EF06F7511FFF19C0',
// position: '1-1-3-4-1',
deviceType: '1' deviceType: '1'
} }
const res = await isOccupy(params).then(res => { const res = await isOccupy(params).then(res => {
console.log(res, '--res') console.log(res, '--res')
return res
}) })
// //
if (res) { if (res) {
this.btnChecked[index] = 2 this.btnChecked[index] = 2
this.isOccupy[index] = res
} else { } else {
this.btnChecked[index] = 3 this.btnChecked[index] = 3
} }
} }
console.log(this.btnChecked, this.isOccupy, 'check')
this.$forceUpdate() this.$forceUpdate()
}, },
// //
handleSave() { handleSave() {
// const caseId = this.childData.map(item => item.id)
// console.log(caseId, '---caseId')
const params = []
this.isOccupy.forEach((item, i) => {
const obj = {}
obj.caseId = this.childData[i].id
obj.deviceId = item.deviceInfoId
obj.position = item.position
obj.positionName = item.position_name
obj.shelfId = item.id
params.push(obj)
})
console.log(params, '==========')
collect(params).then(data => {
console.log(data, 'data')
})
this.dialogVisible = false
} }
} }

Loading…
Cancel
Save