Browse Source

添加物料库存资源配置

pull/153/head
xuxiaoming 3 years ago
parent
commit
b79e888e55
4 changed files with 125 additions and 10 deletions
  1. +5
    -2
      src/server/factoryModel/materialResourceMaintenance/artStockResource.js
  2. +23
    -4
      src/views/factoryModel/materialResourceMaintenance/artStockResource/index.vue
  3. +93
    -0
      src/views/factoryModel/materialResourceMaintenance/artStockResource/upload.vue
  4. +4
    -4
      src/views/productionPlanning/customerInquiry/index.vue

+ 5
- 2
src/server/factoryModel/materialResourceMaintenance/artStockResource.js View File

@ -1,7 +1,8 @@
import {
post,
put,
get
get,
upload
} from "../../api";
// 工厂列表
export const getPlantList = (params) => get('/admin/base/plant/selectlist', params);
@ -22,4 +23,6 @@ export const getDetails = (ResourceId) => get(`/admin/ap/artstockresource/select
// 列表
export const queryTableData = (params) =>get('/admin/ap/artstockresource/query', params);
// 删除
export const deleteHanle = (params) => '/admin/ap/artstockresource/deleteone/'+ params;
export const deleteHanle = (params) => '/admin/ap/artstockresource/deleteone/'+ params;
export const importArtResource = (params) => upload("/admin/base/article/importartresource", params)

+ 23
- 4
src/views/factoryModel/materialResourceMaintenance/artStockResource/index.vue View File

@ -46,6 +46,12 @@
</el-button>
</el-form-item>
<el-form-item class="fr">
<el-button
icon="el-icon-upload"
class="add-button-style"
@click="importDialogVisible = true"
>导入
</el-button>
<el-button
icon="el-icon-plus"
class="add-button-style"
@ -62,7 +68,7 @@
:data="tableData"
border
size="mini"
v-if="tableHeight" :height="tableHeight"
v-if="tableHeight" :height="tableHeight"
>
<el-table-column
v-for="item in headers"
@ -82,7 +88,7 @@
<span v-else-if="item === 'AP_ArticleStockLevel-MaxCoverPeriodType'">{{
mappingText(maxCoverPeriodTypeArray, scope.row["AP_ArticleStockLevel-MaxCoverPeriodType"], 'Stdef-StdefTyp', 'Stdef-Bez')
}}</span>
<span v-else-if="item === 'AP_ArticleStockLevel-CompleteStatus'">{{
<span v-else-if="item === 'AP_ArticleStockLevel-CompleteStatus'">{{
mappingText(completeStatusList, scope.row["AP_ArticleStockLevel-CompleteStatus"], 'Stdef-StdefTyp', 'Stdef-Bez')
}}</span>
<span v-else>{{ scope.row[item] }}</span>
@ -130,22 +136,30 @@
:articleList="articleList"
@setIsAddOrEdit="setIsAddOrEdit"
/>
<Upload
v-model="importDialogVisible"
@editCallBack="completeCallBack" />
</div>
</template>
<script>
import AddOrEdit from "./addOrEdit.vue";
import Upload from "./upload.vue";
import { ListMixin } from "@/mixins/newListMixin";
import { queryTableData, getPlantList } from "@/server/factoryModel/materialResourceMaintenance/inventoryLevels";
import { deleteHanle, getArtIdList } from "@/server/factoryModel/materialResourceMaintenance/artStockResource";
import { deleteHanle,getArtIdList } from "@/server/factoryModel/materialResourceMaintenance/artStockResource";
export default {
components: {
AddOrEdit,
Upload
},
mixins: [ListMixin],
data() {
return {
importDialogVisible:false,
tableHeight:0,
queryTableData: queryTableData,
loading: false,
@ -172,6 +186,11 @@ export default {
};
},
methods: {
//
completeCallBack() {
this.importDialogVisible = false
},
//
getArticleList(){
getArtIdList().then(({data=[]})=>{
@ -218,7 +237,7 @@ export default {
this.getStanderOne({ statid: 'AP_ArticleStockLevel-MaxCoverPeriodType' }).then((res) => {
this.maxCoverPeriodTypeArray = res.data
})
this.getStanderOne({ statid: 'AP_ArticleStockLevel-CompleteStatus' }).then((res) => {
this.getStanderOne({ statid: 'AP_ArticleStockLevel-CompleteStatus' }).then((res) => {
this.completeStatusList = res.data
console.log(this.completeStatusList);
})


+ 93
- 0
src/views/factoryModel/materialResourceMaintenance/artStockResource/upload.vue View File

@ -0,0 +1,93 @@
<template>
<el-dialog :title="title" width="50%" :before-close="handleClose" >
<input
type="file"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, xls, xlsx"
@change="previewUpload"
>
<el-button
type="primary"
:loading="uploadLoading"
icon="el-icon-upload"
size="mini"
@click="uploadEvent"
>上传</el-button>
</el-dialog>
</template>
<script>
import { importArtResource } from "@/server/factoryModel/materialResourceMaintenance/artStockResource";
export default {
name: 'upload',
props:{
showUploadDailog : {
type: Boolean,
default: () => {
return false
}
},
},
data() {
return {
title: '导入', //
uploadLoading: false,
excel: '',
}
},
created () {
},
methods: {
handleClose(done) { //
done();
},
//
previewUpload(file) {
this.excle = file.target.files[0]
},
//
uploadEvent() {
this.uploadLoading = true
if (this.excle === null || this.excle === '' || this.excle === undefined) {
this.$message({
showClose: true,
duration: 2000,
message: '请选择文件',
type: 'error'
})
this.uploadLoading = false
} else {
const uploadData = new FormData()
uploadData.append('upload', this.excle)
importArtResource(uploadData).then(res => {
this.uploadLoading = false
if (res.code === 200) {
this.$message({
showClose: true,
duration: 2000,
message: '导入成功',
type: 'success'
})
this.$emit('editCallBack', res.data)
} else {
this.$message({
showClose: true,
duration: 2000,
message: res.msg,
type: 'error'
})
}
}).catch((res) => {
this.uploadLoading = false
this.$message({
showClose: true,
duration: 2000,
message: res.msg,
type: 'error'
})
})
}
},
}
}
</script>

+ 4
- 4
src/views/productionPlanning/customerInquiry/index.vue View File

@ -13,7 +13,7 @@
<el-form-item>
<el-button
class="add-button-style"
@click="importDialogVisable = true"
@click="importDialogVisible = true"
>批量导入
</el-button>
</el-form-item>
@ -105,7 +105,7 @@
@setIsAdd="setIsAdd"
@pushData="pushData" />
<Upload
v-model="importDialogVisable"
v-model="importDialogVisible"
@editCallBack="completeCallBack" />
</div>
@ -126,7 +126,7 @@ export default {
tableHeight:0,
loading: false,
isAdd: false,
importDialogVisable: false,
importDialogVisible: false,
deliveryTrialDisable:false,
isShowDialog: '',
detailHeaders: [],
@ -167,7 +167,7 @@ export default {
completeCallBack(dataList) {
this.tableData = dataList
this.importDialogVisable = false
this.importDialogVisible = false
},
//
getCustomerList(){


Loading…
Cancel
Save