Browse Source

完善仓库管理

master
yunuo970428 2 months ago
parent
commit
fb947355d4
  1. 529
      yxt-as-ui/src/views/warehouse/warehouse/index.vue
  2. 576
      yxt-as-ui/src/views/warehouse/warehouse/warehouseAdd.vue
  3. 228
      yxt-as-ui/src/views/warehouse/warehouse/warehouseInfo.vue

529
yxt-as-ui/src/views/warehouse/warehouse/index.vue

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="仓库列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<button-bar ref="btnbar" view-title="仓库列表" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
@ -11,20 +11,18 @@
<el-form :inline="true" class="tab-header">
<el-form-item label="仓库类型">
<el-select v-model="queryParams.params.warehouseTypeValue" placeholder="请选择仓库类型">
<el-option v-for="item in warehouseTypeList" :key="item.dictValue" :label="item.dictValue"
:value="item.dictValue" />
<el-option v-for="item in warehouseTypeList" :key="item.dictValue" :label="item.dictValue" :value="item.dictValue"/>
</el-select>
</el-form-item>
<el-form-item label="仓库名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
<el-input v-model="queryParams.params.name" placeholder="" clearable/>
</el-form-item>
<el-form-item label="仓库编码">
<el-input v-model="queryParams.params.code" placeholder="" clearable />
<el-input v-model="queryParams.params.code" placeholder="" clearable/>
</el-form-item>
<el-form-item label="仓库地址">
<el-input v-model="queryParams.params.address" placeholder="" clearable />
<el-input v-model="queryParams.params.address" placeholder="" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
@ -39,315 +37,294 @@
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" @selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center"/>
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">详情</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button> -->
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.usageStatus" active-text="" inactive-text="" active-value="1"
inactive-value="0" @change="enableChange(scope.row.sid,scope.row.usageStatus)" />
<el-switch v-model="scope.row.usageStatus" active-text="" inactive-text="" active-value="1" inactive-value="0" @change="enableChange(scope.row.sid,scope.row.usageStatus)"/>
</template>
</el-table-column>
<el-table-column prop="warehouseTypeValue" label="仓库类型" align="center" />
<el-table-column prop="warehouseName" label="仓库名称" align="center" />
<el-table-column prop="warehouseCode" label="仓库编码" align="center" />
<el-table-column prop="manager" label="仓库主管" align="center" />
<!-- <el-table-column prop="telephone" label="联系电话" align="center" /> -->
<el-table-column prop="squareMeter" label="占地面积" align="center" />
<el-table-column prop="address" label="仓库地址" align="center" />
<el-table-column prop="sortNo" label="排序" align="center" />
<el-table-column prop="deptName" label="隶属部门 " align="center" />
<el-table-column prop="createOrgName" label="分公司 " align="center" />
<el-table-column prop="warehouseTypeValue" label="仓库类型" align="center"/>
<el-table-column prop="warehouseName" label="仓库名称" align="center"/>
<el-table-column prop="warehouseCode" label="仓库编码" align="center"/>
<el-table-column prop="manager" label="仓库主管" align="center"/>
<el-table-column prop="squareMeter" label="占地面积" align="center"/>
<el-table-column prop="address" label="仓库地址" align="center"/>
<el-table-column prop="sortNo" label="排序" align="center"/>
<el-table-column prop="deptName" label="隶属部门 " align="center"/>
<el-table-column prop="createOrgName" label="分公司 " align="center"/>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<div class="tit"/>
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList"/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList"/>
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList"/>
</div>
</template>
<script>
import req from '@/api/warehouse/warehouse.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './warehouseAdd.vue'
import divInfo from './warehouseInfo.vue'
import {
typeValues,
} from '@/api/Common/dictcommons.js'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toEdit',
btnLabel: '编辑'
},
{
type: 'danger',
size: 'small',
icon: 'plus',
btnKey: 'doDel',
btnLabel: '删除'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
warehouseTypeValue: "",
name: '',
code: "",
address: ""
}
import req from '@/api/warehouse/warehouse.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import divAdd from './warehouseAdd.vue'
import divInfo from './warehouseInfo.vue'
import { getTypeValueList } from '@/api/Common/dictcommons.js'
export default {
components: {
ButtonBar,
Pagination,
divAdd,
divInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toEdit',
btnLabel: '编辑'
},
{
type: 'danger',
size: 'small',
icon: 'plus',
btnKey: 'doDel',
btnLabel: '删除'
},
sids: [],
selectionList: [],
warehouseTypeList: [],
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
warehouseTypeValue: '',
name: '',
code: '',
address: '',
orgPath: '',
menuUrl: '',
userSid: ''
}
},
sids: [],
selectionList: [],
warehouseTypeList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
getTypeValueList({ type: 'warehouse', groupNum: 'shfw' }).then(resp => {
if (resp.success) {
this.warehouseTypeList = resp.data
}
})
},
methods: {
selectionLineChangeHandle(val) {
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
created() {
this.loadList()
var params = {
type: "warehouse",
psid: '0'
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}
typeValues(params).then(resp => {
console.log('>>>>>>>>>typeValues', resp)
this.warehouseTypeList = resp.data
}).catch(() => {})
},
methods: {
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
loadList() {
this.tableLoading = true
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.queryParams.params.menuUrl = this.$route.path
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
this.searchxianshitit = '显示查询条件'
// resp.code
this.dataList = []
this.queryParams.total = 0
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
warehouseTypeValue: '',
name: '',
code: '',
address: '',
orgPath: '',
menuUrl: '',
userSid: ''
}
},
loadList() {
this.tableLoading = true
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.queryParams.params.menuUrl = this.$route.path
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toEdit() {
if (this.selectionList.length !== 1) {
this.$message({
type: 'warning',
message: '请选择一条数据。',
showClose: true
})
return
}
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 4
this.$refs['divinfo'].showEdit(row)
},
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBySids(this.sids).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
warehouseTypeValue: "",
name: '',
code: "",
address: ""
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toEdit() {
if (this.selectionList.length != 1) {
} else {
this.$message({
showClose: true,
message: '请至少选择一条记录进行删除操作'
})
}
},
resetState() {
this.viewState = 1
this.loadList()
},
enableChange(sid, state) {
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
type: 'success',
message: '状态已更新',
showClose: true
})
return
} else { // resp.code
}
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 4
this.$refs['divinfo'].showEdit(row)
},
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBySids(this.sids).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
} else {
this.$message({
showClose: true,
message: '请至少选择一条记录进行删除操作'
})
}
},
resetState() {
this.viewState = 1
this.loadList()
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

576
yxt-as-ui/src/views/warehouse/warehouse/warehouseAdd.vue

@ -1,114 +1,76 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>仓库信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<el-row class="first_row">
<el-col :span="8">
<div class="span-sty">仓库编码</div>
<el-form-item prop="warehouseCode">
<span class="addinputw addinputInfo">{{formobj.warehouseCode}}</span>
<!-- <el-input v-model="formobj.warehouseCode" placeholder="仓库编码" class="addinputw addinputInfo" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" /> -->
<span class="addinputw addinputInfo">{{ formobj.warehouseCode }}</span>
</el-form-item>
</el-col>
<el-col :span="16">
<div class="span-sty"><span class="must">*</span> 仓库类型</div>
<el-form-item prop="warehouseTypeValue">
<el-select v-model="formobj.warehouseTypeValue" placeholder="请选择仓库类型" class="addinputw addinputInfo"
@change="selectWarehouseTypeChange">
<el-option v-for="item in warehouseTypeList" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey" />
<el-select v-model="formobj.warehouseTypeValue" placeholder="请选择仓库类型" class="addinputw addinputInfo" @change="selectWarehouseTypeChange">
<el-option v-for="item in warehouseTypeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty"><span class="must">*</span> 仓库名称</div>
<el-form-item prop="warehouseName">
<el-input v-model="formobj.warehouseName" placeholder="按配件所属车辆品牌命名" class="addinputw addinputInfo"
clearable />
<el-input v-model="formobj.warehouseName" placeholder="按配件所属车辆品牌命名" class="addinputw addinputInfo" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">仓库面积</div>
<el-form-item>
<el-input v-model="formobj.squareMeter" placeholder="仓库面积" class="addinputw addinputInfo" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
<el-input v-model="formobj.squareMeter" placeholder="仓库面积" class="addinputw addinputInfo" clearable oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty"><span class="must">*</span> 仓库管理员</div>
<el-form-item>
<el-form-item prop="manager">
<el-select v-model="formobj.manager" placeholder="请选择仓库管理员" class="addinputw addinputInfo"
@change="selectManager">
<el-option v-for="item in managerList" :key="item.sid" :label="item.name" :value="item.sid" />
<el-select v-model="formobj.manager" placeholder="请选择仓库管理员" class="addinputw addinputInfo" @change="selectManager">
<el-option v-for="item in managerList" :key="item.sid" :label="item.name" :value="item.sid"/>
</el-select>
</el-form-item>
<!-- <el-input v-model="formobj.manager" placeholder="仓库管理员" class="addinputw addinputInfo" clearable /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">仓库地址</div>
<el-form-item>
<el-input v-model="formobj.address" placeholder="仓库地址" class="addinputw addinputInfo" clearable />
<el-input v-model="formobj.address" placeholder="仓库地址" class="addinputw addinputInfo" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">经度</div>
<el-form-item>
<el-input v-model="formobj.longitude" placeholder="经度" class="addinputw addinputInfo" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
<el-input v-model="formobj.longitude" placeholder="经度" class="addinputw addinputInfo" clearable oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"/>
</el-form-item>
</el-col>
<el-col :span="16">
<div class="span-sty">纬度</div>
<el-form-item>
<el-input v-model="formobj.latitude" placeholder="纬度" class="addinputw addinputInfo" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
<el-input v-model="formobj.latitude" placeholder="纬度" class="addinputw addinputInfo" clearable oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span="8">
@ -134,347 +96,257 @@
</el-col>
</el-row> -->
<el-row>
<el-col :span="8">
<div class="span-sty"><span class="must">*</span> 排序</div>
<el-form-item prop="sortNo">
<el-input v-model="formobj.sortNo" placeholder="排序" class="addinputw addinputInfo" clearable
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
<el-input v-model="formobj.sortNo" placeholder="排序" class="addinputw addinputInfo" clearable oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"/>
</el-form-item>
</el-col>
<el-col :span="16">
<div class="span-sty"><span class="must">*</span> 使用状态</div>
<el-form-item prop="usageStatus">
<el-radio-group v-model="formobj.usageStatus" size="small" @change="changeTheme"
class="addinputw addinputInfo">
<el-radio-group v-model="formobj.usageStatus" size="small" class="addinputw addinputInfo">
<el-radio :label="'1'">正常</el-radio>
<el-radio :label="'0'">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">备注</div>
<el-form-item>
<el-input v-model="formobj.remarks" placeholder="备注" class="addinputw addinputInfo" clearable />
<el-input v-model="formobj.remarks" placeholder="备注" class="addinputw addinputInfo" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/warehouse/warehouse.js'
import {
typeValues,
getOrgSidByPath
} from '@/api/Common/dictcommons.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
warehouseName: '',
warehouseCode: '由系统自动生成',
warehouseTypeKey: '',
warehouseTypeValue: '',
contacts: "",
mob: "",
telephone: "",
manager: '',
managerSid: '',
longitude: '',
latitude: '',
usageStatus: "1",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0",
useOrgSid: window.sessionStorage.getItem('departmentSid'),
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
createOrgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid'),
},
warehouseTypeList: [],
managerList: [],
rules: {
warehouseName: [{
required: true,
message: '仓库名称不能为空',
trigger: 'blur'
}],
sortNo: [{
required: true,
message: '排序不能为空',
trigger: 'blur'
}],
usageStatus: [{
required: true,
message: '请选择使用状态',
trigger: 'change'
}],
manager: [{
required: true,
message: '请选择仓库管理员',
trigger: 'change'
}],
warehouseTypeValue: [{
required: true,
message: '请选择仓库类型',
trigger: 'change'
}],
}
import req from '@/api/warehouse/warehouse.js'
import {
getTypeValueList,
getOrgSidByPath
} from '@/api/Common/dictcommons.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
warehouseName: '',
warehouseCode: '由系统自动生成',
warehouseTypeKey: '',
warehouseTypeValue: '',
contacts: '',
mob: '',
telephone: '',
manager: '',
managerSid: '',
longitude: '',
latitude: '',
usageStatus: '1',
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: '0',
useOrgSid: window.sessionStorage.getItem('departmentSid'),
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
createOrgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid')
},
warehouseTypeList: [],
managerList: [],
rules: {
warehouseName: [{ required: true, message: '仓库名称不能为空', trigger: 'blur' }],
sortNo: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
usageStatus: [{ required: true, message: '请选择使用状态', trigger: 'change' }],
manager: [{ required: true, message: '请选择仓库管理员', trigger: 'change' }],
warehouseTypeValue: [{ required: true, message: '请选择仓库类型', trigger: 'change' }]
}
}
},
methods: {
selectManager(val) {
const choose = this.managerList.filter((item) => item.sid === val)
console.log('>>>>>>>>>selectWarehouseTypeChange', choose)
this.formobj.manager = choose[0].name
this.formobj.managerSid = choose[0].sid
},
created() {
},
methods: {
changeTheme(val) {
},
selectManager(val) {
const choose = this.managerList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseTypeChange', choose)
this.formobj.manager = choose[0].name
this.formobj.managerSid = choose[0].sid
},
getDictValue() {
var params = {
type: "warehouse",
psid: '0'
}
typeValues(params).then(resp => {
console.log('>>>>>>>>>typeValues', resp)
getDictValue() {
getTypeValueList({ type: 'warehouse', groupNum: 'shfw' }).then(resp => {
if (resp.success) {
this.warehouseTypeList = resp.data
}).catch(() => {})
getOrgSidByPath({
orgPath: window.sessionStorage.getItem('defaultOrgPath')
}).then((res) => {
if (res.success) {
this.formobj.createOrgSid = res.data
}
})
req.selMangerByRole({
useOrgSid: window.sessionStorage.getItem('departmentSid')
})
.then(resp => {
if (resp.success) {
this.managerList = resp.data
}
})
.catch(e => {})
},
selectWarehouseTypeChange(val) {
const choose = this.warehouseTypeList.filter((item) => item.dictKey == val)
console.log('>>>>>>>>>selectWarehouseTypeChange', choose)
this.formobj.warehouseTypeKey = choose[0].dictKey
this.formobj.warehouseTypeValue = choose[0].dictValue
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
this.$refs['form_obj'].validate((valid) => {
if (valid) {
req.saveWarehouse(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.$confirm('是否继续添加仓库信息?', '温馨提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}).then(() => {
//
var warehouseTypeKey = this.formobj.warehouseTypeKey
var warehouseTypeValue = this.formobj.warehouseTypeValue
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '由系统自动生成',
warehouseTypeKey: warehouseTypeKey,
warehouseTypeValue: warehouseTypeValue,
contacts: "",
mob: "",
telephone: "",
manager: '',
longitude: '',
latitude: '',
usageStatus: "1",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0",
useOrgSid: window.sessionStorage.getItem('departmentSid'),
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
createOrgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid'),
}
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
}).catch(() => {
//
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '由系统自动生成',
warehouseTypeKey: '',
warehouseTypeValue: '',
contacts: "",
mob: "",
telephone: "",
manager: '',
longitude: '',
latitude: '',
usageStatus: "1",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0",
useOrgSid: window.sessionStorage.getItem('departmentSid'),
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
createOrgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid'),
}
this.$emit('doback')
});
} else {
// resp.code
}
})
.catch(() => {})
}
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '由系统自动生成',
warehouseTypeKey: '',
warehouseTypeValue: '',
contacts: "",
mob: "",
telephone: "",
manager: '',
longitude: '',
latitude: '',
usageStatus: "1",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0",
useOrgSid: window.sessionStorage.getItem('departmentSid'),
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
createOrgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid'),
}
this.$emit('doback')
},
showAdd() {
this.getDictValue()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
},
showEdit(row) {
this.getDictValue()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.initWarehouse(row.sid)
.then(resp => {
})
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
if (res.success) {
this.formobj.createOrgSid = res.data
}
})
req.selMangerByRole({ useOrgSid: window.sessionStorage.getItem('departmentSid') }).then(resp => {
if (resp.success) {
this.managerList = resp.data
}
})
},
selectWarehouseTypeChange(val) {
const choose = this.warehouseTypeList.filter((item) => item.dictKey === val)
console.log('>>>>>>>>>selectWarehouseTypeChange', choose)
this.formobj.warehouseTypeKey = choose[0].dictKey
this.formobj.warehouseTypeValue = choose[0].dictValue
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
this.$refs['form_obj'].validate((valid) => {
if (valid) {
req.saveWarehouse(this.formobj).then(resp => {
if (resp.success) {
this.formobj = resp.data
this.$message({ showClose: true, type: 'success', message: '保存成功', duration: 1000 })
if (this.formobj.sid === '') {
this.$confirm('是否继续添加仓库信息?', '温馨提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}).then(() => {
//
var warehouseTypeKey = this.formobj.warehouseTypeKey
var warehouseTypeValue = this.formobj.warehouseTypeValue
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '由系统自动生成',
warehouseTypeKey: warehouseTypeKey,
warehouseTypeValue: warehouseTypeValue,
contacts: '',
mob: '',
telephone: '',
manager: '',
longitude: '',
latitude: '',
usageStatus: '1',
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: '0',
useOrgSid: window.sessionStorage.getItem('departmentSid'),
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
createOrgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid')
}
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
}).catch(() => {
//
this.handleReturn('true')
})
} else {
this.handleReturn('true')
}
} else {
// resp.code
}
}).catch(() => {
})
.catch(e => {
this.formobj = row
})
},
}
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '由系统自动生成',
warehouseTypeKey: '',
warehouseTypeValue: '',
contacts: '',
mob: '',
telephone: '',
manager: '',
longitude: '',
latitude: '',
usageStatus: '1',
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: '0',
useOrgSid: window.sessionStorage.getItem('departmentSid'),
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
createOrgSid: window.sessionStorage.getItem('orgSid'),
userSid: window.sessionStorage.getItem('userSid')
}
this.$emit('doback')
},
showAdd() {
this.getDictValue()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
},
showEdit(row) {
this.getDictValue()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.initWarehouse(row.sid).then(resp => {
if (resp.success) {
this.formobj = resp.data
}
}).catch(e => {
this.formobj = row
})
}
}
}
</script>
<style scoped>
/deep/ .el-form-item__error {
margin-left: 120px !important;
}
.must {
color: #f00;
}
.span-sty {
width: 130px !important;
align-items: center;
}
.addinputInfo {
margin-left: 120px !important;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
margin-left: 120px !important;
width: calc(100% - 115px);
}
.first_row {
border-top: 1px solid #E0E3EB;
}
.titleOne {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .el-radio-group {
display: inline;
line-height: 1px;
vertical-align: middle;
}
/deep/ .el-form-item__error {
margin-left: 120px !important;
}
.must {
color: #f00;
}
.span-sty {
width: 130px !important;
align-items: center;
}
.addinputInfo {
margin-left: 120px !important;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
margin-left: 120px !important;
width: calc(100% - 115px);
}
.first_row {
border-top: 1px solid #E0E3EB;
}
.titleOne {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .el-radio-group {
display: inline;
line-height: 1px;
vertical-align: middle;
}
</style>

228
yxt-as-ui/src/views/warehouse/warehouse/warehouseInfo.vue

@ -1,94 +1,69 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>仓库信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
<el-row class="first_row">
<el-col :span="8">
<div class="span-sty">仓库编码</div>
<el-form-item>
<span class="addinputInfo">{{formobj.warehouseCode}}</span>
<span class="addinputInfo">{{ formobj.warehouseCode }}</span>
</el-form-item>
</el-col>
<el-col :span="16">
<div class="span-sty">仓库类型</div>
<el-form-item>
<span class="addinputInfo">{{formobj.warehouseTypeValue}}</span>
<span class="addinputInfo">{{ formobj.warehouseTypeValue }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">仓库名称</div>
<el-form-item>
<span class="addinputInfo">{{formobj.warehouseName}}</span>
<span class="addinputInfo">{{ formobj.warehouseName }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">仓库面积</div>
<el-form-item>
<span class="addinputInfo">{{formobj.squareMeter}}</span>
<span class="addinputInfo">{{ formobj.squareMeter }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">仓库管理员</div>
<el-form-item>
<span class="addinputInfo">{{formobj.manager}}</span>
<span class="addinputInfo">{{ formobj.manager }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">仓库地址</div>
<el-form-item>
<span class="addinputInfo">{{formobj.address}}</span>
<span class="addinputInfo">{{ formobj.address }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">经度</div>
<el-form-item>
<span class="addinputInfo">{{formobj.longitude}}</span>
<span class="addinputInfo">{{ formobj.longitude }}</span>
</el-form-item>
</el-col>
<el-col :span="16">
<div class="span-sty">纬度</div>
<el-form-item>
<span class="addinputInfo">{{formobj.latitude}}</span>
<span class="addinputInfo">{{ formobj.latitude }}</span>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row >
<el-col :span="8">
@ -115,153 +90,110 @@
</el-row> -->
<el-row>
<el-col :span="8">
<div class="span-sty">排序</div>
<el-form-item>
<span class="addinputInfo">{{formobj.sortNo}}</span>
<span class="addinputInfo">{{ formobj.sortNo }}</span>
</el-form-item>
</el-col>
<el-col :span="16">
<div class="span-sty">使用状态</div>
<el-form-item>
<el-radio-group v-model="formobj.usageStatus" size="small" :disabled='true'
class="addinputw addinputInfo">
<el-radio-group v-model="formobj.usageStatus" size="small" :disabled='true' class="addinputw addinputInfo">
<el-radio :label="'1'">正常</el-radio>
<el-radio :label="'0'">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">备注</div>
<el-form-item>
<span class="addinputInfo">{{formobj.remarks}}</span>
<span class="addinputInfo">{{ formobj.remarks }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/warehouse/warehouse.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
warehouseName: '',
warehouseCode: '',
contacts: "",
mob: "",
telephone: "",
manager: '',
longitude: '',
latitude: '',
usageStatus: "",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0"
},
import req from '@/api/warehouse/warehouse.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
warehouseName: '',
warehouseCode: '',
contacts: '',
mob: '',
telephone: '',
manager: '',
longitude: '',
latitude: '',
usageStatus: '',
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: '0'
}
}
},
methods: {
handleReturn() {
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '',
contacts: '',
mob: '',
telephone: '',
manager: '',
longitude: '',
latitude: '',
usageStatus: '',
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: '0'
}
this.$emit('doback')
},
created() {},
methods: {
changeTheme(val) {
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveWarehouse(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '',
contacts: "",
mob: "",
telephone: "",
manager: '',
longitude: '',
latitude: '',
usageStatus: "",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0"
showEdit(row) {
req.initWarehouse(row.sid).then(resp => {
if (resp.success) {
this.formobj = resp.data
}
this.$emit('doback')
},
showAdd() {},
showEdit(row) {
req.initWarehouse(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
}).catch(e => {
this.formobj = row
})
}
}
}
</script>
<style scoped>
.span-sty {
width: 130px !important;
}
.addinputInfo {
margin-left: 120px !important;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
margin-left: 120px !important;
width: calc(100% - 115px);
}
.first_row {
border-top: 1px solid #E0E3EB;
}
.titleOne {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.span-sty {
width: 130px !important;
}
.addinputInfo {
margin-left: 120px !important;
}
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
margin-left: 120px !important;
width: calc(100% - 115px);
}
.first_row {
border-top: 1px solid #E0E3EB;
}
</style>

Loading…
Cancel
Save