|
|
@ -2,26 +2,28 @@ |
|
|
|
<div class="app-container"> |
|
|
|
<div class="venue-header"> |
|
|
|
<h4><i class="iconfont icon-shujia" />架位列表</h4> |
|
|
|
<span class="bookshelf-area">一楼-A区</span> |
|
|
|
<span class="bookshelf-area">{{ floorName }} - {{ regionName }}</span> |
|
|
|
<p><i class="iconfont icon-gongsi" />{{ user.fonds.fondsName }}</p> |
|
|
|
</div> |
|
|
|
<div class="bookshelf-main"> |
|
|
|
<div class="bookshelf-top"> |
|
|
|
<ul class="bookshelf-info"> |
|
|
|
<li><p>书架名称:</p><span>{{ bookShelfDetails && bookShelfDetails.shelfName }}</span></li> |
|
|
|
<li><p>书架规格:</p><span>{{ bookShelfDetails && bookShelfDetails.shelfShelf + ' X ' + bookShelfDetails.shelfFloor }}</span></li> |
|
|
|
<li><p>书架规格:</p><span>{{ bookShelfDetails && bookShelfDetails.shelfFloor + ' X ' + bookShelfDetails.shelfShelf }}</span></li> |
|
|
|
<li><p>单/双面:</p><span>{{ bookShelfDetails && bookShelfDetails.rowType === 1 ? '单面' :'双面' }}</span></li> |
|
|
|
<li><p>倒架规则:</p><span>{{ bookShelfDetails && bookShelfDetails.shelfRule === 1 ? '无序' :'有序' }}</span></li> |
|
|
|
<li><p>错架判断:</p><span>{{ bookShelfDetails && bookShelfDetails.shelfErrorJudge === 1 ? '书架' :'格子' }}</span></li> |
|
|
|
<!-- <li><p>前端测试用-架号顺序:</p><span>{{ bookShelfDetails && bookShelfDetails.shelfType === 1 ? '始终最左边为第1架(S型排架)' : (bookShelfDetails.shelfType === 2 ? 'A面最左为第1架(B面最左为最后1架)' : 'B面最左为第1架(A面最左为最后1架)') }}</span></li> |
|
|
|
<li><p>前端测试用-层号顺序:</p><span>{{ bookShelfDetails && bookShelfDetails.floorType === 1 ? '最顶层为第一层(从上至下)' :'最底层为第一层(从下至上)' }}</span></li> --> |
|
|
|
</ul> |
|
|
|
<div class="bookshelf-button"> |
|
|
|
<el-button size="mini" @click="doExport(crud.selections)"> |
|
|
|
<i class="iconfont icon-daochu" /> |
|
|
|
导出层位编码 |
|
|
|
</el-button> |
|
|
|
<el-button size="mini" :disabled="!isBindCarme"> |
|
|
|
<el-button size="mini" :disabled="!cellInfo.cameraId"> |
|
|
|
<i class="iconfont icon-yulan" /> |
|
|
|
{{ isBindCarme ? '摄像头预览' : '未绑定摄像头' }} |
|
|
|
{{ cellInfo.cameraId ? '摄像头预览' : '未绑定摄像头' }} |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -67,8 +69,8 @@ |
|
|
|
class="swiper-slide-content" |
|
|
|
> |
|
|
|
<ul class="cabinet-row"> |
|
|
|
<li v-for="(item,index) in layerNum*rackNum" :key="index" class="cabinet-cell" :style="cellStyle" :class="{ active: index === cellIndex }" @click="handleCellCurrent(index)"> |
|
|
|
<span>{{ bookShelfDetails && bookShelfDetails.shelfName +''+ (index+1) }}</span> |
|
|
|
<li v-for="(item,index) in booShelfGrid" :key="index" class="cabinet-cell" :style="cellStyle" :class="{ active: index === cellIndex }" @click="handleCellCurrent(item,index)"> |
|
|
|
<span>{{ item.gridName }}</span> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</swiper-slide> |
|
|
@ -76,20 +78,20 @@ |
|
|
|
</div> |
|
|
|
<div class="bookshelf-right-info"> |
|
|
|
<div class="layer-status"> |
|
|
|
<span class="row-state soon-state">待初始化</span> |
|
|
|
<!-- <span class="row-state end-state">正常盘点</span> |
|
|
|
<span class="row-state cancel-state">停止盘点</span> --> |
|
|
|
<span v-if="bookShelfDetails.shelfRule === 1" class="row-state other-state">无序倒架</span> |
|
|
|
<span v-if="cellInfo.startSortmark && cellInfo.endSortmark && checkValue === 'true'" class="row-state end-state">正常盘点</span> |
|
|
|
<span v-if="!cellInfo.startSortmark && !cellInfo.endSortmark && checkValue === 'true'" class="row-state soon-state">待初始化</span> |
|
|
|
<span v-if="checkValue === 'false'" class="row-state cancel-state">停止盘点</span> |
|
|
|
<span v-if="bookSortValue === 'false'" class="row-state other-state">无序倒架</span> |
|
|
|
<span v-else class="row-state ing-state">有序倒架</span> |
|
|
|
</div> |
|
|
|
<h5 class="layer-name">001排A面01架1层</h5> |
|
|
|
<h5 class="layer-name">{{ cellInfo.gridName }}</h5> |
|
|
|
<div class="layer-code-sort"> |
|
|
|
<ul> |
|
|
|
<!-- I247.58/586 --> |
|
|
|
<li><p>起始索书号</p><span>-</span></li> |
|
|
|
<li><p>结束索书号</p><span>I247.58/592:3</span></li> |
|
|
|
<li><p>起始索书号</p><span>{{ cellInfo.startSortmark ? cellInfo.startSortmark : '-' }}</span></li> |
|
|
|
<li><p>结束索书号</p><span>{{ cellInfo.endSortmark? cellInfo.endSortmark : '-' }}</span></li> |
|
|
|
</ul> |
|
|
|
<el-button size="mini" class="edit-callNumber" @click="callNumVisible = true"> |
|
|
|
<el-button size="mini" class="edit-callNumber" @click="handleEditGridNum"> |
|
|
|
<!-- <i class="iconfont icon-yulan" /> --> |
|
|
|
<i>编 辑</i> |
|
|
|
<i>索书号</i> |
|
|
@ -129,14 +131,14 @@ |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-form ref="form" :rules="rules" :model="form" size="small" label-width="100px"> |
|
|
|
<el-form-item label="所属架位" prop="floorName"> |
|
|
|
<el-input v-model="form.floorName" disabled style="width: 580px;" /> |
|
|
|
<el-form-item label="所属架位" prop="gridName"> |
|
|
|
<el-input v-model="form.gridName" disabled style="width: 580px;" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="起始索书号" prop="startNum"> |
|
|
|
<el-input v-model="form.startNum" style="width: 580px;" /> |
|
|
|
<el-form-item label="起始索书号" prop="startSortmark"> |
|
|
|
<el-input v-model="form.startSortmark" style="width: 580px;" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="结束索书号" prop="endNum"> |
|
|
|
<el-input v-model="form.endNum" style="width: 580px;" /> |
|
|
|
<el-form-item label="结束索书号" prop="endSortmark"> |
|
|
|
<el-input v-model="form.endSortmark" style="width: 580px;" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
@ -150,8 +152,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
// https://blog.csdn.net/qq_37236395/article/details/119737898 |
|
|
|
import crudFloor from '@/api/floor/index' |
|
|
|
import CRUD, { presenter, header, crud } from '@crud/crud' |
|
|
|
import { FetchInitShelfGridByShelfId, FetcheEditSortmarkByGrid, FetchChangeOrderByGrid, FetchChangeCheckByGrid } from '@/api/shelf/index' |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { swiper, swiperSlide } from 'vue-awesome-swiper' |
|
|
|
import 'swiper/dist/css/swiper.css' |
|
|
@ -159,22 +160,19 @@ import 'swiper/dist/css/swiper.css' |
|
|
|
export default { |
|
|
|
name: 'BookshelfPosition', |
|
|
|
components: { swiper, swiperSlide }, |
|
|
|
cruds() { |
|
|
|
return CRUD({ title: '架位', url: 'api/libraryFloor/initLibraryFloorList', crudMethod: { ...crudFloor }, sort: [], optShow: { |
|
|
|
add: true, |
|
|
|
edit: true, |
|
|
|
del: false, |
|
|
|
download: false, |
|
|
|
group: false, |
|
|
|
reset: false |
|
|
|
}}) |
|
|
|
}, |
|
|
|
mixins: [presenter(), header(), crud()], |
|
|
|
data() { |
|
|
|
const _this = this |
|
|
|
return { |
|
|
|
floorName: null, |
|
|
|
regionName: null, |
|
|
|
bookShelfDetails: null, |
|
|
|
isBindCarme: false, |
|
|
|
booShelfGrid: null, |
|
|
|
cellInfo: { |
|
|
|
gridName: null, |
|
|
|
startSortmark: null, |
|
|
|
endSortmark: null, |
|
|
|
cameraId: null |
|
|
|
}, |
|
|
|
callNumVisible: false, |
|
|
|
layerNum: 0, |
|
|
|
rackNum: 0, |
|
|
@ -182,13 +180,13 @@ export default { |
|
|
|
bookSortValue: 'true', |
|
|
|
swiperActiveIndex: 0, |
|
|
|
cellIndex: null, |
|
|
|
titleActive: '', |
|
|
|
swiperOptionContent: { |
|
|
|
slidesPerView: 'auto', |
|
|
|
on: { |
|
|
|
slideChangeTransitionStart: function() { |
|
|
|
_this.cellIndex = null |
|
|
|
_this.swiperActiveIndex = this.activeIndex |
|
|
|
console.log('activeIndexffff', this.swiperActiveIndex) |
|
|
|
_this.swiperTitle.slideTo(this.activeIndex, 500, false) |
|
|
|
} |
|
|
|
} |
|
|
@ -197,27 +195,24 @@ export default { |
|
|
|
slidesPerView: 'auto', |
|
|
|
freeMode: true |
|
|
|
}, |
|
|
|
tabListData: [ |
|
|
|
{ |
|
|
|
name: 'A面' |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: 'B面' |
|
|
|
} |
|
|
|
], |
|
|
|
tabListData: [], |
|
|
|
form: { |
|
|
|
'floorName': null, |
|
|
|
'startNum': null, |
|
|
|
'endNum': null |
|
|
|
id: null, |
|
|
|
gridName: null, |
|
|
|
startSortmark: null, |
|
|
|
endSortmark: null, |
|
|
|
check: null, |
|
|
|
order: null, |
|
|
|
cameraId: null |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
floorName: [ |
|
|
|
gridName: [ |
|
|
|
{ required: true, message: '所属架位不可为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
startNum: [ |
|
|
|
startSortmark: [ |
|
|
|
{ required: true, message: '起始索书号不可为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
endNum: [ |
|
|
|
endSortmark: [ |
|
|
|
{ required: true, message: '结束索书号不可为空', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
@ -236,99 +231,254 @@ export default { |
|
|
|
}, |
|
|
|
cellStyle: function() { |
|
|
|
const h = '100%/' + this.layerNum |
|
|
|
// if (this.cabinetNum > 8) { |
|
|
|
// h = '100%/' + (this.deviceData.rowNo - 1) |
|
|
|
// } else { |
|
|
|
// h = '100%/' + this.deviceData.rowNo |
|
|
|
// } |
|
|
|
// const h = '100%/' + this.deviceData.rowNo |
|
|
|
const w = '100%/' + this.rackNum |
|
|
|
return { width: `calc(${w} - 4px )`, height: `calc(${h} - 2px)` } |
|
|
|
} |
|
|
|
// heightStyle: function() { |
|
|
|
// let h |
|
|
|
// if (this.cabinetNum > 8) { |
|
|
|
// h = '100%/' + (this.deviceData.rowNo - 1) |
|
|
|
// } else { |
|
|
|
// h = '100%/' + this.deviceData.rowNo |
|
|
|
// } |
|
|
|
// // const h = '100%/' + this.deviceData.rowNo |
|
|
|
// return { height: `calc(${h})` } |
|
|
|
// }, |
|
|
|
// widhtStyle: function() { |
|
|
|
// const w = '100%/' + this.deviceData.partNo |
|
|
|
// return { width: `calc(${w} - 10px)` } |
|
|
|
// } |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
'$route'(val, from) { // 监听到路由(参数)改变 |
|
|
|
if (this.$route.query) { |
|
|
|
this.bookShelfDetails = this.$route.query.bookShelfDetails |
|
|
|
this.floorName = this.$route.query.floorName |
|
|
|
this.regionName = this.$route.query.regionName |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
async created() { |
|
|
|
if (this.$route.query) { |
|
|
|
this.floorName = this.$route.query.floorName |
|
|
|
this.regionName = this.$route.query.regionName |
|
|
|
} |
|
|
|
if (localStorage.getItem('bookShelfDetails')) { |
|
|
|
this.bookShelfDetails = JSON.parse(localStorage.getItem('bookShelfDetails')) |
|
|
|
this.layerNum = this.bookShelfDetails.shelfFloor |
|
|
|
this.rackNum = this.bookShelfDetails.shelfShelf |
|
|
|
|
|
|
|
// 单面/双面 |
|
|
|
this.tabListData = this.bookShelfDetails.rowType === 1 |
|
|
|
? this.bookShelfDetails.toward === 1 |
|
|
|
? [{ name: 'A面' }] |
|
|
|
: [{ name: 'B面' }] |
|
|
|
: [{ name: 'A面' }, { name: 'B面' }] |
|
|
|
|
|
|
|
// 层数据 |
|
|
|
this.getInitShelfGridByShelfId(this.bookShelfDetails.toward) |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
|
this.bookShelfDetails = this.$route.query.bookShelfDetails |
|
|
|
this.layerNum = this.bookShelfDetails.shelfShelf |
|
|
|
this.rackNum = this.bookShelfDetails.shelfFloor |
|
|
|
getInitShelfGridByShelfId(toward) { |
|
|
|
// rowType 1 单 2 双 |
|
|
|
// toward 1 A面 2 B面 |
|
|
|
// shelfType 1 '始终最左边为第1架(S型排架)' |
|
|
|
// shelfType 2 'A面最左为第1架(B面最左为最后1架)' |
|
|
|
// shelfType 3 'B面最左为第1架(A面最左为最后1架)' |
|
|
|
// floorType 1 '最顶层为第一层(从上至下)' |
|
|
|
// floorType 2 '最底层为第一层(从下至上)' |
|
|
|
FetchInitShelfGridByShelfId({ 'shelfId': this.bookShelfDetails.id, 'toward': toward }).then(res => { |
|
|
|
const sortFunction = toward === 1 ? { |
|
|
|
1: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' }, |
|
|
|
2: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' }, |
|
|
|
3: { 1: 'sortBookshelvesRightTop', 2: 'sortBookshelvesRightBottom' } |
|
|
|
} : { |
|
|
|
1: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' }, |
|
|
|
2: { 1: 'sortBookshelvesRightTop', 2: 'sortBookshelvesRightBottom' }, |
|
|
|
3: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' } |
|
|
|
} |
|
|
|
const shelfType = this.bookShelfDetails.shelfType |
|
|
|
const floorType = this.bookShelfDetails.floorType |
|
|
|
const sortMethod = sortFunction[shelfType][floorType] |
|
|
|
this.booShelfGrid = this[sortMethod](res) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
}, |
|
|
|
[CRUD.HOOK.afterRefresh](crud) { |
|
|
|
// 最左为第一架, 最顶层为第一层 从上往下 |
|
|
|
sortBookshelvesLeftTop(data) { |
|
|
|
const sortedData = [] |
|
|
|
const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor))) |
|
|
|
const maxShelf = Math.max(...data.map(item => parseInt(item.gridShelf.slice(-1)))) |
|
|
|
|
|
|
|
for (let i = 1; i <= maxFloor; i++) { |
|
|
|
for (let j = 1; j <= maxShelf; j++) { |
|
|
|
const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.slice(-1)) === j) |
|
|
|
if (currentShelf) { |
|
|
|
sortedData.push(currentShelf) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return sortedData |
|
|
|
}, |
|
|
|
// 提交前的验证 |
|
|
|
[CRUD.HOOK.afterValidateCU](crud) { |
|
|
|
console.log(crud.form) |
|
|
|
return true |
|
|
|
// 最右为第一架,最左为最后一架, 最顶层为第一层 从上往下 |
|
|
|
sortBookshelvesRightTop(data) { |
|
|
|
const sortedData = [] |
|
|
|
// 获取最大的楼层数 |
|
|
|
const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor))) |
|
|
|
const maxShelf = Math.max(...data.map(item => parseInt(item.gridShelf.match(/\d+$/)[0]))) |
|
|
|
for (let i = 1; i <= maxFloor; i++) { |
|
|
|
// 从最大的书架层数开始,向下排序 |
|
|
|
for (let j = maxShelf; j >= 1; j--) { |
|
|
|
const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.match(/\d+$/)[0]) === j) |
|
|
|
if (currentShelf) { |
|
|
|
sortedData.push(currentShelf) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return sortedData |
|
|
|
}, |
|
|
|
handleSlideToFun(index) { |
|
|
|
this.swiperActiveIndex = index |
|
|
|
this.swiperContent.slideTo(index, 500, false) |
|
|
|
this.swiperTitle.slideTo(index, 500, false) |
|
|
|
// 最左为第一架, 最底层为第一层 从下往上 |
|
|
|
sortBookshelvesLeftBottom(data) { |
|
|
|
const sortedData = [] |
|
|
|
// 获取最大的楼层数 |
|
|
|
const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor))) |
|
|
|
// 获取最大的书架层数 |
|
|
|
const maxShelf = Math.max(...data.map(item => parseInt(item.gridShelf.slice(-1)))) |
|
|
|
for (let i = maxFloor; i >= 1; i--) { |
|
|
|
for (let j = 1; j <= maxShelf; j++) { |
|
|
|
const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.slice(-1)) === j) |
|
|
|
if (currentShelf) { |
|
|
|
sortedData.push(currentShelf) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return sortedData |
|
|
|
}, |
|
|
|
// 最左为最后一架, 最底层为第一层 从下往上 |
|
|
|
sortBookshelvesRightBottom(data) { |
|
|
|
const sortedData = [] |
|
|
|
// 获取最大的楼层数 |
|
|
|
const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor))) |
|
|
|
const maxShelfPerFloor = data.map(item => parseInt(item.gridShelf.match(/\d+$/)[0])) |
|
|
|
.reduce((acc, curr, index, arr) => { |
|
|
|
const floor = parseInt(data[index].gridFloor) |
|
|
|
if (!acc[floor]) acc[floor] = 1 |
|
|
|
if (acc[floor] < curr) acc[floor] = curr |
|
|
|
return acc |
|
|
|
}, {}) |
|
|
|
// 从最大的楼层开始向下遍历 |
|
|
|
for (let i = maxFloor; i >= 1; i--) { |
|
|
|
// 从最大的书架编号开始向左遍历 |
|
|
|
for (let j = maxShelfPerFloor[i] || 1; j >= 1; j--) { |
|
|
|
const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.match(/\d+$/)[0]) === j) |
|
|
|
if (currentShelf) { |
|
|
|
sortedData.push(currentShelf) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return sortedData |
|
|
|
}, |
|
|
|
handleSlidClickFun(index) { |
|
|
|
this.cellIndex = null |
|
|
|
this.handleSlideToFun(index) |
|
|
|
if (localStorage.getItem('bookShelfDetails')) { |
|
|
|
this.getInitShelfGridByShelfId(index + 1) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleCellCurrent(index) { |
|
|
|
this.cellIndex = index |
|
|
|
}, |
|
|
|
changeCheckSwitch(data) { |
|
|
|
console.log(data) |
|
|
|
this.$confirm('此操作将开启/关闭该架位的盘点功能' + '<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
}).catch(() => { |
|
|
|
this.checkValue = data === 'true' ? 'false' : 'true' |
|
|
|
}) |
|
|
|
handleSlideToFun(index) { |
|
|
|
this.swiperActiveIndex = index |
|
|
|
this.swiperContent.slideTo(index, 500, false) |
|
|
|
this.swiperTitle.slideTo(index, 500, false) |
|
|
|
}, |
|
|
|
changeBookSortSwitch(data) { |
|
|
|
console.log(data) |
|
|
|
this.$confirm('此操作将开启/关闭该架位的图书顺序检查' + '<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
}).catch(() => { |
|
|
|
this.bookSortValue = data === 'true' ? 'false' : 'true' |
|
|
|
}) |
|
|
|
handleCellCurrent(item, index) { |
|
|
|
this.cellIndex = index |
|
|
|
this.cellInfo = { |
|
|
|
id: item.id, |
|
|
|
gridName: item.gridName, |
|
|
|
startSortmark: item.startSortmark, |
|
|
|
endSortmark: item.endSortmark, |
|
|
|
cameraId: item.cameraId, |
|
|
|
check: item.isCheck, |
|
|
|
order: item.isOrder |
|
|
|
} |
|
|
|
this.checkValue = `${item.isCheck}` |
|
|
|
this.bookSortValue = `${item.isOrder}` |
|
|
|
}, |
|
|
|
handleClose() { |
|
|
|
this.$refs['form'].resetFields() |
|
|
|
this.callNumVisible = false |
|
|
|
handleEditGridNum() { |
|
|
|
console.log(this.cellIndex) |
|
|
|
if (this.cellIndex !== null) { |
|
|
|
this.callNumVisible = true |
|
|
|
this.form = this.cellInfo |
|
|
|
console.log(this.cellInfo) |
|
|
|
} else { |
|
|
|
this.$message({ message: '请选择需要操作得层位', type: 'error', offset: 8 }) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSaveCallNum() { |
|
|
|
if (this.$refs['form']) { |
|
|
|
this.$refs['form'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.callNumVisible = false |
|
|
|
console.log(this.form) |
|
|
|
FetcheEditSortmarkByGrid(this.form).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (res) { |
|
|
|
this.$message({ message: '编辑索书号范围成功', type: 'success', offset: 8 }) |
|
|
|
this.callNumVisible = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleClose() { |
|
|
|
this.$refs['form'].resetFields() |
|
|
|
this.callNumVisible = false |
|
|
|
}, |
|
|
|
// 盘点 |
|
|
|
changeCheckSwitch(data) { |
|
|
|
console.log(data) |
|
|
|
if (this.cellIndex !== null) { |
|
|
|
this.$confirm('此操作将开启/关闭该层位的盘点功能' + '<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
this.cellInfo.check = JSON.parse(data) |
|
|
|
console.log(this.cellInfo) |
|
|
|
FetchChangeCheckByGrid(this.cellInfo).then(res => { |
|
|
|
this.$message({ message: '修改层位盘点状态成功', type: 'success', offset: 8 }) |
|
|
|
if (localStorage.getItem('bookShelfDetails')) { |
|
|
|
this.getInitShelfGridByShelfId(this.swiperActiveIndex + 1) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.checkValue = data === 'true' ? 'false' : 'true' |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
this.checkValue = data === 'true' ? 'false' : 'true' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ message: '请选择需要操作得层位', type: 'error', offset: 8 }) |
|
|
|
this.checkValue = data === 'true' ? 'false' : 'true' |
|
|
|
return false |
|
|
|
} |
|
|
|
}, |
|
|
|
changeBookSortSwitch(data) { |
|
|
|
console.log(data) |
|
|
|
if (this.cellIndex !== null) { |
|
|
|
this.$confirm('此操作将开启/关闭该层位的图书顺序检查' + '<span>你是否还要继续?</span>', '提示', { |
|
|
|
confirmButtonText: '继续', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
}).then(() => { |
|
|
|
this.cellInfo.order = JSON.parse(data) |
|
|
|
FetchChangeOrderByGrid(this.cellInfo).then(res => { |
|
|
|
this.$message({ message: '修改图书有序检查状态成功', type: 'success', offset: 8 }) |
|
|
|
if (localStorage.getItem('bookShelfDetails')) { |
|
|
|
this.getInitShelfGridByShelfId(this.swiperActiveIndex + 1) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.bookSortValue = data === 'true' ? 'false' : 'true' |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
this.bookSortValue = data === 'true' ? 'false' : 'true' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ message: '请选择需要操作得层位', type: 'error', offset: 8 }) |
|
|
|
this.bookSortValue = data === 'true' ? 'false' : 'true' |
|
|
|
return false |
|
|
|
} |
|
|
|
}, |
|
|
|
doExport(data) { |
|
|
|
console.log(data) |
|
|
|
// this.crud.downloadLoading = true |
|
|
|