代码更新:
1. 增加工站配置的导入功能。 2. 修复userName字段设定不正确的问题。
This commit is contained in:
parent
e9014815a9
commit
0841251bdd
|
|
@ -33,6 +33,15 @@ const uploadExcelGoods = (data) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uploadStationConfig = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/excel/uploadStationConfig',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
timeout: 100000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const uploadExcelDbs = (data) => {
|
const uploadExcelDbs = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/excel/uploadDbs',
|
url: '/excel/uploadDbs',
|
||||||
|
|
@ -155,5 +164,6 @@ export {
|
||||||
downloadInRecordExcel,
|
downloadInRecordExcel,
|
||||||
downloadOutRecordExcel,
|
downloadOutRecordExcel,
|
||||||
downloadInventoryRecordExcel,
|
downloadInventoryRecordExcel,
|
||||||
downloadLocationsExcel
|
downloadLocationsExcel,
|
||||||
|
uploadStationConfig
|
||||||
}
|
}
|
||||||
|
|
@ -1,66 +1,13 @@
|
||||||
import request from "@/http/request";
|
import request from "@/http/request";
|
||||||
|
|
||||||
const getAllGoods = () => {
|
const getGoodsInfoByPage = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/goods/getAllGoods',
|
url: '/goods/getGoodsInfoByPage',
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const getPartInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/getPartInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const updateGoodsInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/updateGoodsInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryPartInfoByPartNo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/queryPartInfoByPartNo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const updatePartInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/updatePartInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryPartNo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/queryPartNo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const deleteCurrentPartInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/deletePartInfo',
|
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getAllGoods,
|
getGoodsInfoByPage
|
||||||
updateGoodsInfo,
|
|
||||||
queryPartInfoByPartNo,
|
|
||||||
getPartInfo,
|
|
||||||
updatePartInfo,
|
|
||||||
queryPartNo,
|
|
||||||
deleteCurrentPartInfo
|
|
||||||
}
|
}
|
||||||
80
src/excel/UploadExcelStationConfig.vue
Normal file
80
src/excel/UploadExcelStationConfig.vue
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
<template>
|
||||||
|
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||||
|
:data="uploadForm.data">
|
||||||
|
<template #trigger>
|
||||||
|
<el-button type="primary">选取工站配置文件</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button style="margin-left: 10px;" type="success" @click="uploadDbs">上传工站配置数据</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { uploadStationConfig } from '@/api/excel.js'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { sizeFormatter } from '@/utils/formatter.js'
|
||||||
|
const file = ref()
|
||||||
|
const uploadForm = reactive({
|
||||||
|
data: {
|
||||||
|
fileId: '',
|
||||||
|
name: '',
|
||||||
|
type: '',
|
||||||
|
size: null,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const changeFile = (uploadFile) => {
|
||||||
|
file.value = uploadFile
|
||||||
|
uploadForm.data = {
|
||||||
|
fileId: file.value.raw.uid,
|
||||||
|
name: file.value.raw.name,
|
||||||
|
type: file.value.raw.type,
|
||||||
|
size: sizeFormatter(file.value.raw.size),
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const uploadRef = ref()
|
||||||
|
const uploadDbs = () => {
|
||||||
|
if (uploadForm == undefined || file.value == undefined) {
|
||||||
|
ElMessage.error('请选择文件之后再上传')
|
||||||
|
}
|
||||||
|
const jsonStr = JSON.stringify(uploadForm.data);
|
||||||
|
const blob = new Blob([jsonStr], {
|
||||||
|
type: 'application/json'
|
||||||
|
});
|
||||||
|
let formData = new FormData();
|
||||||
|
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||||
|
formData.append("obj", blob);
|
||||||
|
formData.append("file", file.value.raw);
|
||||||
|
uploadStationConfig(formData).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage({
|
||||||
|
message: '上传成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
clearFileInfos()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('上传错误')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const clearFileInfos = () => {
|
||||||
|
// 清空选择的文件项
|
||||||
|
uploadRef.value.clearFiles()
|
||||||
|
uploadForm.data = {
|
||||||
|
fileId: '',
|
||||||
|
name: '',
|
||||||
|
type: '',
|
||||||
|
size: null,
|
||||||
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
file.value = undefined
|
||||||
|
}
|
||||||
|
const previewFile = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
const request = axios.create({
|
const request = axios.create({
|
||||||
baseURL: 'http://localhost:12315/wms',
|
baseURL: 'http://10.90.36.70:443/wmsServer/wms',
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,22 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<UploadExcelGoods></UploadExcelGoods>
|
<UploadExcelGoods></UploadExcelGoods>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<UploadExcelStationConfig></UploadExcelStationConfig>
|
||||||
|
</el-row>
|
||||||
<el-row style="margin-top: 10px;">
|
<el-row style="margin-top: 10px;">
|
||||||
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="零件号" />
|
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
|
||||||
<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-button type="success" @click="exportExcel()">导出信息</el-button>
|
<el-button type="success" @click="exportExcel()">导出信息</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<br />
|
<br />
|
||||||
<el-table :data="partInfos" stripe border v-loading="loading" class="table-class" max-height="650px"
|
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" max-height="650px"
|
||||||
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
highlight-current-row @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.material" v-model="material"> </el-radio>
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="material" label="零件号" fixed="left" sortable min-width="120px" />
|
<el-table-column prop="material" label="零件号" fixed="left" sortable min-width="120px" />
|
||||||
|
|
@ -176,12 +179,14 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { getPartInfo, updatePartInfo, deleteCurrentPartInfo } from '@/api/goods.js'
|
import store from '@/store'
|
||||||
|
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { dateFormatter } from '@/utils/formatter.js'
|
import { dateFormatter } from '@/utils/formatter.js'
|
||||||
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||||
|
import UploadExcelStationConfig from '@/excel/UploadExcelStationConfig.vue'
|
||||||
import { downloadMaterialExcel } from '@/api/excel.js'
|
import { downloadMaterialExcel } from '@/api/excel.js'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -189,12 +194,12 @@ export default {
|
||||||
name: 'goods',
|
name: 'goods',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
partInfos: [],
|
goodsList: [],
|
||||||
pageInfo: {},
|
goodsInfo: {},
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
queryKey: '',
|
goodsIdQuery: '',
|
||||||
loading: true,
|
loading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
material: '',
|
material: '',
|
||||||
|
|
@ -210,22 +215,20 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
search() {
|
search() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.pageInfo.pageNum = this.currentPage
|
const request = {
|
||||||
this.pageInfo.pageSize = this.pageSize
|
pageNo: this.currentPage,
|
||||||
const tableRequest = {
|
pageSize: this.pageSize,
|
||||||
page: this.pageInfo,
|
goodsId: this.goodsIdQuery.trim(),
|
||||||
param: {
|
userName: store.getters.getUserName
|
||||||
material: this.queryKey.trim()
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
getPartInfo(tableRequest).then(res => {
|
getGoodsInfoByPage(request).then(res => {
|
||||||
const tableResponse = res.data
|
const tableResponse = res.data
|
||||||
if (tableResponse.code != 0) {
|
if (tableResponse.code == 0) {
|
||||||
console.log(tableResponse.code + ':' + tableResponse.message)
|
this.goodsList = tableResponse.returnData.lists
|
||||||
|
this.total = tableResponse.returnData.total
|
||||||
|
} else {
|
||||||
ElMessage.error(tableResponse.message)
|
ElMessage.error(tableResponse.message)
|
||||||
}
|
}
|
||||||
this.partInfos = tableResponse.rows
|
|
||||||
this.total = tableResponse.total
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询物料错误' + err.message)
|
ElMessage.error('查询物料错误' + err.message)
|
||||||
})
|
})
|
||||||
|
|
@ -235,7 +238,7 @@ export default {
|
||||||
return dateFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.queryKey = ''
|
this.goodsIdQuery = ''
|
||||||
this.search
|
this.search
|
||||||
},
|
},
|
||||||
// getCurrentPageGoods() {
|
// getCurrentPageGoods() {
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
import { getTaskRecords } from '@/api/record.js'
|
import { getTaskRecords } from '@/api/record.js'
|
||||||
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
import { downloadInRecordExcel } from '@/api/excel.js'
|
import { downloadInRecordExcel } from '@/api/excel.js'
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { getLocations, updateLocation } from '@/api/location.js'
|
import { getLocations, updateLocation } from '@/api/location.js'
|
||||||
import { ElMessage, ElLoading } from 'element-plus'
|
import { ElMessage, ElLoading } from 'element-plus'
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
import { getLocations, updateLocation } from '@/api/location.js'
|
import { getLocations, updateLocation } from '@/api/location.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'
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
import { getAllVehicles, updateVehicleInfo, deleteCurrentVehicle } from '@/api/vehicle'
|
import { getAllVehicles, updateVehicleInfo, deleteCurrentVehicle } from '@/api/vehicle'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
import { getAllStocks, updateStockInfo } from '@/api/stock.js'
|
import { getAllStocks, updateStockInfo } from '@/api/stock.js'
|
||||||
import { downloadStockExcel } from '@/api/excel.js'
|
import { downloadStockExcel } from '@/api/excel.js'
|
||||||
import { dateFormatter, locationFormatter, timeFormatter } from '@/utils/formatter.js'
|
import { dateFormatter, locationFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ import { ref, reactive } from 'vue'
|
||||||
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||||
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
||||||
import { downloadVehicleExcel } from '@/api/excel.js'
|
import { downloadVehicleExcel } from '@/api/excel.js'
|
||||||
|
import store from '@/store'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import store from '@/store'
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<div style="margin-bottom: 10px">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-row style="margin-top: 10px;">
|
<el-row>
|
||||||
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="请输入搜索信息" />
|
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="请输入搜索信息" />
|
||||||
<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>
|
||||||
|
|
@ -103,6 +103,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import store from '@/store'
|
||||||
import { queryLogs } from '@/api/wmsLog.js'
|
import { queryLogs } from '@/api/wmsLog.js'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user