中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

427 lines
16 KiB

<template>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud"
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad"
@sort-change="sortChange"
>
<template #menu-left>
<el-button type="primary" @click="handleAdd" v-if="permission.binTransfer_adjust">库位调整</el-button>
<!-- <el-button type="danger" @click="handle()">删除</el-button> -->
</template>
<template #menu-right>
<!-- <el-button type="primary" @click="allocationFun()">批量调拨</el-button> -->
<!-- <el-button type="primary" @click="handleImport()">导入</el-button> -->
</template>
<template #menu="scope">
<!-- <el-button type="text" @click="handle(scope.row.tbId)">调拨</el-button> -->
</template>
</avue-crud>
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport"
templateUrl="/blade-desk/QA/CycleTestItem/download-excel-template"
templateName="试验项目模板.xls"
importUrl="/blade-desk/QA/CycleTestItem/import-excel"
@closeDialog="closeDialog"></basic-import>
<add-edit-dialog v-if="showDialog" :title="dialogTitle" :showDialog="showDialog" @closeDialog="closeDialog"></add-edit-dialog>
</basic-container>
</template>
<script>
import basicImport from '@/components/basic-import/main.vue'
import { getTransferList,delTransfer} from "@/api/storeManagement/binTransfer.js"
import { change } from '@/api/job/jobinfo'
import addEditDialog from './components/addEditDialog.vue'
import { mapGetters } from 'vuex';
export default {
components: {
basicImport,addEditDialog
},
data() {
return {
isShowImport: false,
loading: false,
selectionList: [],
dialogTitle:'新增',
showDialog:false,
query:{},
data:[],
option: {
height: 'auto',
calcHeight: 32,
tip: false,
// size: 'medium',
simplePage: true,
searchShow: true,
searchMenuSpan: 18,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
delBtn: false,
addBtn: false,
editBtnText: '修改',
viewBtnText: '详情',
labelWidth: 120,
menuWidth: 70,
dialogWidth: 1040,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
showOverflowTooltip: true,
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
align: 'center',
editBtn: false,
menu:false,
column: [
{
label: '物料编号',
prop: 'goodsCode',
// bind: 'stRealtimeStock.coGoods.goodsCode',
sortable: 'custom',
filter: true,
span: 12,
search: true,
type: 'select',
filterable: true,
dicUrl:'/api/blade-wms/stGoods/list',
remote: true,
props:{
label: 'goodsCode',
value: 'goodsCode',
res: 'data.records',
},
rules: [{ required: true, message: '请选择物料编号', trigger: 'blur' }],
// onChange:(value =>{
// let tmp = value.dic.find(item => item.id == value.value)
// this.form.goodsName = tmp && tmp.goodsName
// })
},
{
label: '物料名称',
prop: 'goodsName',
// bind: 'stRealtimeStock.coGoods.goodsName',
sortable: 'custom',
filter: true,
span: 12,
search: false,
disabled: true,
rules: [{ required: true, message: '请输入物料名称', trigger: 'blur' }]
},
{
label: '旧库房号',
prop: 'oldWarehouseName',
// bind: 'oldStorageLocation.coStorehouse.shName',
// sortable: 'custom',
filter: true,
span: 12,
search: false,
// type: 'select',
// filterable: true,
// dicUrl:'/api/blade-wms/stStorehouse/list?shName={{key}}',
// remote: true,
// props:{
// label: 'shName',
// value: 'id',
// res: 'data.records',
// },
// dicData: [
// {
// label: '库房一',
// value: 1
// },
// {
// label: '库房二',
// value: 2
// }
// ],
rules: [{ required: true, message: '请选择旧库房号', trigger: 'blur' }]
},
{
label: '旧库位号',
prop: 'oldLocation',
// bind: 'oldStorageLocation.location',
// sortable: 'custom',
filter: true,
span: 12,
search: false,
// type: 'select',
// filterable: true,
// dicUrl:'/api/blade-wms/stStorageLocation/list?location={{key}}',
// remote: true,
// props:{
// label: 'location',
// value: 'id',
// res: 'data.records',
// },
// dicData: [
// {
// label: '库位一',
// value: 1
// },
// {
// label: '库位二',
// value: 2
// }
// ],
rules: [{ required: true, message: '请选择旧库位号', trigger: 'blur' }]
},
{
label: '新库房号',
prop: 'newWarehouseName',
// bind: 'newStorageLocation.coStorehouse.shName',
// sortable: 'custom',
filter: true,
span: 12,
search: false,
// type: 'select',
filterable: true,
// dicUrl:'/api/blade-wms/stStorehouse/list?shName={{key}}',
// remote: true,
// props:{
// label: 'shName',
// value: 'id',
// res: 'data.records',
// },
// dicData: [
// {
// label: '库房一',
// value: 1
// },
// {
// label: '库房二',
// value: 2
// }
// ],
rules: [{ required: true, message: '请选择新库房号', trigger: 'blur' }]
},
{
label: '新库位号',
prop: 'newLocation',
// bind: 'newStorageLocation.location',
// sortable: 'custom',
filter: true,
span: 12,
search: false,
// type: 'select',
filterable: true,
// dicUrl:'/api/blade-wms/stStorageLocation/list?location={{key}}',
// remote: true,
// props:{
// label: 'location',
// value: 'id',
// res: 'data.records',
// },
// dicData: [
// {
// label: '库位一',
// value: 1
// },
// {
// label: '库位二',
// value: 2
// }
// ],
rules: [{ required: true, message: '请选择新库位号', trigger: 'blur' }]
},
{
label: '物料规格',
prop: 'specifications',
// bind: 'stRealtimeStock.coGoods.specifications',
sortable: 'custom',
filter: true,
span: 12,
search: false,
},
{
label: '批次号',
prop: 'piNo',
// bind: 'stRealtimeStock.piNo',
sortable: 'custom',
filter: true,
span: 12,
search: false,
},
{
label: '库存数量',
prop: 'quantity',
// bind: 'stRealtimeStock.quantity',
sortable: 'custom',
filter: true,
span: 12,
search: false,
type: 'number',
step: 1,
},
]
},
form: {
},
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
}
},
computed: {
...mapGetters(['permission']),
},
methods: {
// 排序
sortChange({ prop, order }) {
this.query.descs = undefined;
this.query.ascs = undefined;
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs';
this.query[orderByFieldKey] = !prop
? undefined
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
// 重新加载数据
this.onLoad(this.page, this.query);
},
closeDialog(val){
this.isShowImport = false
this.showDialog = false
if(val){
this.onLoad()
}
},
handleImport() {
this.isShowImport = true
},
allocationFun(arId) {
// if (arId == null && this.selectionArr.length === 0) {
// return this.$message.warning('请先选择数据再进行调拨!');
// }
this.$confirm('是否确认调拨', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const obj = { list: [] };
if (arId == null) {
this.selectionArr.forEach(item => {
obj.list.push(item.arId);
});
} else {
obj.list.push(arId);
}
// this.$ajax.post('stAllotRecord/updateLocation', obj).then(res => {
// if (res.code === 0) {
// this.$message.success(this.$t('store.allocationOk'));
// this.$refs.myTable.load();
// }
// });
})
.catch(() => {
this.$message.info(
this.$t('global.canceled') + this.$t('store.allocation')
);
});
},
// 点击新增按钮
handleAdd(){
this.showDialog = true
},
searchChange(params, done){
this.query = params
this.page.currentPage = 1;
this.onLoad()
done()
},
searchReset(){
this.query = {}
this.onLoad()
},
currentChange(currentPage){
this.page.currentPage = currentPage
},
sizeChange(pageSize){
this.page.pageSize = pageSize
},
refreshChange(){
this.onLoad()
},
rowDel(row){
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
delTransfer({ids:row.id}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
}
})
})
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
})
},
// 多选
selectionChange(list) {
this.selectionList = list;
},
onLoad() {
getTransferList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
res.data.data.records.map(item =>{
item.newSlId = item.newSlId == -1 ? '' : item.newSlId
})
this.data = res.data.data.records
console.log('data-------------',this.data)
this.page.total = res.data.data.total;
})
// this.loading = true
// this.data = [
// {}
// ]
// this.page.total = this.data.length
// this.loading = false
// setTimeout(() => {
// this.selectionClear()
// }, 500)
}
}
}
</script>
<style lang="scss" scoped></style>