Browse Source

修复测试文档中供应链管理--即时库存表的问题

master
yunuo970428 3 years ago
parent
commit
8a4da19efb
  1. 96
      anrui-scm/anrui-scm-ui/src/views/anruiscm/scmrealtimeinventory/scmrealtimeinventory.vue
  2. 186
      anrui-scm/anrui-scm-ui/src/views/anruiscm/scmrealtimeinventory/scmrealtimeinventoryAdd.vue

96
anrui-scm/anrui-scm-ui/src/views/anruiscm/scmrealtimeinventory/scmrealtimeinventory.vue

@ -3,11 +3,10 @@
<div v-show="viewState == 1">
<button-bar view-title="即时库存表" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{ isSearchShow ? '隐藏查询条件' :
'显示查询条件' }}
</el-button>
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{isSearchShow ? '隐藏查询条件' : '显示查询条件' }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form :inline="true" class="tab-header" label-width="100px">
<el-row>
<el-form-item label="物料编码">
<el-input v-model="queryParams.params.mNum" placeholder="请输入物料编码" clearable/>
</el-form-item>
@ -15,32 +14,29 @@
<el-input v-model="queryParams.params.mName" placeholder="请输入物料名称" clearable/>
</el-form-item>
<el-form-item label="库存主单位">
<el-select v-model="queryParams.params.inventoryPrimaryUnit" @change="changeInventoryPrimary"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in inventoryPrimary_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey" clearable></el-option>
<el-select v-model="queryParams.params.inventoryPrimaryUnit" @change="changeInventoryPrimary" placeholder="请选择" clearable>
<el-option v-for="item in inventoryPrimary_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" clearable></el-option>
</el-select>
</el-form-item>
<el-form-item label="库存状态">
<el-select v-model="queryParams.params.invenState" @change="changeInvenState"
placeholder="请选择" clearable>
<el-option v-for="item in invenState_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="queryParams.params.invenState" @change="changeInvenState" placeholder="请选择" clearable>
<el-option v-for="item in invenState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库">
<el-select v-model="queryParams.params.warehouse" @change="changeWarehouse"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in warehouse_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="queryParams.params.warehouse" @change="changeWarehouse" placeholder="请选择" clearable>
<el-option v-for="item in warehouse_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="货主">
<el-input v-model="queryParams.params.cargoOwner" placeholder="请输入货主" clearable/>
</el-form-item>
<el-form-item label="保管者名称">
<el-input v-model="queryParams.params.custodian" placeholder="请输入保管者名称" clearable/>
</el-form-item>
</el-row>
<el-divider/>
<div class="btn" style="text-align: center;">
<el-button type="primary" @click="dosearch">查询</el-button>
@ -52,15 +48,12 @@
<!--Start 项目列表头部-->
<div class="listtop">
<div class="tit">即时库存表列表</div>
<pageye v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList"/>
<pageye v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList"/>
</div>
<!--End 项目列表头部-->
<!--Start 项目列表-->
<div class="listcon">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="handleSelectionChange">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column width="50px" type="selection" align="center"/>
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column prop="mNum" label="物料编码" align="center">
@ -88,14 +81,7 @@
<div class="pages">
<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>
<!--End 查询和其列表部分-->
@ -115,7 +101,6 @@
import pageye from '@/components/pagination/pageye'
import divAdd from './scmrealtimeinventoryAdd'
import divInfo from './scmrealtimeinventoryInfo'
import { setuser, getuser } from '@/utils/baocun'
export default {
name: 'ScmRealTimeInventoryIndex',
@ -216,7 +201,6 @@
const aa = []
row.forEach(element => {
aa.push(element.sid)
setuser(this.sids)
})
this.sids = aa
this.sides = this.sids.join() // sid
@ -237,8 +221,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.invenState_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
@ -266,8 +249,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.warehouse_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
@ -296,8 +278,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.inventoryPrimary_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
@ -351,8 +332,7 @@
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
@ -364,8 +344,7 @@
loading.close()
_this.$message({ type: 'success', message: resp.msg, showClose: true })
_this.loadList()
})
.catch(e => {
}).catch(e => {
loading.close()
})
})
@ -375,12 +354,9 @@
doImport() {
//
req
.importExcel(this.queryParams.params)
.then(resp => {
req.importExcel(this.queryParams.params).then(resp => {
console.log(resp)
})
.catch(() => {
}).catch(() => {
})
},
doExport(row) {
@ -390,9 +366,7 @@
sids.push(row.sid)
})
this.queryParams.params.sids = sids
req
.exportExcel(this.queryParams.params)
.then(resp => {
req.exportExcel(this.queryParams.params).then(resp => {
var map = resp.data
const fileName = map.filename //
// // <a> Firefox Chrome download
@ -405,8 +379,7 @@
link.click() //
URL.revokeObjectURL(link.href) // url
document.body.removeChild(link) //
})
.catch(() => {
}).catch(() => {
})
},
dosearch() {
@ -422,16 +395,13 @@
loadList() {
const _this = this
this.tableLoading = true
req
.listPage(this.queryParams)
.then(resp => {
req.listPage(this.queryParams).then(resp => {
console.log('查询列表', resp)
_this.tableLoading = false
const data = resp.data
_this.queryParams.total = data.total
_this.dataList = data.records
})
.catch(() => {
}).catch(() => {
_this.tableLoading = false
})
},
@ -473,4 +443,18 @@
border: #2cab69 1px solid;
color: #2cab69;
}
.listtop {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #dfe4ed;
height: 40px;
}
.tit {
margin-bottom: -10px;
}
.pagination {
margin-bottom: -10px;
}
</style>

186
anrui-scm/anrui-scm-ui/src/views/anruiscm/scmrealtimeinventory/scmrealtimeinventoryAdd.vue

@ -1,20 +1,14 @@
<template>
<div>
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled"
@click="dialogStatus === 'add' ? saveAdd() : saveEdit()">保存
<el-button type="primary" size="small" :disabled="submitdisabled" @click="dialogStatus === 'add' ? saveAdd() : saveEdit()">保存
</el-button>
<el-button type="info" size="small" @click="handleReturn()">返回</el-button>
</div>
<!--end 添加修改按钮-->
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<el-form ref="form_obj" :model="formobj" :rules="rules" label-position="top" label-width="300px" class="formadd">
<div class="wlInfo"><span>即时库存表</span></div>
@ -24,20 +18,16 @@
</el-col>
<el-col :span="8" class="trightb">
<el-form-item prop="mNum">
<el-select v-model="formobj.mNum" @change="changeMnum"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in mnum_list" :key="item.sid" :label="item.mNum"
:value="item.mNum"></el-option>
<el-select v-model="formobj.mNum" @change="changeMnum" placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in mnum_list" :key="item.sid" :label="item.mNum" :value="item.mNum"></el-option>
</el-select>
<!-- <el-input v-model="formobj.mNum" placeholder="请输入物料编码" class="addinputw" clearable/>-->
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<el-form-item><span slot="label"><span class="icon">*</span>物料名称</span></el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item> <!-- prop="mName"-->
<el-form-item>
<el-input v-model="formobj.mName" placeholder="请输入物料名称" class="addinputw" readonly/>
</el-form-item>
</el-col>
@ -48,10 +38,8 @@
</el-col>
<el-col :span="8" class="trightb">
<el-form-item prop="warehouse">
<el-select v-model="formobj.warehouse" @change="changeWarehouse"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in warehouse_list" :key="item.sid" :label="item.warehouseName"
:value="item.warehouseName" clearable></el-option>
<el-select v-model="formobj.warehouse" @change="changeWarehouse" placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in warehouse_list" :key="item.sid" :label="item.warehouseName" :value="item.warehouseName" clearable></el-option>
</el-select>
</el-form-item>
</el-col>
@ -59,7 +47,7 @@
<el-form-item><span slot="label"><span class="icon">*</span>仓库编码</span></el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item> <!--prop="warehouseNo"-->
<el-form-item>
<el-input v-model="formobj.warehouseNo" placeholder="请输入仓库编码" class="addinputw" readonly/>
</el-form-item>
</el-col>
@ -78,12 +66,6 @@
</el-col>
<el-col :span="8" class="trightb">
<el-form-item prop="availableQuantity">
<!-- <el-select v-model="formobj.availableQuantity" @change='changAvailable' class="addinputw" filterable-->
<!-- placeholder="请选择">-->
<!-- <el-option v-for="item in available_list" :key="item.dictKey" :label="item.dictValue"-->
<!-- :value="item.dictKey">-->
<!-- </el-option>-->
<!-- </el-select>-->
<el-input v-model="formobj.availableQuantity" placeholder="请输入可用量" class="addinputw" clearable/>
</el-form-item>
</el-col>
@ -93,14 +75,10 @@
<el-form-item><span slot="label"><span class="icon">*</span>库存组织</span></el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item prop="stockOrgName"> <!---->
<el-select v-model="formobj.stockOrgName" @change="stockOrgNameChange"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in stockOrgName_list" :key="item.sid" :label="item.name"
:value="item.name" clearable></el-option>
<el-form-item prop="stockOrgName">
<el-select v-model="formobj.stockOrgName" @change="stockOrgNameChange" placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in stockOrgName_list" :key="item.sid" :label="item.name" :value="item.name" clearable></el-option>
</el-select>
<!-- <el-cascader :key="refreshItem" v-model="stockOrgName_list" @change="stockOrgNameChange"-->
<!-- :options="orgOptions" :props="orgProps" class="addinputw" clearable/>-->
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
@ -108,10 +86,8 @@
</el-col>
<el-col :span="8" class="trightb">
<el-form-item prop="cargoOwnerType">
<el-select v-model="formobj.cargoOwnerType" @change="changeCargoType"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in cargoType_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="formobj.cargoOwnerType" @change="changeCargoType" placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in cargoType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -140,10 +116,8 @@
</el-col>
<el-col :span="8" class="trightb">
<el-form-item prop="invenState">
<el-select v-model="formobj.invenState" @change="changeInvenState"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in invenState_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="formobj.invenState" @change="changeInvenState" placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in invenState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -152,10 +126,8 @@
</el-col>
<el-col :span="8" class="trightb"> <!--basicUnit-->
<el-form-item prop="inventoryPrimaryUnit">
<el-select v-model="formobj.inventoryPrimaryUnit" @change="changeInventoryPrimary"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in inventoryPrimary_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey" clearable></el-option>
<el-select v-model="formobj.inventoryPrimaryUnit" @change="changeInventoryPrimary" placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in inventoryPrimary_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" clearable></el-option>
</el-select>
</el-form-item>
</el-col>
@ -166,10 +138,8 @@
</el-col>
<el-col :span="8" class="trightb">
<el-form-item prop="custodianType">
<el-select v-model="formobj.custodianType" @change="changeCustodianType"
placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in custodianType_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="formobj.custodianType" @change="changeCustodianType" placeholder="请选择" class="addinputw" clearable>
<el-option v-for="item in custodianType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -194,7 +164,6 @@
</el-row>
</el-form>
</div>
<!--End 添加修改部分-->
</div>
</template>
@ -272,8 +241,6 @@
this.getInvenState() //
this.getInventoryPrimary() //
this.getWlxx() //
//
// this.getBuMen()
// ()
this.getOrg()
},
@ -308,8 +275,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.warehouse_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.warehouseName == value) {
if (e.warehouseName === value) {
bb = {
name: e.warehouseName,
warehouseNo: e.warehouseCode,
@ -338,8 +304,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.cargoType_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
@ -368,8 +333,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.inventoryPrimary_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
@ -396,8 +360,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.custodianType_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
@ -426,8 +389,7 @@
console.log('触发下拉框按钮')
let bb = {}
this.invenState_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
@ -440,34 +402,11 @@
this.formobj.invenStateSid = bb.sid
console.log('name', this.formobj.invenState, this.formobj.invenStateSid)
},
//-
// getBuMen() {
// req.salesDepName().then((res) => {
// if (res.code === '200') {
// this.options = res.data
// console.log('', this.options)
// this.BuMen0(this.options)
// }
// })
// },
// BuMen0(data) {
// data.forEach((e) => {
// if (e.children.length != 0) {
// this.BuMen0(e.children)
// } else {
// delete e.children
// this.dataArr.push(e)
// return
// }
// })
// },
// ()
getOrg() {
req.getOrg().then((res) => {
if (res.code === '200') {
this.stockOrgName_list = res.data
}
})
},
@ -475,8 +414,7 @@
console.log('触发下拉框按钮', value)
let bb = {}
this.stockOrgName_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.name == value) {
if (e.name === value) {
bb = {
name: e.name,
key: e.id,
@ -488,63 +426,6 @@
this.formobj.stockOrgNameSid = bb.sid
console.log('name', this.formobj.stockOrgName, this.formobj.stockOrgNameSid)
},
// org0(data) {
// data.forEach((e) => {
// if (e.children.length != 0) {
// this.org0(e.children)
// } else {
// delete e.children
// this.orgArr.push(e)
// return
// }
// })
// },
// //
// stockOrgNameChange(e) {
// console.log('' + JSON.stringify(e))
// var result = ''
// var result_Sid = ''
// if (e.length > 0) {
// //
// e.forEach((item) => {
// var last_id = item[item.length - 1]
// //
// this.select_temp_Name = '' // ()
// this.select_temp_Sid = '' //(Sid)
// this.gainOrgId(last_id, this.options)
// result = result + this.select_temp_Name + ','
// result_Sid = result_Sid + this.select_temp_Sid + ','
// })
// }
// if (result !== '') {
// result = result.substring(0, result.length - 1)
// }
// if (result_Sid !== '') {
// result_Sid = result_Sid.substring(0, result_Sid.length - 1)
// }
// this.formobj.stockOrgName = result
// this.formobj.stockOrgNameSid = result_Sid
// console.log('' + this.formobj.stockOrgName, this.formobj.stockOrgNameSid)
// },
// // ---
// gainOrgId(id, orgOptions) {
// for (var i = 0; i < orgOptions.length; i++) {
// if (orgOptions[i].sid) {
// this.select_temp_Name = orgOptions[i].name //
// this.select_temp_Sid = orgOptions[i].sid
// return true
// } else {
// //
// if (orgOptions[i].children !== undefined) {
// //
// if (this.gainOrgId(id, orgOptions[i].children)) {
// return true
// }
// }
// }
// }
// },
//
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
@ -566,17 +447,15 @@
})
this.dialogStatus = 'edit'
this.viewTitle = '【编辑】即时库存表'
const _this = this
req.fetchBySid(sid).then(resp => {
console.log('编辑回显', resp)
const data = resp.data
this.formobj.sid = sid
this.formobj = data
this.stockOrgName_list = data.stockOrgNameSid //
console.log('======+++======', this.stockOrgName_list)
})
.catch(e => {
this.formobj = row
this.formobj = {}
})
},
saveAdd() {
@ -601,22 +480,7 @@
},
saveEdit() {
const _this = this
// Start
var result_Sid = ''
if (this.stockOrgName_list.length > 0) {
this.stockOrgName_list.forEach((item) => {
var last_id = item[item.length - 1]
this.select_temp_Sid = '' //(Sid)
this.findOrgId(last_id, this.options)
result_Sid = result_Sid + this.select_temp_Sid + ','
})
}
if (result_Sid !== '') {
result_Sid = result_Sid.substring(0, result_Sid.length - 1)
}
this.formobj.stockOrgNameSid = result_Sid
console.log('重新赋值后的组织结构', this.formobj.stockOrgNameSid)
//End
this.$refs['form_obj'].validate(valid => {
if (valid) {
this.submitdisabled = true

Loading…
Cancel
Save