Browse Source

修复其他入库单、其他出库单分页列表报404的问题及优化部分代码

master
yunuo970428 3 years ago
parent
commit
7747402e2d
  1. 2
      anrui-scm/anrui-scm-ui/src/api/anruiscm/scmotherinbound.js
  2. 14
      anrui-scm/anrui-scm-ui/src/api/anruiscm/scmotheroutbound.js
  3. 839
      anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotherinbound/scmotherinbound.vue
  4. 1551
      anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotherinbound/scmotherinboundAdd.vue
  5. 796
      anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotheroutbound/scmotheroutbound.vue
  6. 1810
      anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotheroutbound/scmotheroutboundAdd.vue

2
anrui-scm/anrui-scm-ui/src/api/anruiscm/scmotherinbound.js

@ -93,7 +93,7 @@ export default {
// 获取客户可搜索下拉列表
kehu: function(data) {
return request({
url: '/buscenter/v1/busorder/likeGetCustomerName',
url: '/crm/v1/crmcustomer/cusList',
method: 'post',
params: data
})

14
anrui-scm/anrui-scm-ui/src/api/anruiscm/scmotheroutbound.js

@ -1,7 +1,6 @@
import request from '@/utils/request'
// 其他出库单
export default {
// 查询分页列表
listPage: function(params) {
return request({
@ -83,7 +82,7 @@ export default {
// 获取客户可搜索下拉列表
kehu: function(data) {
return request({
url: '/buscenter/v1/busorder/likeGetCustomerName',
url: '/crm/v1/crmcustomer/cusList',
method: 'post',
params: data
})
@ -98,16 +97,7 @@ export default {
data: data
})
},
// 获取组织(单选组织架构)
getOrg: function() {
return request({
url: '/portal/v1/sysorganization/getListOrg',
method: 'get',
params: data
// data: data
})
},
//获取物料编码
// 获取物料编码
getWlxx: function(data) {
return request({
url: '/scm/v1/scmmaterial/mNumsDown',

839
anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotherinbound/scmotherinbound.vue

@ -3,65 +3,40 @@
<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-item label="单据编号">
<el-input v-model="queryParams.params.billNo" placeholder="请输入单据编号" clearable/>
</el-form-item>
<el-form-item label="单据类型">
<el-select v-model="queryParams.params.billType" @change="changeBillType" style="width:200px"
filterable placeholder="请选择" clearable>
<el-option v-for="item in billType_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="queryParams.params.billType" @change="changeBillType" style="width:200px" filterable placeholder="请选择" clearable>
<el-option v-for="item in billType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
<!-- <el-input v-model="queryParams.params.billType" placeholder="请输入单据类型" clearable/>-->
</el-form-item>
<el-form-item label="供应商" class="search_label">
<el-select v-model="queryParams.params.manufacturerName" @change="changeManu" style="width:200px"
filterable placeholder="请选择" clearable>
<el-option v-for="item in manu_list" :key="item.sid" :label="item.manufacturerName"
:value="item.sid"></el-option>
<el-select v-model="queryParams.params.manufacturerName" @change="changeManu" style="width:200px" filterable placeholder="请选择" clearable>
<el-option v-for="item in manu_list" :key="item.sid" :label="item.manufacturerName" :value="item.sid"></el-option>
</el-select>
<!-- <el-input v-model="queryParams.params.manufacturerName" placeholder="请输入供应商" clearable/>-->
</el-form-item>
<el-form-item label="客户" class="search_label">
<el-select v-model="queryParams.params.customer" @change="changeCustomer" style="width:200px"
filterable placeholder="请选择" clearable>
<el-option v-for="item in customer_list" :key="item.sid" :label="item.customerName"
:value="item.sid"></el-option>
<el-select v-model="queryParams.params.customer" @change="changeCustomer" style="width:200px" filterable placeholder="请选择" clearable>
<el-option v-for="item in customer_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
</el-select>
<!-- <el-input v-model="queryParams.params.customer" placeholder="请输入客户" clearable/>-->
</el-form-item>
<el-form-item label="货主" class="search_label">
<el-input v-model="queryParams.params.cargoOwner" placeholder="请输入货主" clearable/>
</el-form-item>
<el-form-item label="货主类型">
<el-select v-model="queryParams.params.cargoOwnerType" @change="changeCargoType" style="width:200px"
filterable placeholder="请选择" clearable>
<el-option v-for="item in cargoType_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="queryParams.params.cargoOwnerType" @change="changeCargoType" style="width:200px" filterable placeholder="请选择" clearable>
<el-option v-for="item in cargoType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
<!-- <el-input v-model="queryParams.params.cargoOwnerType" placeholder="请输入货主类型" clearable/>-->
</el-form-item>
<el-form-item label="单据状态">
<el-select v-model="queryParams.params.billState" @change="changeBillState" style="width:200px"
filterable placeholder="请选择" clearable>
<el-option v-for="item in billState_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="queryParams.params.billState" @change="changeBillState" style="width:200px" filterable placeholder="请选择" clearable>
<el-option v-for="item in billState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
<!-- <el-input v-model="queryParams.params.billState" placeholder="请输入单据状态" clearable/>-->
</el-form-item>
<!-- <el-form-item label="验收员" class="search_label">-->
<!-- <el-select v-model="queryParams.params.inspectorName" @change="changeInspectorName" style="width:200px"-->
<!-- filterable placeholder="请选择">-->
<!-- <el-option v-for="item in Inspector_list" :key="item.dictKey" :label="item.dictValue"-->
<!-- :value="item.dictKey"></el-option>-->
<!-- </el-select>-->
<!-- <el-input v-model="queryParams.params.inspectorName" placeholder="请输入验收员" clearable/>-->
<!-- </el-form-item>-->
<el-divider/>
<div class="btn" style="text-align: center;">
<el-button type="primary" @click="dosearch">查询</el-button>
@ -73,24 +48,13 @@
<!--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="billNo" label="单据编号" align="center">
@ -112,14 +76,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 查询和其列表部分-->
@ -133,432 +90,412 @@
</template>
<script>
import req from '@/api/anruiscm/scmotherinbound'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './scmotherinboundAdd'
import divInfo from './scmotherinboundInfo'
import { setuser, getuser } from '@/utils/baocun'
import req from '@/api/anruiscm/scmotherinbound'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './scmotherinboundAdd'
import divInfo from './scmotherinboundInfo'
export default {
name: 'ScmOtherInboundIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
export default {
name: 'ScmOtherInboundIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false, //
tableLoading: false,
//
billType_list: [], //
manu_list: [], //
customer_list: [], //
cargoType_list: [], //
billState_list: [], //
// Inspector_list: [], //
//
dataList: [],
// sid
sids: [], // SID
sides: '', // sid
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
billNo: '', //
billType: '', //
manufacturerName: '', //
cargoOwnerType: '', //
orgName: '', //
cargoOwner: '', //
inspectorName: '', //
billState: '', //
customer: '', //
date: '', //
remarks: '' //
}
},
row: {}
}
},
created() {
this.loadList()
//
this.getBillType() //
this.getManu() //
this.getCustomer() //
this.getCargoType() //
this.getBillState() //
},
methods: {
resetState() {
this.viewState = 1
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false, //
tableLoading: false,
//
billType_list: [], //
manu_list: [], //
customer_list: [], //
cargoType_list: [], //
billState_list: [], //
// Inspector_list: [], //
//
dataList: [],
// sid
sids: [], // SID
sides: '', // sid
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
billNo: '', //
billType: '', //
manufacturerName: '', //
cargoOwnerType: '', //
orgName: '', //
cargoOwner: '', //
inspectorName: '', //
billState: '', //
customer: '', //
date: '', //
remarks: '' //
}
},
row: {}
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doSubmit':
this.doSubmit()
break
case 'doDel':
this.doDel()
break
case 'doImport':
this.doImport()
break
case 'doExport':
this.doExport()
break
default:
break
}
},
created() {
this.loadList()
//
this.getBillType() //
this.getManu() //
this.getCustomer() //
this.getCargoType() //
this.getBillState() //
// sid
handleSelectionChange(row) {
console.log('aaa', row)
const aa = []
row.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
this.row = row
this.sides = this.sids.join() // sid
console.log('获取sids数组', this.sids)
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doSubmit':
this.doSubmit()
break
case 'doDel':
this.doDel()
break
case 'doImport':
this.doImport()
break
case 'doExport':
this.doExport()
break
default:
break
}
},
// sid
handleSelectionChange(row) {
console.log('aaa', row)
const aa = []
row.forEach(element => {
aa.push(element.sid)
setuser(this.sids)
toAdd(row) {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toEdit() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' })
return
}
if (this.sids.length > 1) {
this.$message({ showClose: true, type: 'error', message: '只能选择一条记录进行编辑' })
return
}
this.viewState = 3
const sid = this.sids[0]
const row = this.row
this.$refs['divadd'].showEdit(sid, row)
},
doSubmit(row) {
//
this.btndisabled = true
req
.doSubmit(this.queryParams.params, this.sids)
.then(resp => {
console.log(resp)
this.btndisabled = false
})
this.sids = aa
this.row = row
this.sides = this.sids.join() //sid
console.log('获取sids数组', this.sids)
},
toAdd(row) {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toEdit() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' })
return
}
if (this.sids.length > 1) {
this.$message({ showClose: true, type: 'error', message: '只能选择一条记录进行编辑' })
return
}
this.viewState = 3
const sid = this.sids[0]
const row = this.row
this.$refs['divadd'].showEdit(sid, row)
},
doSubmit(row) {
//
this.btndisabled = true
req
.doSubmit(this.queryParams.params, this.sids)
.then(resp => {
console.log(resp)
this.btndisabled = false
.catch(() => {
this.btndisabled = false
})
},
doDel(row) {
if (this.sids.length === 0) {
this.$message({showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作'})
return
}
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)'
})
.catch(() => {
this.btndisabled = false
const _this = this
req.delBySids(this.sids).then(resp => {
loading.close()
_this.$message({ type: 'success', message: resp.msg, showClose: true })
_this.loadList()
})
},
doDel(row) {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
return
}
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)'
})
const _this = this
req.delBySids(this.sids).then(resp => {
.catch(e => {
loading.close()
_this.$message({ type: 'success', message: resp.msg, showClose: true })
_this.loadList()
})
.catch(e => {
loading.close()
})
})
.catch(() => {
})
},
doImport(row) {
//
req
.importExcel(this.queryParams.params, this.sids)
.then(resp => {
console.log(resp)
})
.catch(() => {
})
},
doExport(sids) {
//
req
.exportExcel(this.queryParams.params, this.sids)
.then(resp => {
var map = resp.data
const fileName = map.filename //
// // <a> Firefox Chrome download
// // IE10blobdownload
const link = document.createElement('a') // a
link.download = fileName // a
link.style.display = 'none'
link.href = map.downurl
document.body.appendChild(link)
link.click() //
URL.revokeObjectURL(link.href) // url
document.body.removeChild(link) //
})
.catch(() => {
})
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
//- changeBillType
getBillType() {
req.pullDown({
type: 'billsType'
}).then((res) => {
if (res.code === '200') {
this.billType_list = res.data
console.log('下拉框请求111', res.data)
}
})
},
// dictKey: "01"; dictType: "invoicingNature"
changeBillType(value) {
console.log('触发下拉框按钮')
let bb = {}
this.billType_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
.catch(() => {
})
this.queryParams.params.billType = bb.name
// this.queryParams.params.billType = bb.sid
console.log('name', this.queryParams.params.billType)
},
//-
getManu() {
req.changShang({}).then((res) => {
if (res.code === '200') {
this.manu_list = res.data
console.log('下拉框请求11122', res.data)
}
},
doImport(row) {
//
req
.importExcel(this.queryParams.params, this.sids)
.then(resp => {
console.log(resp)
})
},
changeManu(value) {
console.log('触发下拉框按钮')
let bb = {}
this.manu_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.sid == value) {
bb = {
name: e.manufacturerName,
sid: e.sid
}
}
.catch(() => {
})
this.queryParams.params.manufacturerName = bb.name
// this.queryParams.params.manufacturerSid = bb.sid
console.log('name', this.queryParams.params.manufacturerName, 'sid', this.queryParams.params.manufacturerSid)
},
//-
getCustomer() {
req.kehu({}).then((res) => {
if (res.code === '200') {
this.customer_list = res.data
console.log('下拉框请求11133', res.data)
}
},
doExport(sids) {
//
req
.exportExcel(this.queryParams.params, this.sids)
.then(resp => {
var map = resp.data
const fileName = map.filename //
// // <a> Firefox Chrome download
// // IE10blobdownload
const link = document.createElement('a') // a
link.download = fileName // a
link.style.display = 'none'
link.href = map.downurl
document.body.appendChild(link)
link.click() //
URL.revokeObjectURL(link.href) // url
document.body.removeChild(link) //
})
},
changeCustomer(value) {
console.log('触发下拉框按钮')
let bb = {}
this.customer_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.sid == value) {
bb = {
// type: e.dictType,
name: e.customerName,
// key: e.dictKey,
sid: e.sid
}
}
.catch(() => {
})
this.queryParams.params.customer = bb.name
// this.queryParams.params.customerSid = bb.sid
console.log('name', this.queryParams.params.manufacturerName)
},
//-
getCargoType() {
req.pullDown({
type: 'cargoOwnerType'
}).then((res) => {
if (res.code === '200') {
this.cargoType_list = res.data
console.log('下拉框请求111', res.data)
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
// - changeBillType
getBillType() {
req.pullDown({
type: 'billsType'
}).then((res) => {
if (res.code === '200') {
this.billType_list = res.data
console.log('下拉框请求111', res.data)
}
})
},
changeBillType(value) {
console.log('触发下拉框按钮')
let bb = null
this.billType_list.forEach((e) => {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
})
},
changeCargoType(value) {
console.log('触发下拉框按钮')
let bb = {}
this.cargoType_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.queryParams.params.billType = bb.name
console.log('name', this.queryParams.params.billType)
},
// -
getManu() {
req.changShang({}).then((res) => {
if (res.code === '200') {
this.manu_list = res.data
console.log('下拉框请求11122', res.data)
}
})
},
changeManu(value) {
console.log('触发下拉框按钮')
let bb = {}
this.manu_list.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.manufacturerName,
sid: e.sid
}
})
this.queryParams.params.cargoOwnerType = bb.name
// this.queryParams.params.cargoOwnerType = bb.sid
console.log('name', this.queryParams.params.cargoOwnerType)
},
}
})
this.queryParams.params.manufacturerName = bb.name
// this.queryParams.params.manufacturerSid = bb.sid
console.log('name', this.queryParams.params.manufacturerName, 'sid', this.queryParams.params.manufacturerSid)
},
// -
getBillState() {
req.pullDown({
type: 'billState'
}).then((res) => {
if (res.code === '200') {
this.billState_list = res.data
console.log('下拉框请求111', res.data)
// -
getCustomer() {
req.kehu({}).then((res) => {
if (res.code === '200') {
this.customer_list = res.data
console.log('下拉框请求11133', res.data)
}
})
},
changeCustomer(value) {
console.log('触发下拉框按钮')
let bb = {}
this.customer_list.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
sid: e.sid
}
})
},
changeBillState(value) {
console.log('触发下拉框按钮')
let bb = {}
this.billState_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.queryParams.params.customer = bb.name
console.log('name', this.queryParams.params.manufacturerName)
},
// -
getCargoType() {
req.pullDown({
type: 'cargoOwnerType'
}).then((res) => {
if (res.code === '200') {
this.cargoType_list = res.data
console.log('下拉框请求111', res.data)
}
})
},
changeCargoType(value) {
console.log('触发下拉框按钮')
let bb = null
this.cargoType_list.forEach((e) => {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
})
this.queryParams.params.billState = bb.name
// this.formobj..scmOtherInboundDto.billState = bb.sid
console.log('name', this.queryParams.params.billState)
},
}
})
this.queryParams.params.cargoOwnerType = bb.name
console.log('name', this.queryParams.params.cargoOwnerType)
},
resetQuery() {
this.queryParams.params = {}
this.queryParams.params.sid = '' // sid
this.queryParams.params.name = '' //
this.dosearch()
},
//
loadList() {
const _this = this
this.tableLoading = true
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
// for (var i = 0; i < data.records.length; i++) {
// var timeArr = data.records[i].createTime.split(' ');
// this.dataList[i].createTime = timeArr[0];
// }
})
.catch(() => {
_this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
toInfo(row) {
this.viewState = 4
const billNo = row.billNo
console.log('打开详情', billNo)
this.$refs['divinfo'].showInfo(billNo, row)
}
// -
getBillState() {
req.pullDown({
type: 'billState'
}).then((res) => {
if (res.code === '200') {
this.billState_list = res.data
console.log('下拉框请求111', res.data)
}
})
},
changeBillState(value) {
console.log('触发下拉框按钮')
let bb = {}
this.billState_list.forEach((e) => {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.queryParams.params.billState = bb.name
console.log('name', this.queryParams.params.billState)
},
resetQuery() {
this.queryParams.params = {}
this.queryParams.params.sid = '' // sid
this.queryParams.params.name = '' //
this.dosearch()
},
//
loadList() {
const _this = this
this.tableLoading = true
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(() => {
_this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
toInfo(row) {
this.viewState = 4
const billNo = row.billNo
console.log('打开详情', billNo)
this.$refs['divinfo'].showInfo(billNo, row)
}
}
}
</script>
<style scoped>
/deep/ .el-collapse {
border-top: 0px solid #e6ebf5;
border-bottom: 0px solid #e6ebf5;
}
/deep/ .el-collapse {
border-top: 0px solid #e6ebf5;
border-bottom: 0px solid #e6ebf5;
}
/deep/ .el-collapse-item__content {
margin: 0;
padding: 0;
}
/deep/ .el-collapse-item__content {
margin: 0;
padding: 0;
}
/deep/ .el-collapse-item__wrap {
border-bottom: 0px solid #ebeef5;
}
/deep/ .el-collapse-item__wrap {
border-bottom: 0px solid #ebeef5;
}
/deep/ .el-collapse-item__header {
border-bottom: 0px solid #e6ebf5;
}
/deep/ .el-collapse-item__header {
border-bottom: 0px solid #e6ebf5;
}
.searchbtn {
border: #2cab69 1px solid;
color: #2cab69;
}
.searchbtn {
border: #2cab69 1px solid;
color: #2cab69;
}
.search_label /deep/ .el-form-item__label {
width: 68px;
}
.search_label /deep/ .el-form-item__label {
width: 68px;
}
/deep/ .el-form-item {
margin-bottom: 5px;
}
/deep/ .el-form-item {
margin-bottom: 5px;
}
/*/deep/ .el-form-item:nth-of-type(4) {*/
/* margin-right: 260px;*/
/*}*/
/*/deep/ .el-form-item:nth-of-type(4) {*/
/* margin-right: 260px;*/
/*}*/
</style>

1551
anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotherinbound/scmotherinboundAdd.vue

File diff suppressed because it is too large

796
anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotheroutbound/scmotheroutbound.vue

@ -3,8 +3,7 @@
<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 size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{isSearchShow ? '隐藏查询条件' : '显示查询条件' }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
@ -12,25 +11,17 @@
<el-input v-model="queryParams.params.billNo" placeholder="请输入单据编号" clearable/>
</el-form-item>
<el-form-item label="单据类型">
<el-select v-model="queryParams.params.billType" @change="changeBillType" style="width:200px"
filterable placeholder="请选择" clearable>
<el-option v-for="item in billType_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey"></el-option>
<el-select v-model="queryParams.params.billType" @change="changeBillType" style="width:200px" filterable placeholder="请选择" clearable>
<el-option v-for="item in billType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
</el-select>
<!-- <el-input v-model="queryParams.params.billType" placeholder="请输入单据类型" clearable/>-->
</el-form-item>
<el-form-item label="客户" class="search_label">
<el-select v-model="queryParams.params.customerName" @change="changeCustomer" style="width:200px"
filterable placeholder="请选择" clearable>
<el-option v-for="item in customer_list" :key="item.sid" :label="item.customerName"
:value="item.sid"></el-option>
<el-select v-model="queryParams.params.customerName" @change="changeCustomer" style="width:200px" filterable placeholder="请选择" clearable>
<el-option v-for="item in customer_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
</el-select>
<!-- <el-input v-model="queryParams.params.customerName" placeholder="请输入客户名称" clearable/>-->
</el-form-item>
<el-form-item label="领料部门">
<el-cascader :key="refreshItem" v-model="pickingDep_list" @change="pickingDepChange"
:options="options" :props="props" clearable/>
<!-- <el-input v-model="queryParams.params.pickingDepName" placeholder="请输入领料部门" clearable/>-->
<el-cascader :key="refreshItem" v-model="pickingDep_list" @change="pickingDepChange" :options="options" :props="props" clearable/>
</el-form-item>
<el-form-item label="领料人" class="search_label">
<el-input v-model="queryParams.params.pickingPerson" placeholder="请输入领料人" clearable/>
@ -52,24 +43,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="billNo" label="单据编号" align="center">
@ -91,14 +70,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 查询和其列表部分-->
@ -112,417 +84,407 @@
</template>
<script>
import req from '@/api/anruiscm/scmotheroutbound'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './scmotheroutboundAdd'
import divInfo from './scmotheroutboundInfo'
import { setuser, getuser } from '@/utils/baocun'
export default {
name: 'ScmOtherOutboundIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
import req from '@/api/anruiscm/scmotheroutbound'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './scmotheroutboundAdd'
import divInfo from './scmotheroutboundInfo'
export default {
name: 'ScmOtherOutboundIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
tableLoading: false,
//
billType_list: [], //
customer_list: [], //
//
pickingDep_list: [], //
dataArr: [],
refreshItem: 0, // key
options: [], //
props: { // props
value: 'sid',
label: 'name',
children: 'children',
multiple: true
},
dataList: [],
sids: [], // SID
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
billNo: '', //
billType: '', //
customerName: '', //
pickingDepName: '', //
businessType: '', //
cargoOwnerType: '', //
stockOrgSid: '', // sid
stockOrgName: '', //
pickingPersonSid: '', // sid
pickingPerson: '', //
cargoOwnerSid: '', // sid
cargoOwner: '', //
claimOrgSid: '', // sid
claimOrgName: '', //
warehouseKeeperSid: '', // sid
warehouseKeeperName: '', //
billState: '', //
inventoryDirection: '', //
invenGroupSid: '', // sid
invenGroupName: '', //
date: '', //
transferInDepartment: '' //
}
},
row: {}
}
},
created() {
this.loadList()
//
this.getBillType() //
this.getCustomer() //
this.getBuMen() //
},
methods: {
resetState() {
this.viewState = 1
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
tableLoading: false,
//
billType_list: [], //
customer_list: [], //
//
pickingDep_list: [], //
dataArr: [],
refreshItem: 0, // key
options: [], //
props: { // props
value: 'sid',
label: 'name',
children: 'children',
multiple: true
},
dataList: [],
sids: [], // SID
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
billNo: '', //
billType: '', //
customerName: '', //
pickingDepName: '', //
businessType: '', //
cargoOwnerType: '', //
stockOrgSid: '', // sid
stockOrgName: '', //
pickingPersonSid: '', // sid
pickingPerson: '', //
cargoOwnerSid: '', // sid
cargoOwner: '', //
claimOrgSid: '', // sid
claimOrgName: '', //
warehouseKeeperSid: '', // sid
warehouseKeeperName: '', //
billState: '', //
inventoryDirection: '', //
invenGroupSid: '', // sid
invenGroupName: '', //
date: '', //
transferInDepartment: '' //
}
},
row: {}
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doSubmit':
this.doSubmit()
break
case 'doDel':
this.doDel()
break
case 'doImport':
this.doImport()
break
case 'doExport':
this.doExport()
break
default:
break
}
},
created() {
this.loadList()
//
this.getBillType() //
this.getCustomer() //
this.getBuMen() //
toAdd(row) {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doSubmit':
this.doSubmit()
break
case 'doDel':
this.doDel()
break
case 'doImport':
this.doImport()
break
case 'doExport':
this.doExport()
break
default:
break
}
},
toAdd(row) {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toEdit() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' })
return
}
if (this.sids.length > 1) {
this.$message({ showClose: true, type: 'error', message: '只能选择一条记录进行编辑' })
return
}
this.viewState = 3
const sid = this.sids[0]
const row = this.row
this.$refs['divadd'].showEdit(sid,row)
},
doSubmit(row) {
//
this.btndisabled = true
req
.doSubmit(this.queryParams.params, this.sids)
.then(resp => {
console.log(resp)
this.btndisabled = false
})
.catch(() => {
this.btndisabled = false
})
},
doDel() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
return
}
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
toEdit() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' })
return
}
if (this.sids.length > 1) {
this.$message({ showClose: true, type: 'error', message: '只能选择一条记录进行编辑' })
return
}
this.viewState = 3
const sid = this.sids[0]
const row = this.row
this.$refs['divadd'].showEdit(sid, row)
},
doSubmit(row) {
//
this.btndisabled = true
req
.doSubmit(this.queryParams.params, this.sids)
.then(resp => {
console.log(resp)
this.btndisabled = false
})
.then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const _this = this
req
.delBySids(this.sids)
.then(resp => {
loading.close()
_this.$message({ type: 'success', message: resp.msg, showClose: true })
_this.loadList()
})
.catch(e => {
loading.close()
})
})
.catch(() => {
})
},
//- changeBillType
getBillType() {
req.pullDown({
type: 'billsType'
}).then((res) => {
if (res.code === '200') {
this.billType_list = res.data
console.log('下拉框请求111', res.data)
}
.catch(() => {
this.btndisabled = false
})
},
// dictKey: "01"; dictType: "invoicingNature"
changeBillType(value) {
console.log('触发下拉框按钮')
let bb = {}
this.billType_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
},
doDel() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
return
}
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)'
})
const _this = this
req
.delBySids(this.sids)
.then(resp => {
loading.close()
_this.$message({ type: 'success', message: resp.msg, showClose: true })
_this.loadList()
})
.catch(e => {
loading.close()
})
})
this.queryParams.params.billType = bb.name
// this.queryParams.params.billType = bb.sid
console.log('name', this.queryParams.params.billType)
},
//-
getCustomer() {
req.kehu({}).then((res) => {
if (res.code === '200') {
this.customer_list = res.data
console.log('下拉框请求11133', res.data)
}
.catch(() => {
})
},
changeCustomer(value) {
console.log('触发下拉框按钮')
let bb = {}
this.customer_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.sid == value) {
bb = {
// type: e.dictType,
name: e.customerName,
// key: e.dictKey,
sid: e.sid
}
},
// - changeBillType
getBillType() {
req.pullDown({
type: 'billsType'
}).then((res) => {
if (res.code === '200') {
this.billType_list = res.data
console.log('下拉框请求111', res.data)
}
})
},
changeBillType(value) {
console.log('触发下拉框按钮')
let bb = {}
this.billType_list.forEach((e) => {
if (e.dictKey === value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
})
this.queryParams.params.customerName = bb.name
// this.queryParams.params.customerSid = bb.sid
console.log('name', this.queryParams.params.customerName)
},
// pickingDepChange
getBuMen() {
req.salesDepName().then((res) => {
if (res.code === '200') {
this.options = res.data
console.log('请求到的级联列表', this.options)
this.BuMen0(this.options)
}
})
this.queryParams.params.billType = bb.name
console.log('name', this.queryParams.params.billType)
},
// -
getCustomer() {
req.kehu({}).then((res) => {
if (res.code === '200') {
this.customer_list = res.data
console.log('下拉框请求11133', res.data)
}
})
},
changeCustomer(value) {
console.log('触发下拉框按钮')
let bb = {}
this.customer_list.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
sid: e.sid
}
})
},
BuMen0(data) {
data.forEach((e) => {
if (e.children.length != 0) {
}
})
this.queryParams.params.customerName = bb.name
console.log('name', this.queryParams.params.customerName)
},
// pickingDepChange
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) {
if (e.children.length !== 0) {
this.BuMen0(e.children)
} else {
delete e.children
this.dataArr.push(e)
return
}
})
},
//
pickingDepChange(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.findOrgId(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.queryParams.params.pickingDepName = result
// this.formobj.scmOtherInboundDto.orgSid = result_Sid
console.log('选中名称:' + this.queryParams.params.pickingDepName, result_Sid)
},
// ---
findOrgId(id, options) {
for (var i = 0; i < options.length; i++) {
if (id == options[i].sid) {
this.select_temp_Name = options[i].name //
this.select_temp_Sid = options[i].sid
return true
} else {
//
if (options[i].children !== undefined) {
//
if (this.findOrgId(id, options[i].children)) {
return true
}
})
},
//
pickingDepChange(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.findOrgId(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.queryParams.params.pickingDepName = result
console.log('选中名称:' + this.queryParams.params.pickingDepName, result_Sid)
},
// ---
findOrgId(id, options) {
for (var i = 0; i < options.length; i++) {
if (id === options[i].sid) {
this.select_temp_Name = options[i].name //
this.select_temp_Sid = options[i].sid
return true
} else {
//
if (options[i].children !== undefined && options[i].children !== null) {
//
if (this.findOrgId(id, options[i].children)) {
return true
}
}
}
},
}
},
doImport() {
//
req
.importExcel(this.queryParams.params)
.then(resp => {
console.log(resp)
})
.catch(() => {
})
},
doExport(row) {
//
req
.exportExcel(this.queryParams.params, this.sids)
.then(resp => {
var map = resp.data
const fileName = map.filename //
// // <a> Firefox Chrome download
// // IE10blobdownload
const link = document.createElement('a') // a
link.download = fileName // a
link.style.display = 'none'
link.href = map.downurl
document.body.appendChild(link)
link.click() //
URL.revokeObjectURL(link.href) // url
document.body.removeChild(link) //
})
.catch(() => {
})
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams.params = {}
this.pickingDep_list = []
this.dosearch()
this.queryParams.params.sid = '' // sid
this.queryParams.params.name = '' //
},
loadList() {
const _this = this
this.tableLoading = true
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(() => {
_this.tableLoading = false
})
},
// sid
handleSelectionChange(row) {
console.log('aaa', row)
const aa = []
row.forEach(element => {
aa.push(element.sid)
setuser(this.sids)
doImport() {
//
req
.importExcel(this.queryParams.params)
.then(resp => {
console.log(resp)
})
this.sids = aa
this.row = row
// this.sides = this.sids.join(); //sid
console.log('获取sids数组', this.sids)
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
toInfo(row) {
const billNo = row.billNo
console.log('打开详情', billNo)
this.$refs['divinfo'].showInfo(billNo,row)
this.viewState = 4
}
.catch(() => {
})
},
doExport(row) {
//
req
.exportExcel(this.queryParams.params, this.sids)
.then(resp => {
var map = resp.data
const fileName = map.filename //
// // <a> Firefox Chrome download
// // IE10blobdownload
const link = document.createElement('a') // a
link.download = fileName // a
link.style.display = 'none'
link.href = map.downurl
document.body.appendChild(link)
link.click() //
URL.revokeObjectURL(link.href) // url
document.body.removeChild(link) //
})
.catch(() => {
})
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams.params = {}
this.pickingDep_list = []
this.dosearch()
this.queryParams.params.sid = '' // sid
this.queryParams.params.name = '' //
},
loadList() {
const _this = this
this.tableLoading = true
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(() => {
_this.tableLoading = false
})
},
// sid
handleSelectionChange(row) {
console.log('aaa', row)
const aa = []
row.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
this.row = row
console.log('获取sids数组', this.sids)
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
toInfo(row) {
const billNo = row.billNo
console.log('打开详情', billNo)
this.$refs['divinfo'].showInfo(billNo, row)
this.viewState = 4
}
}
}
</script>
<style scoped>
/deep/ .el-collapse {
border-top: 0 solid #e6ebf5;
border-bottom: 0 solid #e6ebf5;
}
/deep/ .el-collapse {
border-top: 0 solid #e6ebf5;
border-bottom: 0 solid #e6ebf5;
}
/deep/ .el-collapse-item__content {
margin: 0;
padding: 0;
}
/deep/ .el-collapse-item__content {
margin: 0;
padding: 0;
}
/deep/ .el-collapse-item__wrap {
border-bottom: 0 solid #ebeef5;
}
/deep/ .el-collapse-item__wrap {
border-bottom: 0 solid #ebeef5;
}
/deep/ .el-collapse-item__header {
border-bottom: 0 solid #e6ebf5;
}
/deep/ .el-collapse-item__header {
border-bottom: 0 solid #e6ebf5;
}
.searchbtn {
border: #2cab69 1px solid;
color: #2cab69;
}
.searchbtn {
border: #2cab69 1px solid;
color: #2cab69;
}
.search_label /deep/ .el-form-item__label {
width: 68px;
}
.search_label /deep/ .el-form-item__label {
width: 68px;
}
/deep/ .el-form-item {
margin-bottom: 5px;
}
/deep/ .el-form-item {
margin-bottom: 5px;
}
</style>

1810
anrui-scm/anrui-scm-ui/src/views/anruiscm/scmotheroutbound/scmotheroutboundAdd.vue

File diff suppressed because it is too large
Loading…
Cancel
Save