仓库样式修改

dev-scheduling
jinna 4 weeks ago
parent 5507398dfb
commit 1d136843d9
  1. 313
      src/views/basicData/components/inventory.vue
  2. 127
      src/views/basicData/components/warehouse.vue
  3. 4
      src/views/basicData/js/warehouseMain.js
  4. 702
      src/views/basicData/warehouseMaintenance.vue
  5. 1
      src/views/productionTesting/components/trialItem.vue
  6. 2
      src/views/productionTesting/components/trialStandard.vue
  7. 4
      src/views/qualityManagement/reviewFormMess/index.vue

@ -0,0 +1,313 @@
<template>
<div>
<avue-crud
:option="storageOption"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@row-del="rowDel"
@row-update="rowUpdate"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template #menu-left>
<el-button type="primary" @click="handleAdd">新增</el-button>
</template>
</avue-crud>
<add-edit-dialog v-if="showDialog" :showDialog="showDialog" :title="dialogTitle"
@closeDialog="closeDialog"></add-edit-dialog>
</div>
</template>
<script>
import {storageOption} from "../js/warehouseMain.js"
import addEditDialog from "../components/addEditDialog.vue"
import {getWareList,addWare,editWare,deleteWare,getLocationList,delLocation,
editLocation,getUserByRoleAlias,getWareByUser,getWareSelect,getUserByWare,saveUserWare,getAllUser,
saveWareUser,getMaterialSelect} from "@/api/storeManagement/warehouseMaintenance";
export default {
components:{addEditDialog},
data(){
return{
storageOption:{
columnSort: true,
tip: false,
height: "auto",
align: "center",
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
addBtn: false,
delBtn: true,
editBtn: true,
editBtnIcon: " ",
delBtnIcon: " ",
labelWidth: 120,
menu: true,
menuWidth: 120,
dialogWidth: 920,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
searchLabelPosition: "left",
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
menuAlign: "left",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
column: [
{
label: '所属库房',
prop: 'shId',
span: 12,
overflow: true,
search: true,
type: 'select',
filterable: true,
remote: true,
dicUrl:`/api/blade-wms/stStorehouse/page?shName={{key}}`,
props:{
label: 'shName',
value: 'id',
res: 'data.records',
},
// dicData: [
// {
// label: '',
// value: 1
// },
// {
// label: '',
// value: 2
// },
// {
// label: '',
// value: 3
// },
// ],
rules: [
{
required: true,
message: '请输入所属库房',
trigger: 'blur',
},
],
},
{
label: '库位号',
prop: 'location',
span: 12,
overflow: true,
search: true,
rules: [
{
required: true,
message: '请输入库位号',
trigger: 'blur',
},
],
},
{
label: '物料编号',
prop: 'goodsCode',
span: 12,
overflow: true,
search: true,
type: 'select',
filterable: true,
remote: true,
dicUrl:`/api/blade-wms/stGoods/page?goodsCode={{key}}`,
props:{
label: 'goodsCode',
value: 'id',
res: 'data.records',
},
change:(val)=>{
console.log('val========',val)
this.form.goodsName = val && val.item && val.item.goodsName
this.form.specifications = val && val.item && val.item.specifications
this.form.mtltmrk = val && val.item && val.item.mtltmrk
}
// dicData: [
// {
// label: '',
// value: 1
// },
// {
// label: '',
// value: 2
// },
// {
// label: '',
// value: 3
// },
// ],
// rules: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
{
label: '物料名称',
prop: 'goodsName',
span: 12,
overflow: true,
search: false,
disabled: true,
// rules: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
{
label: '物料规格',
prop: 'specifications',
span: 12,
overflow: true,
search: false,
disabled: true,
// rules: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
{
label: '型号/牌号',
prop: 'mtltmrk',
span: 12,
overflow: true,
search: false,
disabled: true,
// rules: [
// {
// required: true,
// message: '/',
// trigger: 'blur',
// },
// ],
},
]
},
data: [],
form: {},
query:{},
page: {
total: 0,
current: 1,
size: 10,
},
showDialog:false,
dialogTitle:'',
loading: false,
}
},
mounted(){
},
methods:{
searchChange(params, done){
this.query = params
this.page.currentPage = 1;
this.onLoad()
done()
},
searchReset(){
this.query = {}
this.onLoad()
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad()
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad()
},
refreshChange(){
this.onLoad()
},
handleAdd() {
this.dialogTitle = '新增'
this.showDialog = true
},
rowDel(row) {
this.$confirm("确定删除此条数据?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
delLocation({
ids:row.id
}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
}
})
})
},
rowUpdate(row, index, done, loading) {
console.log('row',row)
editLocation(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
done()
this.onLoad()
}
})
},
closeDialog(val){
this.showDialog = false
if(val){
this.getLocation()
}
},
onLoad(){
getLocationList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total;
})
}
}
}
</script>
<style>
</style>

