Browse Source

数据总览导出/时间轴

master
xuhuajiao 5 months ago
parent
commit
0b54a7be8c
  1. 10
      src/api/stockTask/index.js
  2. 116
      src/views/visualCheck/checkManage/dataScreening/girdList.vue
  3. 3
      src/views/visualCheck/checkManage/dataScreening/index.vue
  4. 112
      src/views/visualCheck/checkManage/dataScreening/module/export.vue
  5. 5
      src/views/visualCheck/checkManage/dataScreening/regionsList.vue
  6. 11
      src/views/visualCheck/checkManage/dataScreening/shelfList.vue

10
src/api/stockTask/index.js

@ -131,4 +131,12 @@ export function FetchInitErrorProbaDesc(params) {
})
}
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc }
// 根据盘点id书架id和书架架位查询总览数据
export function FetchShowByBillIdAndShelfIdAndGridShelf(params) {
return request({
url: 'api/stocktask-task/showByBillIdAndShelfIdAndGridShelf' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc, FetchShowByBillIdAndShelfIdAndGridShelf }

116
src/views/visualCheck/checkManage/dataScreening/girdList.vue

@ -37,21 +37,24 @@
<div v-if="checkDateLine.length !== 0" class="time-update-cont">
<span class="time-left-txt">最后更新时间</span>
<!-- <el-button class="time-btn-txt">{{ checkDateLine[2].endTime }}</el-button> -->
<el-button>{{ checkDateLine[0].stockType === 0 ? '现在' : checkDateLine[0].endTime }}</el-button>
<el-button>{{ checkDateLine[timeIndex].stockType === 0 ? '现在' : checkDateLine[timeIndex].endTime }}</el-button>
<div class="time-update-line">
<el-timeline>
<el-timeline-item
v-for="(activity, index) in checkDateLine"
:key="index"
:icon="activity.icon"
:type="activity.type"
:color="activity.color"
:size="activity.size"
:timestamp="activity.endTime"
>
{{ computedStockType(activity.stockType) }}
</el-timeline-item>
</el-timeline>
<ul class="el-timeline">
<li v-for="(activity, index) in checkDateLine" :key="index" class="el-timeline-item" @click="handleHistory(activity,index)">
<div class="el-timeline-item__tail" />
<div class="el-timeline-item__node el-timeline-item__node--normal" :style="index === timeIndex ? 'background-color: rgb(11, 189, 135);' : ''">
<i v-if="index === timeIndex" class="el-timeline-item__icon el-icon-more" />
</div>
<div class="el-timeline-item__wrapper">
<div class="el-timeline-item__content">
{{ computedStockType(activity.stockType) }}
</div>
<div class="el-timeline-item__timestamp is-bottom">
{{ activity.endTime }}
</div>
</div>
</li>
</ul>
</div>
</div>
<crudOperation :permission="permission">
@ -216,12 +219,13 @@
</div>
</el-dialog>
<eForm ref="eform" />
<exportForm ref="exportform" />
<exportForm ref="exportform" export-type="grid" />
</div>
</template>
<script>
import { FetchInitStockInfo, FetchInitBookDetailsByGrids, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId } from '@/api/stockTask/index'
// FetchShowByBillIdAndShelfIdAndGridShelf
import { FetchInitStockInfo, FetchInitBookDetailsByGrids, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchShowByBillIdAndShelfIdAndGridShelf } from '@/api/stockTask/index'
import { dataScreeningCrud } from '@/views/visualCheck/mixins/index'
import { FetchBookShelfDetails, FetchShelfGridByShelfIdAndGridShelf } from '@/api/shelf/index'
import crudRegion from '@/api/area/index'
@ -291,7 +295,8 @@ export default {
shelfAllGridDataLoading: false,
billNoImg: null,
bookImgData: [],
bigImg: ''
bigImg: '',
timeIndex: 0
}
},
computed: {
@ -493,6 +498,11 @@ export default {
doExport(type) {
this.$refs.exportform.formExportVisible = true
this.$refs.exportform.type = 3
this.$refs.exportform.params = {
// 'floorId': this.floorId,
// 'regionId': this.regionId,
'shelfId': this.bookShelfDetails.id
}
},
handleCellCurrent(item, index) {
this.cellIndex = index
@ -630,6 +640,27 @@ export default {
this.shelfAllGridDataLoading = false
}).catch(() => {
})
},
handleHistory(item, index) {
this.timeIndex = index
console.log('item', item)
const params = {
'gridShelf': '0' + this.layerVal,
'ShelfId': this.bookShelfDetails.id,
'toward': this.bookShelfDetails.toward,
'billId': item.stockBill
}
FetchShowByBillIdAndShelfIdAndGridShelf(params).then(res => {
console.log('res', res)
// this.shelfAllGridData = []
// this.shelfAllGridData = res
// this.getInitStockInfo(this.shelfAllGridData)
// this.getInitBookDetailsByGrids(this.shelfAllGridData)
// this.shelfAllGridDataLoading = false
}).catch(() => {
})
}
}
}
@ -928,4 +959,55 @@ export default {
font-style: normal;
}
}
.el-timeline {
margin: 0;
font-size: 14px;
list-style: none;
}
.el-timeline-item {
position: relative;
padding-bottom: 20px;
}
.el-timeline-item__tail {
position: absolute;
left: 4px;
height: 100%;
border-left: 2px solid #dfe4ed;
}
.el-timeline-item__node {
position: absolute;
background-color: #dfe4ed;
border-radius: 50%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.el-timeline-item__icon {
color: #fff;
font-size: 13px;
}
.el-timeline-item__wrapper {
position: relative;
padding-left: 28px;
top: -3px;
}
.el-timeline-item__content {
color: #303133;
}
.el-timeline-item__timestamp {
color: #909399;
line-height: 1;
font-size: 13px;
}
.el-timeline-item__timestamp.is-bottom {
margin-top: 8px;
}
</style>

3
src/views/visualCheck/checkManage/dataScreening/index.vue

@ -64,7 +64,7 @@
</div>
</div>
<eForm ref="eform" />
<exportForm ref="exportform" />
<exportForm ref="exportform" export-type="floor" />
</div>
</template>
@ -183,6 +183,7 @@ export default {
doExport(type) {
this.$refs.exportform.formExportVisible = true
this.$refs.exportform.type = 1
this.$refs.exportform.params = {}
},
async getInitStockInfo(data) {
const promises = data.map(item => {

112
src/views/visualCheck/checkManage/dataScreening/module/export.vue

@ -6,8 +6,8 @@
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-radio-group v-model="form.exportRadio">
<el-radio :label="1">盘点统计表</el-radio>
<el-radio v-if="type !== 1" :label="2">盘点明细表</el-radio>
<el-radio v-if="type === 3" :label="3">盘点差异表</el-radio>
<el-radio v-if="type === 3" :label="2">盘点明细表</el-radio>
<!-- <el-radio v-if="type === 3" :label="3">盘点差异表</el-radio> -->
</el-radio-group>
</el-form>
<div slot="footer" class="dialog-footer">
@ -19,8 +19,10 @@
</template>
<script>
import { mapGetters } from 'vuex'
import CRUD, { form } from '@crud/crud'
// import { parseTime, saveAs, getBlob } from '@/utils/index'
import { parseTime, saveAs, getBlob } from '@/utils/index'
import qs from 'qs'
const defaultForm = { exportRadio: 1 }
export default {
@ -30,6 +32,12 @@ export default {
return Object.assign({ }, defaultForm)
})
],
props: {
exportType: {
type: String,
default: ''
}
},
data() {
return {
saveLoading: false,
@ -39,89 +47,57 @@ export default {
exportRadio: [
{ required: true, message: '请选择需要导出得数据', trigger: 'change' }
]
}
},
params: {}
}
},
computed: {
...mapGetters([
'user',
'baseApi'
])
},
methods: {
setData(type) {
this.form.stockType = type
const typeMap = {
1: {
regionId: null,
shelfId: null,
gridShelf: null,
gridId: null
},
2: {
regionId: this.form.regionId || null,
shelfId: null,
gridShelf: null,
gridId: null
},
4: {
regionId: null,
shelfId: this.form.shelfId || null,
gridShelf: null,
gridId: null
},
5: {
regionId: null,
shelfId: this.form.shelfId || null,
gridShelf: this.form.gridShelf || null,
gridId: null
},
6: {
regionId: null,
shelfId: null,
gridShelf: null,
gridId: this.form.gridId || null
}
}
console.log(typeMap)
[CRUD.HOOK.beforeRefresh]() {
},
handleCloseForm() {
this.$refs['form'].clearValidate()
this.$refs['form'].resetFields()
// this.form = {}
this.formExportVisible = false
},
handleComfiredExport() {
console.log(this.form.exportRadio)
this.$refs['form'].validate((valid) => {
if (valid) {
this.saveLoading = true
// const params = {
// 'imgIds': idsArray
// }
// const url = this.baseApi + '/api/fileRelevant/uploadImgs' + '?' + new URLSearchParams(params).toString()
// getBlob(url, (blob) => {
// const fileName = this.billNoImg + '-' + parseTime(new Date()) + '.zip'
// saveAs(blob, fileName)
// this.saveLoading = false
// this.handleCloseForm()
// })
// crudStockTaskLog.add(this.form).then((res) => {
// if (res.code !== 500) {
// this.$message({ message: '', type: 'success', offset: 8 })
// } else {
// this.$message({ message: res.message, type: 'error', offset: 8 })
// }
// this.handleCloseForm()
// this.saveLoading = false
// // this.$emit('refresh')
// }).catch(err => {
// console.log(err)
// this.saveLoading = true
// })
this.handleExport(this.params)
} else {
return false
}
})
},
//
[CRUD.HOOK.afterValidateCU](crud) {
return true
handleExport(params) {
if (this.form.exportRadio === 1) {
//
this.exportStockCheck(params)
} else if (this.form.exportRadio === 2) {
//
this.exportStockDetailsCheck(params)
}
this.saveLoading = false
this.handleCloseForm()
},
exportStockCheck(params) {
const fileName = '盘点统计-' + parseTime(new Date()) + '.xlsx'
getBlob(this.baseApi + '/api/stocktask-task/exportStockCheck' + '?' + qs.stringify(params, { indices: false }), function(blob) {
saveAs(blob, fileName)
})
},
exportStockDetailsCheck(params) {
const fileName = '盘点明细统计-' + parseTime(new Date()) + '.xlsx'
getBlob(this.baseApi + '/api/stocktask-task/exportStockDetailsCheck' + '?' + qs.stringify(params, { indices: false }), function(blob) {
saveAs(blob, fileName)
})
}
}
}

5
src/views/visualCheck/checkManage/dataScreening/regionsList.vue

@ -63,7 +63,7 @@
</div>
</div>
<eForm ref="eform" />
<exportForm ref="exportform" />
<exportForm ref="exportform" export-type="regions" />
</div>
</template>
@ -202,6 +202,9 @@ export default {
doExport(type) {
this.$refs.exportform.formExportVisible = true
this.$refs.exportform.type = 2
this.$refs.exportform.params = {
'regionId': this.regionOptions[this.tabIndex].id
}
},
async getInitStockInfo(data) {
const promises = data.map(item => {

11
src/views/visualCheck/checkManage/dataScreening/shelfList.vue

@ -114,7 +114,7 @@
</div>
</div>
<eForm ref="eform" />
<exportForm ref="exportform" />
<exportForm ref="exportform" export-type="shelf" />
</div>
</template>
@ -296,8 +296,8 @@ export default {
},
getInitStockInfo(data) {
const params = {
'floorId': this.floorId,
'regionId': this.regionId,
// 'floorId': this.floorId,
// 'regionId': this.regionId,
'shelfId': data.id
}
this.handleInitStockInfo(params)
@ -330,6 +330,11 @@ export default {
doExport(type) {
this.$refs.exportform.formExportVisible = true
this.$refs.exportform.type = 3
this.$refs.exportform.params = {
'floorId': this.floorId,
'regionId': this.regionId,
'shelfId': this.bookShelfDetails.id
}
},
removeAreaPrefix(gridNames) {
return gridNames.replace(/\d*区|\d*层/g, '')

Loading…
Cancel
Save