Compare commits
4 Commits
bbac7b8a33
...
49970b5d8d
| Author | SHA1 | Date | |
|---|---|---|---|
| 49970b5d8d | |||
| 1f8d5086be | |||
| 11519bd3f8 | |||
| facd0fc788 |
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
@ -2,11 +2,11 @@ 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'
|
||||||
// axios.defaults.baseURL = 'http://localhost:12315/wms'
|
//axios.defaults.baseURL = 'http://localhost:12315/wms'
|
||||||
// axios.defaults.baseURL = 'https://csclasrs.ecorp.cat.com/wmsServer/wms'
|
// axios.defaults.baseURL = 'https://csclasrs.ecorp.cat.com/wmsServer/wms'
|
||||||
|
|
||||||
// // request 请求器
|
// // request 请求器
|
||||||
|
|
|
||||||
|
|
@ -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 />
|
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 />
|
||||||
<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'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
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)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,10 @@
|
||||||
: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 />
|
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 />
|
||||||
<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>
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-button type="primary" @click="search()">搜索</el-button>
|
||||||
|
|
@ -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 => {
|
||||||
|
|
|
||||||
|
|
@ -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)// 用户信息
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user