@ -0,0 +1,127 @@
<template>
<div>
<avue-crud
:option="warehouseOption"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@row-del="rowDel"
@row-save="rowSave"
@row-update="rowUpdate"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
></avue-crud>
</div>
</template>
<script>
import {warehouseOption} from "../js/warehouseMain.js"
import {getWareList,addWare,editWare,deleteWare,getLocationList,delLocation,
editLocation,getUserByRoleAlias,getWareByUser,getWareSelect,getUserByWare,saveUserWare,getAllUser,
saveWareUser,getMaterialSelect} from "@/api/storeManagement/warehouseMaintenance";
export default {
data() {
return {
warehouseOption,
data: [],
form: {},
page: {
total: 0,
current: 1,
size: 10,
},
query:{},
loading: false,
};
},
mounted() {
},
methods:{
searchChange(params, done){
this.query = params
this.page.currentPage = 1;
this.onLoad()
done()
},
searchReset(){
this.query = {}
this.onLoad()
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad()
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad()
},
refreshChange(){
this.onLoad()
},
rowDel(row) {
this.$confirm("确定删除此条数据?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
deleteWare({
ids:row.id
}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
}
})
})
},
rowSave(row, done, loading){
addWare(row).then(res =>{
if(res.data.code == 200){
this.$message.success('新增成功')
done()
this.onLoad()
}
}).catch(() =>{
// loading()
done()
})
},
rowUpdate(row, index, done, loading) {
console.log('row',row)
editWare(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
done()
this.onLoad()
}
})
},
onLoad(){
getWareList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
res.data.data.records.map(item =>{
item.type = (item.type || item.type == 0) ? item.type + '' : item.type
item.toolingType = (item.toolingType || item.toolingType == 0) ? item.toolingType + '' : item.toolingType
})
this.data = res.data.data.records
this.page.total = res.data.data.total;
})
}
}
};
</script>
<style>
</style>

@ -564,6 +564,10 @@ export const storageOption = {
value: 'id',
res: 'data.records',
},
change:(val)=>{
console.log('val========',val)
this.form.goodsName = val.goodsName
}
// dicData: [
// {
// label: '物料一',

