Compare commits

...

4 Commits

5 changed files with 72 additions and 9 deletions

View File

@ -32,6 +32,17 @@ const getStockUpdateRecord = (params) => {
}) })
} }
const downloadStockUpdateRecordExcel = (data) => {
return request({
url: '/excel/downloadStockUpdateRecordExcel',
method: 'post',
responseType: 'blob',
data: data,
timeout: 600000
})
}
const handleExceptionStock = (params) => { const handleExceptionStock = (params) => {
return request({ return request({
url: '/stock/handleExceptionStock', url: '/stock/handleExceptionStock',
@ -45,5 +56,6 @@ export {
updateStockInfo, updateStockInfo,
getStockNumByGoodsId, getStockNumByGoodsId,
getStockUpdateRecord, getStockUpdateRecord,
handleExceptionStock handleExceptionStock,
downloadStockUpdateRecordExcel
} }

View File

@ -2,7 +2,7 @@ import axios from 'axios'
const request = axios.create({ const request = axios.create({
baseURL: 'https://csclasrs.ecorp.cat.com/wmsServer/wms', baseURL: 'https://csclasrs.ecorp.cat.com/wmsServer/wms',
timeout: 5000 timeout: 10000
}) })
// axios.defaults.baseURL = 'http://10.90.36.70:443/wmsServer/wms' // axios.defaults.baseURL = 'http://10.90.36.70:443/wmsServer/wms'

View File

@ -9,11 +9,16 @@
:suffix-icon="Search" /> :suffix-icon="Search" />
<el-select-v2 v-model="reasonQuery" style="width: 158px; margin-right: 10px;" <el-select-v2 v-model="reasonQuery" style="width: 158px; margin-right: 10px;"
placeholder="请选择更新原因" :options="reasonOptions" @change="search()"></el-select-v2> placeholder="请选择更新原因" :options="reasonOptions" @change="search()"></el-select-v2>
<el-date-picker v-model="updateTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts" <el-date-picker v-model="updateTimeQuery" type="date" placeholder="起始完成日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-date-picker v-model="updateEndTimeQuery" type="date" placeholder="完成结束日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable /> style="width: 158px; margin-right: 10px;" clearable />
<el-button type="primary" @click="search()">搜索</el-button> <el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button> <el-button type="warning" @click="reset()">重置</el-button>
</el-row> </el-row>
<el-row>
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel">导出</el-button>
</el-row>
</div> </div>
<br /> <br />
<el-table :data="recordList" stripe border v-loading="loading" class="table-class" highlight-current-row <el-table :data="recordList" stripe border v-loading="loading" class="table-class" highlight-current-row
@ -50,12 +55,14 @@
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { getStockUpdateRecord } from '@/api/stock.js' import { getStockUpdateRecord } from '@/api/stock.js'
import { errorBox } from '@/utils/myMessageBox.js'
import { dateFormatter, timeFormatter } from '@/utils/formatter.js' import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script> </script>
<script> <script>
import {downloadStockUpdateRecordExcel} from "@/api/stock";
import {errorBox} from "@/utils/myMessageBox";
export default { export default {
name: 'stockUpdateRecord', name: 'stockUpdateRecord',
data() { data() {
@ -68,6 +75,7 @@ export default {
goodsIdQuery: '', goodsIdQuery: '',
reasonQuery: '', reasonQuery: '',
updateTimeQuery: null, updateTimeQuery: null,
updateEndTimeQuery: null,
shortcuts: [ shortcuts: [
{ {
text: '今天', text: '今天',
@ -145,6 +153,7 @@ export default {
goodsId: this.goodsIdQuery.trim(), goodsId: this.goodsIdQuery.trim(),
reason: this.reasonQuery.trim(), reason: this.reasonQuery.trim(),
updateTime: timeFormatter(this.updateTimeQuery), updateTime: timeFormatter(this.updateTimeQuery),
updateEndTime: timeFormatter(this.updateEndTimeQuery),
userName: store.getters.getUserName userName: store.getters.getUserName
} }
getStockUpdateRecord(request).then(res => { getStockUpdateRecord(request).then(res => {
@ -161,6 +170,43 @@ export default {
}) })
this.loading = false this.loading = false
}, },
exportExcel() {
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
vehicleId: this.vehicleIdQuery.trim(),
goodsId: this.goodsIdQuery.trim(),
reason: this.reasonQuery.trim(),
updateTime: timeFormatter(this.updateTimeQuery),
updateEndTime: timeFormatter(this.updateEndTimeQuery),
userName: store.getters.getUserName
}
downloadStockUpdateRecordExcel(request).then(res => {
const link = document.createElement('a');//a
try {
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
let blob = res.data //blob
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //
let _fileName = "库存更新记录" + dateFormatter(new Date) + ".xlsx"
link.style.display = 'none'//
// URL
const url = window.URL || window.webkitURL || window.moxURL
link.href = url.createObjectURL(blob)
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
url.revokeObjectURL(link.href)//url
} catch (e) {
console.log(e)
errorBox('下载文件失败')
}
}).catch(err => {
console.log(err)
errorBox('导出失败')
})
},
timeFormat: (row, column, cellValue, index) => { timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue) return timeFormatter(cellValue)
}, },

View File

@ -11,7 +11,9 @@
:suffix-icon="Search" /> :suffix-icon="Search" />
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号" <el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
:suffix-icon="Search" /> :suffix-icon="Search" />
<el-date-picker v-model="workDateQuery" type="date" placeholder="选择工作日期" :shortcuts="shortcuts" <el-date-picker v-model="workDateQuery" type="date" placeholder="工作起始日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable />
<el-date-picker v-model="workEndDateQuery" type="date" placeholder="工作结束日期" :shortcuts="shortcuts"
style="width: 158px; margin-right: 10px;" clearable /> style="width: 158px; margin-right: 10px;" clearable />
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;" <el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;"
placeholder="请选择缺料状态" :options="lackStatusOptions" @change="search()"></el-select-v2> placeholder="请选择缺料状态" :options="lackStatusOptions" @change="search()"></el-select-v2>
@ -81,6 +83,7 @@ export default {
goodsIdQuery: '', goodsIdQuery: '',
standIdQuery: '', standIdQuery: '',
workDateQuery: null, workDateQuery: null,
workEndDateQuery: null,
shortcuts: [ shortcuts: [
{ {
text: '今天', text: '今天',
@ -129,6 +132,7 @@ export default {
goodsId: this.goodsIdQuery.trim(), goodsId: this.goodsIdQuery.trim(),
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery, lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
workDate: timeFormatter(this.workDateQuery), workDate: timeFormatter(this.workDateQuery),
workEndDate: timeFormatter(this.workEndDateQuery),
userName: store.getters.getUserName userName: store.getters.getUserName
} }
getWorkSummary(request).then(res => { getWorkSummary(request).then(res => {
@ -192,6 +196,7 @@ export default {
goodsId: this.goodsIdQuery.trim(), goodsId: this.goodsIdQuery.trim(),
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery, lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
workDate: timeFormatter(this.workDateQuery), workDate: timeFormatter(this.workDateQuery),
workEndDate: timeFormatter(this.workEndDateQuery),
userName: store.getters.getUserName userName: store.getters.getUserName
} }
downloadWorkSummaryExcel(request).then(res => { downloadWorkSummaryExcel(request).then(res => {

View File

@ -5,9 +5,9 @@
<el-form-item> <el-form-item>
<el-input type="text" v-model="loginForm.loginAccount" auto-complete="off" placeholder="账号"></el-input> <el-input type="text" v-model="loginForm.loginAccount" auto-complete="off" placeholder="账号"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item> <el-form-item>
<el-input type="password" v-model="loginForm.loginPassword" auto-complete="off" placeholder="密码"></el-input> <el-input type="password" v-model="loginForm.loginPassword" auto-complete="off" placeholder="密码"></el-input>
</el-form-item> --> </el-form-item>
<el-form-item style="width: 100%"> <el-form-item style="width: 100%">
<el-button type="primary" style="width: 100%; border: none" @click="login">登录</el-button> <el-button type="primary" style="width: 100%; border: none" @click="login">登录</el-button>
</el-form-item> </el-form-item>
@ -70,7 +70,7 @@ const login = () => {
text: 'Loading', text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)', background: 'rgba(0, 0, 0, 0.7)',
}) })
loginWithoutAuth(loginForm).then(res => { loginWithAuth(loginForm).then(res => {
loading.close() loading.close()
if (res.data.code == 0) { if (res.data.code == 0) {
store.commit('mutationUser', res.data.returnData.user)// store.commit('mutationUser', res.data.returnData.user)//