@ -1,94 +1,45 @@
<template>
<basic-container>
<el-tabs v-model="tabPosition" class="demo-tabs" @tab-change="tabPositionChange">
<el-tab-pane label="库房设置" name="warehouseSetup">
<avue-crud
height="460px"
:option="warehouseOption"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@row-del="rowDel"
@row-save="rowSave"
@row-update="rowUpdate"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<!-- <template #menu="{ row }">
<el-button type="text" v-if="tabPosition == 'warehouseSetup'"
>管理员设置</el-button
>
</template> -->
</avue-crud>
</el-tab-pane>
<el-tabs v-model="activeName" @tab-change="tabPositionChange">
<el-tab-pane label="库房设置" name="warehouseSetup"></el-tab-pane>
<el-tab-pane label="库管设置" name="inventorySetup"></el-tab-pane>
<el-tab-pane label="库位设置" name="storageSetup">
<avue-crud
height="460px"
:option="storageOption"
:table-loading="loading"
:data="storageData"
v-model="form"
v-model:page="storagePage"
ref="crud"
@row-del="rowDel"
@row-save="rowSave"
@row-update="rowUpdate"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
:beforeOpen="beforeOpen"
>
<template #menu-left>
<el-button type="primary" @click="handleAdd">新增</el-button>
</template>
<template #goodsCode-form="{type}">
<el-select v-if="type == 'edit'" v-model="form.goodsCode" placeholder="请选择物料"
@change="changeGoods" filterable remote :remote-method="remoteMethodGoods"
:loading="goodsLoading" >
<el-option v-for="item in goodsList" :key="item.id" :label="item.goodsCode" :value="item.id"> </el-option>
</el-select>
</template>
<!-- <template #menu="{ row }">
<el-button type="text" v-if="tabPosition == 'warehouseSetup'">管理员设置</el-button>
</template> -->
</avue-crud>
</el-tab-pane>
<el-tab-pane label="库位设置" name="storageSetup"></el-tab-pane>
</el-tabs>
<div v-if="tabPosition == 'inventorySetup'" class="setup-height">
<warehouse v-if="activeName == 'warehouseSetup'"></warehouse>
<inventory v-if="activeName == 'storageSetup'"></inventory>
<div v-if="activeName == 'inventorySetup'" class="setup-height">
<div style="margin-bottom: 10px">
<el-button type="primary" @click="selectFn(1)">按人员设置</el-button>
<el-button type="primary" @click="selectFn(2)">按库房设置</el-button>
</div>
<el-select v-model="checkUser"
<el-select
v-model="checkUser"
filterable
remote
reserve-keyword
placeholder="请输入人员名称"
:remote-method="remoteMethod"
:loading="selectLoading"
v-if="isUser == 1" @change="changeUser">
<el-option v-for="item in keepList" :key="item.id" :label="item.realName" :value="item.id"> </el-option>
v-if="isUser == 1"
@change="changeUser"
>
<el-option v-for="item in keepList" :key="item.id" :label="item.realName" :value="item.id">
</el-option>
</el-select>
<el-select style="margin-bottom:10px;" v-model="checkWare" placeholder="请选择库房" v-if="isUser == 2" @change="changeWare">
<el-option v-for="item in wareList" :key="item.id" :label="item.shName" :value="item.id"> </el-option>
<el-select
style="margin-bottom: 10px"
v-model="checkWare"
placeholder="请选择库房"
v-if="isUser == 2"
@change="changeWare"
>
<el-option v-for="item in wareList" :key="item.id" :label="item.shName" :value="item.id">
</el-option>
</el-select>
<el-transfer
class="trans_ware"
v-if="isUser == 1"
style="margin-top: 10px;"
style="margin-top: 10px"
filterable
:titles="['未选择', '已选择']"
:filter-method="filterMethod"
@ -99,7 +50,7 @@
</el-transfer>
<tree-transfer
class="trans_ware"
style="margin-top: 10px;"
style="margin-top: 10px"
v-if="isUser == 2"
ref="transferRef"
:titleList="['未选择', '已选择']"
@ -114,274 +65,153 @@
}"
rootPid="0"
/>
<!-- <transferTree v-if="isUser == 2"></transferTree> -->
<!-- <transferTree v-if="isUser == 2"></transferTree> -->
<!-- <treeTransfer :noChoose="noChooseUser" :choose="chooseUser" style="margin-top:10px;" v-if="isUser == 2"></treeTransfer> -->
<div
style="
margin-top: 10px;
display: flex;
justify-content: center;
align-items: center;
"
>
<div style="margin-top: 10px; display: flex; justify-content: center; align-items: center">
<el-button type="primary" @click="handleSubmit"> </el-button>
</div>
</div>
<add-edit-dialog v-if="showDialog" :showDialog="showDialog" :title="dialogTitle"
@closeDialog="closeDialog"></add-edit-dialog>
</basic-container>
</template>
<script>
import warehouse from './components/warehouse.vue';
import inventory from './components/inventory.vue';
import { mapGetters } from 'vuex';
import treeTransfer from 'tree-transfer-vue3' //
// import treeTransfer from "./components/treeTransfer.vue";
import warehouseMain from "./js/warehouseMain";
import addEditDialog from "./components/addEditDialog.vue"
import {warehouseOption,storageOption} from "./js/warehouseMain";
import {getWareList,addWare,editWare,deleteWare,getLocationList,delLocation,
editLocation,getUserByRoleAlias,getWareByUser,getWareSelect,getUserByWare,saveUserWare,getAllUser,
saveWareUser,getMaterialSelect} from "@/api/storeManagement/warehouseMaintenance";
import treeTransfer from 'tree-transfer-vue3'; //
import {
getWareList,
addWare,
editWare,
deleteWare,
getLocationList,
delLocation,
editLocation,
getUserByRoleAlias,
getWareByUser,
getWareSelect,
getUserByWare,
saveUserWare,
getAllUser,
saveWareUser,
getMaterialSelect,
} from '@/api/storeManagement/warehouseMaintenance';
export default {
components: { addEditDialog,treeTransfer },
components: { warehouse, inventory, treeTransfer },
data() {
return {
activeName: 'warehouseSetup',
loading: false,
tabPosition: "warehouseSetup",
tabPosition: 'warehouseSetup',
data: [],
chooseWare:[], //
noChooseWare:[], //
noChooseUser:[], //
chooseUser:[], //
goodsList:[],
goodsLoading:false,
chooseWare: [], //
noChooseWare: [], //
noChooseUser: [], //
chooseUser: [], //
goodsList: [],
goodsLoading: false,
form: {},
query:{},
dialogTitle:'新增',
checkUser:'',
checkWare:"",
selectLoading:false,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
showDialog:false,
storageData:[],
warehouseOption:warehouseOption,
storageOption:storageOption,
storagePage:{
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
columnSort: true,
tip: false,
height: "auto",
align: "center",
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
addBtn: true,
delBtn: true,
editBtn: true,
editBtnIcon: " ",
delBtnIcon: " ",
labelWidth: 120,
menu: true,
menuWidth: 200,
dialogWidth: 920,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
searchLabelPosition: "left",
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
menuAlign: "left",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
column: [],
},
oldChooseUser:[],
keepList:[],
wareList:[],
query: {},
dialogTitle: '新增',
checkUser: '',
checkWare: '',
selectLoading: false,
showDialog: false,
storageData: [],
oldChooseUser: [],
keepList: [],
wareList: [],
isUser: 1,
localQuery:{},
localQuery: {},
};
},
computed: {
...mapGetters(['userInfo']),
},
mounted() {
console.log("this.userInfo",this.userInfo)
this.option.delBtn = true;
this.option.editBtn = true;
this.option.column = warehouseMain[this.tabPosition];
this.$nextTick(() =>{
this.tabPositionChange()
})
},
mounted() {},
methods: {
// getGoodsList(){
// getMaterialSelect().then(res =>{
// })
// },
beforeOpen(done, type){
if(type == 'edit'){
getMaterialSelect().then(res =>{
this.goodsList = res.data.data.records
done()
})
}else{
done()
}
},
remoteMethodGoods(query){
console.log("query",query)
if(query){
this.goodsLoading = true
getMaterialSelect({
goodsCode:query
}).then(res =>{
this.goodsList = res.data.data.records
this.goodsLoading = false
})
}else{
this.goodsLoading = true
getMaterialSelect().then(res =>{
this.goodsList = res.data.data.records
this.goodsLoading = false
})
}
},
changeGoods(val){
console.log("val",val)
let tmp = this.goodsList.find(item => item.id == val)
this.form.goodsName = tmp.goodsName
this.form.specifications = tmp.specifications
this.form.mtltmrk = tmp.mtltmrk
},
searchChange(params, done){
if(this.tabPosition == "warehouseSetup"){
this.query = params
this.page.currentPage = 1;
this.getWare()
done()
}else if(this.tabPosition == "storageSetup"){
this.localQuery = params
this.page.currentPage = 1;
this.getLocation()
done()
}
},
searchReset(){
if(this.tabPosition == "warehouseSetup"){
this.query = {}
this.getWare()
}else if(this.tabPosition == "storageSetup"){
this.localQuery = {}
this.getLocation()
}
},
currentChange(currentPage) {
if(this.tabPosition == "warehouseSetup"){
this.page.currentPage = currentPage;
this.getWare()
}else if(this.tabPosition == "storageSetup"){
this.storagePage.currentPage = currentPage;
this.getLocation()
}
},
sizeChange(pageSize) {
if(this.tabPosition == "warehouseSetup"){
this.page.pageSize = pageSize;
this.getWare()
}else if(this.tabPosition == "storageSetup"){
this.storagePage.pageSize = pageSize;
this.getLocation()
tabPositionChange(val) {
console.log('11111111111111111111111111111111',val)
this.activeName = val;
if (val == 'inventorySetup') {
// this.isUser = 1;
// this.chooseWare = [];
// this.noChooseWare = [];
// this.checkUser = '';
// getUserByRoleAlias({
// roleAlias: '',
// current: 1,
// size: 99999,
// }).then(res => {
// this.keepList = res.data.data;
// });
this.selectFn(1)
console.log('this.activeName', this.activeName)
}
},
remoteMethod(query){
remoteMethod(query) {
if (query !== '') {
this.selectLoading = true;
getUserByRoleAlias({
current:1,size:9999,realName:query,
roleAlias:'保管员'
}).then(res =>{
this.keepList = res.data.data
this.selectLoading = false;
})
} else {
// this.options = [];
getUserByRoleAlias({
current:1,size:9999,roleAlias:'保管员'
}).then(res =>{
this.keepList = res.data.data
})
}
this.selectLoading = true;
getUserByRoleAlias({
current: 1,
size: 9999,
realName: query,
roleAlias: '保管员',
}).then(res => {
this.keepList = res.data.data;
this.selectLoading = false;
});
} else {
// this.options = [];
getUserByRoleAlias({
current: 1,
size: 9999,
roleAlias: '保管员',
}).then(res => {
this.keepList = res.data.data;
});
}
},
selectFn(val) {
console.log('val-------------',val)
this.isUser = val;
if(val == 1){
this.checkUser = ''
this.chooseWare = []
this.noChooseWare = []
console.log('isUser', this.isUser)
if (val == 1) {
this.checkUser = '';
this.chooseWare = [];
this.noChooseWare = [];
getUserByRoleAlias({
current:1,
size:999999,
roleAlias:"保管员"
}).then(res =>{
this.keepList = res.data.data
})
}else{
this.checkWare = ""
this.chooseUser = []
this.noChooseUser = []
getWareSelect().then(res =>{
this.wareList = res.data.data.records
})
current: 1,
size: 999999,
roleAlias: '保管员',
}).then(res => {
this.keepList = res.data.data;
});
} else {
this.checkWare = '';
this.chooseUser = [];
this.noChooseUser = [];
getWareSelect().then(res => {
this.wareList = res.data.data.records;
});
}
},
addUser(fromData,toData,obj){
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
//
changeUser(val){
getWareByUser(val).then(res =>{
let chooseData = res.data.data.Choose
let noChooseData = res.data.data.NoChoose
chooseData.map(item =>{
item.key = item.id
})
noChooseData.map(item =>{
item.key = item.id
})
this.noChooseWare = [...chooseData,...noChooseData]
console.log('NoChoose------------',this.noChooseWare)
this.chooseWare = chooseData.map(item => item.key)
console.log('chooseWare------------',this.chooseWare)
})
changeUser(val) {
getWareByUser(val).then(res => {
let chooseData = res.data.data.Choose;
let noChooseData = res.data.data.NoChoose;
chooseData.map(item => {
item.key = item.id;
});
noChooseData.map(item => {
item.key = item.id;
});
this.noChooseWare = [...chooseData, ...noChooseData];
console.log('NoChoose------------', this.noChooseWare);
this.chooseWare = chooseData.map(item => item.key);
console.log('chooseWare------------', this.chooseWare);
});
},
processTree(nodes, isRootLevel = true) {
return nodes.map(item => {
@ -390,7 +220,7 @@ export default {
const newItem = {
...item,
parentId // parentId
parentId, // parentId
// pid
};
@ -403,13 +233,13 @@ export default {
});
},
//
changeWare(val){
getUserByWare(val).then(res =>{
this.chooseUser = this.processTree(res.data.data.Choose)
changeWare(val) {
getUserByWare(val).then(res => {
this.chooseUser = this.processTree(res.data.data.Choose);
// this.oldChooseUser = JSON.parse(JSON.stringify(this.chooseUser))
// console.log('oldChooseUser------------',this.oldChooseUser)
this.noChooseUser = this.processTree(res.data.data.NoChoose)
})
this.noChooseUser = this.processTree(res.data.data.NoChoose);
});
},
getLeafIds(nodes) {
const leafIds = [];
@ -420,7 +250,7 @@ export default {
items.forEach(item => {
//
const hasChildren = Array.isArray(item.children) && item.children.length > 0;
if (!hasChildren) {
// id
leafIds.push(item.id);
@ -434,32 +264,32 @@ export default {
traverse(nodes);
return leafIds;
},
handleSubmit(){
if(this.isUser == 1){
handleSubmit() {
if (this.isUser == 1) {
let params = {
userId:this.checkUser,
shIdList:this.chooseWare
}
saveUserWare(params).then(res =>{
if(res.data.code == 200){
this.$message.success('保存成功')
getWareByUser(this.checkUser).then(res =>{
let chooseData = res.data.data.Choose
let noChooseData = res.data.data.NoChoose
chooseData.map(item =>{
item.key = item.id
})
noChooseData.map(item =>{
item.key = item.id
})
this.noChooseWare = [...chooseData,...noChooseData]
this.chooseWare = chooseData.map(item => item.key)
})
userId: this.checkUser,
shIdList: this.chooseWare,
};
saveUserWare(params).then(res => {
if (res.data.code == 200) {
this.$message.success('保存成功');
getWareByUser(this.checkUser).then(res => {
let chooseData = res.data.data.Choose;
let noChooseData = res.data.data.NoChoose;
chooseData.map(item => {
item.key = item.id;
});
noChooseData.map(item => {
item.key = item.id;
});
this.noChooseWare = [...chooseData, ...noChooseData];
this.chooseWare = chooseData.map(item => item.key);
});
}
})
}else{
let userArr = this.getLeafIds(this.chooseUser).map(item => item.replace('user-',""))
userArr.push(this.userInfo && this.userInfo.userId)
});
} else {
let userArr = this.getLeafIds(this.chooseUser).map(item => item.replace('user-', ''));
userArr.push(this.userInfo && this.userInfo.userId);
// let oldUserArr = this.getLeafIds(this.oldChooseUser).map(item => item.replace('user-',""))
// console.log('userArr',userArr)
// console.log('oldUserArr',oldUserArr)
@ -470,183 +300,27 @@ export default {
// const result = userArr.filter(item => !set1.has(item));
// console.log('result---------',result)
let params = {
shId:this.checkWare,
userIdList:userArr.join(',')
}
console.log('choos---------',this.getLeafIds(this.chooseUser))
console.log('params==========',params)
saveWareUser(params).then(res =>{
if(res.data.code == 200){
this.$message.success('保存成功')
getUserByWare(this.checkWare).then(res =>{
this.chooseUser = this.processTree(res.data.data.Choose)
shId: this.checkWare,
userIdList: userArr.join(','),
};
console.log('choos---------', this.getLeafIds(this.chooseUser));
console.log('params==========', params);
saveWareUser(params).then(res => {
if (res.data.code == 200) {
this.$message.success('保存成功');
getUserByWare(this.checkWare).then(res => {
this.chooseUser = this.processTree(res.data.data.Choose);
// this.oldChooseUser = JSON.parse(JSON.stringify(this.chooseUser))
this.noChooseUser = this.processTree(res.data.data.NoChoose)
})
}
})
}
},
handleAdd() {
this.dialogTitle = '新增'
this.showDialog = true
},
getWare(){
getWareList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
res.data.data.records.map(item =>{
item.type = (item.type || item.type == 0) ? item.type + '' : item.type
item.toolingType = (item.toolingType || item.toolingType == 0) ? item.toolingType + '' : item.toolingType
})
this.data = res.data.data.records
this.page.total = res.data.data.total;
})
},
getLocation(){
getLocationList({
current:this.storagePage.currentPage,
size:this.storagePage.pageSize,
...this.localQuery
}).then(res =>{
this.storageData = res.data.data.records
this.storagePage.total = res.data.data.total;
})
},
tabPositionChange(val) {
this.option.delBtn = false;
this.option.editBtn = false;
if (this.tabPosition == "warehouseSetup") {
this.option.delBtn = true;
this.option.editBtn = true;
this.option.column = warehouseMain[this.tabPosition];
this.getWare()
} else if (this.tabPosition == "storageSetup") {
this.option.delBtn = true;
this.option.editBtn = true;
this.option.column = warehouseMain[this.tabPosition];
this.getLocation()
}else if(this.tabPosition == "inventorySetup"){
this.chooseWare = []
this.noChooseWare = []
this.checkUser = ''
getUserByRoleAlias({
roleAlias:"保管员",
current:1,
size:99999
}).then(res =>{
this.keepList = res.data.data
})
}
},
rowDel(row) {
this.$confirm("确定删除此条数据?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
if(this.tabPosition == "warehouseSetup"){
deleteWare({
ids:row.id
}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.getWare()
}
})
}else if(this.tabPosition == "storageSetup"){
delLocation({
ids:row.id
}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.getLocation()
}
})
}
});
},
rowSave(row, done, loading){
if(this.tabPosition == "warehouseSetup"){
addWare(row).then(res =>{
if(res.data.code == 200){
this.$message.success('新增成功')
done()
this.getWare()
this.noChooseUser = this.processTree(res.data.data.NoChoose);
});
}
}).catch(() =>{
// loading()
done()
})
}
},
rowUpdate(row, index, done, loading) {
if(this.tabPosition == "warehouseSetup"){
console.log('row',row)
editWare(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
done()
this.getWare()
}
})
}else if(this.tabPosition == "storageSetup"){
editLocation(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
done()
this.getLocation()
}
})
}
},
closeDialog(val){
console.log('val',val)
this.showDialog = false
if(val){
this.getLocation()
});
}
},
// onLoad() {
// this.data = [
// {
// id: 1,
// shCode: "001",
// shName: "",
// memo: "",
// toolingTypeStr: "001",
// typeStr: "",
// shLevel: "",
// userName: "",
// },
// {
// id: 1,
// shCode: "001",
// shName: "",
// memo: "",
// toolingTypeStr: "001",
// typeStr: "",
// shLevel: "",
// userName: "",
// },
// {
// id: 1,
// shCode: "001",
// shName: "",
// memo: "",
// toolingTypeStr: "001",
// typeStr: "",
// shLevel: "",
// userName: "",
// },
// ];
// this.page.total = this.data.length;
// },
},
};
</script>
<style lang="scss" scoped>
::v-deep.trans_ware {
.el-transfer-panel {
@ -669,9 +343,9 @@ export default {
min-height: 500px;
::v-deep .tree-transfer-vue3 {
height: calc(100vh - 54px - 40px - 56px - 37px - 140px) !important;
height: calc(100vh - 54px - 40px - 56px - 37px - 140px) !important;
min-height: 320px !important;
max-height: calc(100vh - 54px - 40px - 56px - 37px - 140px) !important;
max-height: calc(100vh - 54px - 40px - 56px - 37px - 140px) !important;
.el-tree {
height: 100% !important;
@ -679,4 +353,4 @@ export default {
}
}
}
</style>
</style>

@ -105,6 +105,7 @@ export default {
tip: false,
align: 'center',
height: 'auto',
calcHeight: 32,
searchLabelWidth: 120,
simplePage: false,
pagination: true,

@ -1,6 +1,6 @@
<template>
<div>
<avue-crud :height="460" :option="option" v-model:search="search" :table-loading="loading" :data="data" v-model:page="page"
<avue-crud :option="option" v-model:search="search" :table-loading="loading" :data="data" v-model:page="page"
v-model="form" ref="crud" @row-update="rowUpdate"
@search-change="searchChange" @search-reset="searchReset"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">

@ -3,7 +3,7 @@
<basic-container>
<el-tabs v-model="tabPosition" class="demo-tabs" @tab-change="tabPositionChange">
<el-tab-pane label="erp审理" name="erpHear">
<avue-crud :height="460" :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud"
<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">
@ -22,7 +22,7 @@
</avue-crud>
</el-tab-pane>
<el-tab-pane label="内部审理" name="insideHear">
<avue-crud :height="460" :option="insideOption" :table-loading="loading" :data="insideData" v-model="form" v-model:page="insidePage" ref="crud"
<avue-crud :option="insideOption" :table-loading="loading" :data="insideData" v-model="form" v-model:page="insidePage" 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">

Loading…
Cancel
Save