新增出库 入库
This commit is contained in:
99
src/api/outStorage/outStorage.js
Normal file
99
src/api/outStorage/outStorage.js
Normal file
@@ -0,0 +1,99 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsOutBill/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 详情初始化
|
||||
init: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsOutBill/details',
|
||||
method: 'get',
|
||||
data: data
|
||||
});
|
||||
},
|
||||
|
||||
// 初始配货单
|
||||
initDistribution: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsDistributeBill/getInit',
|
||||
method: 'get',
|
||||
data: data
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
save: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsOutBill/saveOrUpdateOutBill',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 确认
|
||||
submit: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsOutBill/confirm',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 新增、保存 配货单
|
||||
saveDistribution: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsDistributeBill/saveOrUpdateBill',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsShelfBill/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询分页列表
|
||||
getGoodsListPage: function(params) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/WmsOutBill/getInventoryList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
52
src/api/reports/inOutStorage.js
Normal file
52
src/api/reports/inOutStorage.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventoryrecord/pageList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 导出报表
|
||||
exportExcel: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventoryrecord/exportExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 查询所有仓库
|
||||
getWarehouses: function(params) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/base/wmswarehouseinfo/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 根据仓库查询库位
|
||||
getWarehouseareas: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/base/wmswarehousearea/selectAll',
|
||||
method: 'get',
|
||||
params: data,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
},
|
||||
}
|
||||
49
src/api/storage/inventory.js
Normal file
49
src/api/storage/inventory.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
// 查询分页列表 -- 库存查询
|
||||
listPage: function(data) {
|
||||
return request({
|
||||
url: '/apiadmin/inventory/wmsinventory/listPage',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
},
|
||||
// 库存查询 -- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/riskcenter/v1/LoanLawsuitApply/deleteBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
},
|
||||
// 库存出入库记录
|
||||
getWmsInventoryRecordList: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventoryrecord/getWmsInventoryRecordList',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
},
|
||||
// 查询分页列表 -- 出入库查询
|
||||
pageList: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventoryrecord/pageList',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
},
|
||||
// 出入库查询 -- 导出
|
||||
exportExcel: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventoryrecord/exportExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
}
|
||||
}
|
||||
51
src/api/storage/stocktaking.js
Normal file
51
src/api/storage/stocktaking.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/wms/v1/wmsinventorycheckbill/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
},
|
||||
// 新增、保存
|
||||
save: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventorycheckbill/save',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
init: function(data) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventorycheckbill/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 查询所有商品
|
||||
getWarehousesGoods: function(params) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventory/invenGoodsListPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
},
|
||||
|
||||
// 盘点
|
||||
inven: function(params) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/inventory/wmsinventory/invenGoodsListPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
})
|
||||
},
|
||||
}
|
||||
@@ -186,29 +186,104 @@ export const constantRoutes = [
|
||||
meta: {
|
||||
title: '入库管理'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
children: [{
|
||||
path: '/deliveryNotice/index',
|
||||
component: () => import('@/views/inStorage/deliveryNotice/index'),
|
||||
name: 'DeliveryNotice',
|
||||
meta: { title: '到货通知单', noCache: true }
|
||||
meta: {
|
||||
title: '到货通知单',
|
||||
noCache: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/receivingGoods/index',
|
||||
component: () => import('@/views/inStorage/receivingGoods/index'),
|
||||
name: 'ReceivingGoods',
|
||||
meta: { title: '收货单管理', noCache: true }
|
||||
meta: {
|
||||
title: '收货单管理',
|
||||
noCache: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/upShelf/index',
|
||||
component: () => import('@/views/inStorage/upShelf/index'),
|
||||
name: 'UpShelf',
|
||||
meta: { title: '上架单管理', noCache: true }
|
||||
meta: {
|
||||
title: '上架单管理',
|
||||
noCache: true
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/outStorage',
|
||||
component: Layout,
|
||||
redirect: '/outStorage',
|
||||
meta: {
|
||||
title: '出库管理'
|
||||
},
|
||||
children: [{
|
||||
path: '/outStorage/index',
|
||||
component: () => import('@/views/outStorage/index'),
|
||||
name: 'OutStorage',
|
||||
meta: {
|
||||
title: '出库单管理',
|
||||
noCache: true
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/storage',
|
||||
component: Layout,
|
||||
redirect: '/storage',
|
||||
meta: {
|
||||
title: '库存管理'
|
||||
},
|
||||
children: [{
|
||||
path: '/inventory/inventory',
|
||||
component: () => import('@/views/storage/inventory/inventory.vue'),
|
||||
name: 'Inventory',
|
||||
meta: {
|
||||
title: '库存查询',
|
||||
noCache: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/stocktaking/index',
|
||||
component: () => import('@/views/storage/stocktaking/index'),
|
||||
name: 'Stocktaking',
|
||||
meta: {
|
||||
title: '盘点管理',
|
||||
noCache: true
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/reports',
|
||||
component: Layout,
|
||||
redirect: '/reports',
|
||||
meta: {
|
||||
title: '报表管理'
|
||||
},
|
||||
children: [ {
|
||||
path: '/inOutStorage/index',
|
||||
component: () => import('@/views/reports/inOutStorage/index.vue'),
|
||||
name: 'InventoryRefer',
|
||||
meta: { title: '出入库查询', noCache: true }
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
path: '/system',
|
||||
component: Layout,
|
||||
|
||||
291
src/views/outStorage/distributionAdd.vue
Normal file
291
src/views/outStorage/distributionAdd.vue
Normal file
@@ -0,0 +1,291 @@
|
||||
<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" label-position="top" label-width="190px" class="formadd">
|
||||
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">单据编号</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.billNo}}</span>
|
||||
<!-- <el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%" clearable /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">制单人姓名</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.createByName}}</span>
|
||||
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
|
||||
clearable /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">外部单号</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.sourceBillNo}}</span>
|
||||
<!-- <el-form-item class="trightb_item">
|
||||
<el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
|
||||
@change="orderTypeSelect">
|
||||
<el-option v-for="item in orderTypeList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">单据日期</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<!-- <span slot="label">{{formobj.createTime}}</span> -->
|
||||
<el-date-picker v-model="formobj.createTime" type="date" style="width:100%" value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
<!-- <el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
|
||||
@change="businessTypeSelect">
|
||||
<el-option v-for="item in businessTypeList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">单据状态</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.billState}}</span>
|
||||
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
|
||||
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">备注</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item class="trightb_item">
|
||||
<!-- <span slot="label">{{formobj.remarks}}</span> -->
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw"
|
||||
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="1" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="title"
|
||||
style="display: flex;align-items: center;justify-content: space-between;height:40px;margin-top: 10px;">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.detailsList" border style="width: 100%;"
|
||||
:row-style="{height: '40px'}">
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toDel(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<el-table-column label="仓库" prop="warehouseName" align="center" />
|
||||
<el-table-column label="库位" prop="warehouseRackCode" align="center" />
|
||||
<el-table-column label="配货数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.distributeCount" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/outStorage.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sourceBillSid": "",
|
||||
"sourceBillNo": "",
|
||||
"billNo": "",
|
||||
"createByName": "",
|
||||
"billState": "",
|
||||
"createBySid": "",
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sourceBillSid": "",
|
||||
"sourceBillNo": "",
|
||||
"billNo": "",
|
||||
"createByName": "",
|
||||
"billState": "",
|
||||
"createBySid": "",
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.initDistribution(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
},
|
||||
toDel(index) {
|
||||
const tip = '请确认是否删除所选商品?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.formobj.detailsList.splice(index, 1)
|
||||
|
||||
|
||||
}).catch(() => {})
|
||||
},
|
||||
saveOrUpdate(){
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.saveDistribution(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.trightb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.trightb_item {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.span {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-left: 50px;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
border: 1px #fff solid;
|
||||
padding: 0px 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
::v-deep .el-collapse-item__header {
|
||||
height: 40px;
|
||||
padding: 10px;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
color: #ffffff;
|
||||
background-color: #0294d7;
|
||||
}
|
||||
|
||||
::v-deep .el-collapse-item__content {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
336
src/views/outStorage/index.vue
Normal file
336
src/views/outStorage/index.vue
Normal file
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<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">
|
||||
{{ searchxianshitit }}
|
||||
</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-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>至
|
||||
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源单号">
|
||||
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="queryParams.params.busTypeValue" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in busTypeList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="queryParams.params.billState" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in billStateList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">出库单列表</div>
|
||||
</div>
|
||||
<!-- 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-column fixed label="操作" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="billNo" label="单据编号" align="center" />
|
||||
<el-table-column prop="createTime" label="单据日期" align="center" />
|
||||
<el-table-column prop="createByName" label="制单人" align="center" />
|
||||
<el-table-column prop="sourceBillNo" label="来源单号" align="center" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" />
|
||||
<el-table-column prop="billState" label="单据状态" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<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" />
|
||||
</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" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/outStorage/outStorage.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './outStorageAdd.vue'
|
||||
import divInfo from './outStorageInfo.vue'
|
||||
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: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"billNo": "",
|
||||
"sourceBillNo": "",
|
||||
"busTypeValue": "",
|
||||
"billState": "",
|
||||
"createTimeStart": "",
|
||||
"createTimeEnd": ""
|
||||
}
|
||||
},
|
||||
billStateList: [{
|
||||
name: "新建",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "完成",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
busTypeList: [{
|
||||
name: "业务类型1",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "业务类型2",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
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 = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
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
|
||||
}
|
||||
}).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: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
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: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
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])
|
||||
|
||||
// this.viewState = 5
|
||||
// this.$refs['distributionAdd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toInfo(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divInfo'].showEdit(row)
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
509
src/views/outStorage/outStorageAdd.vue
Normal file
509
src/views/outStorage/outStorageAdd.vue
Normal file
@@ -0,0 +1,509 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>{{title}}出库单</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit">确认</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" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据编号</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.billNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><el-date-picker v-model="formobj.createTime" type="date" class="addinputInfo addinputw"
|
||||
value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">业务类型</div>
|
||||
<el-form-item><el-select v-model="formobj.busTypeValue" filterable clearable placeholder="请选择"
|
||||
class="addinputInfo addinputw" @change="busTypeSelect">
|
||||
<el-option v-for="item in busTypeList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.billState }}</span></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="addinputInfo addinputw"
|
||||
type="textarea" :rows="4" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<div class="title titleOne">
|
||||
<div>商品列表</div>
|
||||
<el-button type="primary" size="small" class="btntopblueline" @click="selectProducts">选择商品</el-button>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.detailsList" border>
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="small" @click="commodityDelete(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" width="100" :render-header="commodityHeader">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="900" trigger="click">
|
||||
<div>
|
||||
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row
|
||||
@current-change="commodityCurrentChange($event, scope.row)">
|
||||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
|
||||
<el-table-column prop="unit" label="单位" align="center" />
|
||||
</el-table>
|
||||
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size"
|
||||
layout="total, pager" :total="commodityQuery.total" />
|
||||
</div>
|
||||
<el-input slot="reference" v-model="scope.row.goodsSpuName"
|
||||
@input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="商品ID" prop="goodsID" align="center" />
|
||||
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<el-table-column label="仓库" prop="warehouseName" align="center" />
|
||||
<el-table-column label="库位" prop="warehouseRackCode" align="center" />
|
||||
<el-table-column label="销售单价" prop="money" align="center" />
|
||||
<el-table-column label="出库数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.outCount"
|
||||
@input="commodityComputeYHAndXSJE(scope.row,$event)" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" prop="moneyAll" align="center" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 选择商品 -->
|
||||
<chooseproducts v-show="viewState == 2" ref="divSp" @backData="backData" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/outStorage/outStorage.js'
|
||||
import chooseproducts from './relation/chooseproducts'
|
||||
export default {
|
||||
components: {
|
||||
chooseproducts
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
viewState: 1,
|
||||
title: '【新增】',
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sourceBillNo": "",
|
||||
"createByName": window.sessionStorage.getItem('name'),
|
||||
"busTypeKey": "",
|
||||
"busTypeValue": "",
|
||||
"billState": '新建',
|
||||
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"sid": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
busTypeList: [{
|
||||
name: "业务类型1",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "业务类型2",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
// // commodity商品
|
||||
// commodityKey: 1,
|
||||
// commodityLoading: false,
|
||||
// commodityQuery: {
|
||||
// current: 1,
|
||||
// size: 2,
|
||||
// total: 0,
|
||||
// params: {
|
||||
// name: '',
|
||||
// inOrg: "",
|
||||
// outOrg: ""
|
||||
// }
|
||||
// },
|
||||
// commodityData: [],
|
||||
isUpdata: false
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
backData(value) {
|
||||
this.viewState = 1
|
||||
if (value.length > 0) {
|
||||
value.forEach((e) => {
|
||||
|
||||
this.formobj.detailsList.push({
|
||||
goodSpuSid: e.goodsSpuSid,
|
||||
goodsSpuName: e.goodsSpuName,
|
||||
goodsSkuSid: e.goodsSkuSid,
|
||||
goodsSkuTitle: e.goodsSkuTitle,
|
||||
goodsSkuCode: e.goodsSkuCode,
|
||||
goodsSkuOwnSpec: e.goodsSkuOwnSpec,
|
||||
unit: e.unit,
|
||||
warehouseSid: e.warehouseSid,
|
||||
warehouseName: e.warehouseName,
|
||||
warehouseRackSid: e.warehouseRackSid,
|
||||
warehouseRackCode: e.warehouseRackCode,
|
||||
money: e.money,
|
||||
moneyAll: '',
|
||||
outCount: '',
|
||||
inventorySid: e.inventorySid, // 库存商品sid
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
selectProducts() {
|
||||
this.viewState = 2
|
||||
const aa = []
|
||||
this.$refs['divSp'].showData(aa, this.formobj.createOrgSid)
|
||||
},
|
||||
|
||||
// commodityInput(value) {
|
||||
// this.commodityQuery.params.name = value
|
||||
// this.commodityLoading = true
|
||||
// req.getGoodsListPage(this.commodityQuery).then((response) => {
|
||||
// if (response.success) {
|
||||
// this.commodityLoading = false
|
||||
// this.commodityData = response.data.records
|
||||
// this.commodityQuery.total = response.data.total
|
||||
// } else {
|
||||
// this.serviceLoading = false
|
||||
// this.commodityData = []
|
||||
// this.commodityQuery.total = 0
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// commodityDelete(index) {
|
||||
// this.formobj.detailsList.splice(index, 1)
|
||||
// },
|
||||
// commodityCurrentChange(value, row) {
|
||||
// console.log("commodityCurrentChange》》》》", value)
|
||||
// console.log("commodityCurrentChange》》》》", row)
|
||||
// row.inventorySid = value.inventorySid
|
||||
// row.goodSpuSid = value.goodSpuSid
|
||||
// row.goodsSkuSid = value.goodsSkuSid
|
||||
// row.goodsSkuTitle = value.goodsSkuTitle
|
||||
// row.goodsSpuName = value.goodsSpuName
|
||||
// row.goodsSkuCode = value.goodsSkuCode
|
||||
// row.goodsSkuOwnSpec = value.goodsSkuOwnSpec
|
||||
// row.unit = value.unit
|
||||
// row.warehouseSid = value.warehouseSid
|
||||
// row.warehouseName = value.warehouseName
|
||||
// row.warehouseRackSid = value.warehouseRackSid
|
||||
// row.warehouseRackCode = value.warehouseRackCode
|
||||
// row.money = value.money
|
||||
// row.moneyAll = 0
|
||||
// row.outCount = 0
|
||||
// document.body.click()
|
||||
// },
|
||||
|
||||
// // 在头部标题上添加“新增”图标
|
||||
// commodityHeader(h, {
|
||||
// column
|
||||
// }) {
|
||||
// return h(
|
||||
// 'div',
|
||||
// [
|
||||
// h('span', column.label),
|
||||
// h('i', {
|
||||
// class: 'add-btn-icon el-icon-plus',
|
||||
// style: 'color: red;font-size:20px',
|
||||
// on: {
|
||||
// click: this.commodityAdd // 点击执行函数
|
||||
// }
|
||||
// })
|
||||
// ]
|
||||
// )
|
||||
// },
|
||||
// commodityAdd() {
|
||||
// this.formobj.detailsList.push({
|
||||
// "inventorySid": "",
|
||||
// "goodSpuSid": "",
|
||||
// "goodsSpuName": "",
|
||||
// "goodsSkuSid": "",
|
||||
// "goodsSkuTitle": "",
|
||||
// "goodsSkuCode": "",
|
||||
// "goodsSkuOwnSpec": "",
|
||||
// "unit": "",
|
||||
// "warehouseSid": "",
|
||||
// "warehouseName": "",
|
||||
// "warehouseRackSid": "",
|
||||
// "warehouseRackCode": "",
|
||||
// "money": 0,
|
||||
// "moneyAll": 0,
|
||||
// "outCount": 0
|
||||
// })
|
||||
// },
|
||||
indexMethod(index) {
|
||||
return Number(index) + 1
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.save(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
|
||||
if (this.formobj.createByName == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '制单人不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.createTime == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '单据日期不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.busTypeKey == '' || this.formobj.busTypeValue == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '单据类型不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.detailsList.length == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '商品列表不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.formobj.detailsList.length; i++) {
|
||||
var item = this.formobj.detailsList[i]
|
||||
|
||||
|
||||
if (item.goodSpuSid == '' || item.goodsSpuName == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '商品名称不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (item.goodsSkuCode == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '商品编码不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (item.outCount == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '出库数量不能为0'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.submit(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sourceBillNo": "",
|
||||
"createByName": "",
|
||||
"busTypeKey": "",
|
||||
"busTypeValue": "",
|
||||
"billState": '新建',
|
||||
"createOrgSid": "",
|
||||
"useOrgSid": "",
|
||||
"sid": "",
|
||||
"createBySid": "",
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
}
|
||||
this.submitdisabled = false
|
||||
this.isUpdata = false
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
this.title = "【新增】"
|
||||
this.isUpdata = false
|
||||
},
|
||||
showEdit(row) {
|
||||
this.title = "【修改】"
|
||||
this.isUpdata = true
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
|
||||
req.init(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
},
|
||||
busTypeSelect(val) {
|
||||
const choose = this.busTypeList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>busTypeSelect', choose)
|
||||
this.formobj.busTypeKey = choose[0].sid
|
||||
this.formobj.busTypeValue = choose[0].name
|
||||
|
||||
},
|
||||
commodityComputeYHAndXSJE(row, val) {
|
||||
console.log("aaa", row);
|
||||
console.log("aaa", val);
|
||||
|
||||
row.moneyAll = (Number(row.money) * Number(row.outCount)).toFixed(2)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo addinputw {
|
||||
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;
|
||||
}
|
||||
</style>
|
||||
152
src/views/outStorage/outStorageInfo.vue
Normal file
152
src/views/outStorage/outStorageInfo.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
outStorage<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">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据编号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">业务类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.busTypeValue }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billState }}</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.remarks }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<div class="title">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.detailsList" border>
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<el-table-column label="出库数量" prop="outCount" align="center" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/outStorage/outStorage.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.init(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</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;
|
||||
}
|
||||
</style>
|
||||
164
src/views/outStorage/relation/chooseproducts.vue
Normal file
164
src/views/outStorage/relation/chooseproducts.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<div class="tab-header webtop">
|
||||
<div>选择商品</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="120px" class="tab-header">
|
||||
<el-form-item label="商品名称" class="searchlist">
|
||||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码" class="searchlist">
|
||||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" class="searchlist">
|
||||
<el-input v-model="listQuery.params.manufacturerName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listtop">
|
||||
<div class="tit">商品列表</div>
|
||||
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>-->
|
||||
</div>
|
||||
<div class="">
|
||||
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" 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="goodsSpuName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="indexes" label="规格" align="center" />
|
||||
<el-table-column prop="goodsUnitName" label="单位" align="center" />
|
||||
<el-table-column prop="manufacturerName" label="供应商" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<Pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import { chooseproducts } from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
name: 'SelectVehicle',
|
||||
components: {
|
||||
Pagination
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '隐藏查询条件',
|
||||
tableKey: 0,
|
||||
sids: [],
|
||||
list: [],
|
||||
number: '',
|
||||
listLoading: false,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 5,
|
||||
params: {
|
||||
createOrgSid: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
manufacturerName: ''
|
||||
},
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
chooseproducts(this.listQuery).then((response) => {
|
||||
this.listLoading = false
|
||||
if (response.success) {
|
||||
this.listQuery.total = response.data.total
|
||||
this.list = response.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 重置按钮
|
||||
handleReset() {
|
||||
this.listQuery.current = 1
|
||||
this.listQuery.size = 5
|
||||
this.listQuery.total = 0
|
||||
this.listQuery.params.goodsSpuName = ''
|
||||
this.listQuery.params.goodsSkuCode = ''
|
||||
this.listQuery.params.manufacturerName = ''
|
||||
this.getList()
|
||||
},
|
||||
handleSelectionChange(row) {
|
||||
this.sids = row
|
||||
},
|
||||
showData(value, createOrgSid) {
|
||||
// const aa = []
|
||||
// if (value.length > 0) {
|
||||
// for (var i = 0; i < value.length; i++) {
|
||||
// aa.push(value[i].saleVehSid)
|
||||
// }
|
||||
// this.listQuery.params.saleVehSids = aa
|
||||
// } else {
|
||||
// this.listQuery.params.saleVehSids = []
|
||||
// }``
|
||||
this.listQuery.params.createOrgSid = createOrgSid
|
||||
this.listQuery.current = 1
|
||||
this.listQuery.size = 5
|
||||
this.listQuery.total = 0
|
||||
this.getList()
|
||||
},
|
||||
// 添加修改返回
|
||||
AddUpdateReturn() {
|
||||
if (this.sids.length > 0) {
|
||||
this.$emit('backData', this.sids)
|
||||
} else {
|
||||
this.$notify({ title: '提示', message: '请至少选择一条记录进行操作', type: 'error', duration: 2000 })
|
||||
}
|
||||
},
|
||||
// 返回
|
||||
handleReturn() {
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
435
src/views/reports/inOutStorage/index.vue
Normal file
435
src/views/reports/inOutStorage/index.vue
Normal file
@@ -0,0 +1,435 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<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">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="商品ID">
|
||||
<el-input v-model="queryParams.params.goodsID" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="queryParams.params.goodsSpuName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码">
|
||||
<el-input v-model="queryParams.params.goodsSkuCode" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-select v-model="queryParams.params.warehouseName" placeholder="请选择" @change='selectWarehouseName'>
|
||||
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-select v-model="queryParams.params.warehouseRackCode" placeholder="请选择"
|
||||
@change='selectWarehouseAreaCode'>
|
||||
<el-option v-for="(item,i) in warehouseRackList" :key="i" :label="item.areaCode" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-select v-model="queryParams.params.billObjName" placeholder="请选择" @change='supplierNameSelect'>
|
||||
<el-option v-for="(item,i) in supplierList" :key="i" :label="item.supplierName" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="queryParams.params.batchNumber" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<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" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in billTypeList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="queryParams.params.busTypeValue" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in busTypeList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生时间">
|
||||
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>至
|
||||
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</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>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">商品出入库列表</div>
|
||||
</div>
|
||||
<!-- 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-column fixed prop="goodsID" label="商品ID" align="center" width="120" />
|
||||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" width="120" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" width="120" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="120" />
|
||||
<el-table-column prop="unit" label="单位" align="center" width="80" />
|
||||
<el-table-column prop="warehouseName" label="仓库" align="center" width="100" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" align="center" width="100" />
|
||||
<el-table-column prop="billNo" label="来源单号" align="center" width="120" />
|
||||
<el-table-column prop="billType" label="单据类型" align="center" width="120" />
|
||||
<el-table-column prop="createTime" label="发生时间" align="center" width="120" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="120" />
|
||||
<el-table-column prop="billObjName" label="客户/供应商" align="center" width="150" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="100" />
|
||||
<el-table-column prop="count" label="数量" align="center" width="80" />
|
||||
<el-table-column prop="currentCount" label="出入库后的库存" align="center" width="150" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<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" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<!-- <divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/reports/inOutStorage.js'
|
||||
import {
|
||||
choiceSupplierInfo,
|
||||
getOrgSidByPath
|
||||
} from '@/api/Common/dictcommons'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
// import divAdd from './brandsAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
// divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'success',
|
||||
size: 'small',
|
||||
icon: 'export',
|
||||
btnKey: 'build',
|
||||
btnLabel: '导出'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"goodsID": "",
|
||||
"billNo": "",
|
||||
"billType": "",
|
||||
"busTypeValue": "",
|
||||
"billObjName": "",
|
||||
"batchNumber": "",
|
||||
"goodsSpuName": "",
|
||||
"goodsSkuCode": "",
|
||||
"warehouseName": "",
|
||||
"warehouseRackCode": "",
|
||||
"createTimeStart": "",
|
||||
"createTimeEnd": ""
|
||||
}
|
||||
},
|
||||
billTypeList: [{
|
||||
name: "单据类型1",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "单据类型2",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
busTypeList: [{
|
||||
name: "业务类型1",
|
||||
sid: "1"
|
||||
},
|
||||
{
|
||||
name: "业务类型2",
|
||||
sid: "2"
|
||||
}
|
||||
],
|
||||
warehouseList: [],
|
||||
warehouseRackList: [],
|
||||
supplierList: [],
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
this.getsupplierLust()
|
||||
this.getWarehouseList()
|
||||
|
||||
|
||||
getOrgSidByPath({
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.createOrgSid = res.data
|
||||
this.formobj.useOrgSid = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
supplierNameSelect(val) {
|
||||
|
||||
console.log("supplierNameSelect", val);
|
||||
const choose = this.supplierList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>supplierNameSelect', choose)
|
||||
this.queryParams.params.billObjName = choose[0].supplierName
|
||||
this.queryParams.params.billObjSid = choose[0].sid
|
||||
|
||||
},
|
||||
getsupplierLust() {
|
||||
// var params = {
|
||||
// createOrgSid: ""
|
||||
// }
|
||||
// req.choiceSupplier(params).then((res) => {
|
||||
// if (res.success) {
|
||||
// this.supplierList = res.data
|
||||
|
||||
// console.log("aaaaaa", this.supplierList);
|
||||
|
||||
// }
|
||||
// })
|
||||
|
||||
choiceSupplierInfo({
|
||||
deptSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage
|
||||
.getItem('defaultOrgPath').lastIndexOf('/') + 1)
|
||||
}).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.supplierList = resp.data
|
||||
console.log("aaaaaa", this.supplierList);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
// choiceSupplierInfo({
|
||||
// orgSid: res.data
|
||||
// }).then((resp) => {
|
||||
// if (resp.success) {
|
||||
// this.supplierList = resp.data
|
||||
// console.log("aaaaaa", this.supplierNameList);
|
||||
// }
|
||||
// })
|
||||
|
||||
},
|
||||
getWarehouseList() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
req.getWarehouses(parpams).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
getWarehouseAreaList(sid) {
|
||||
var query = {
|
||||
ckSid: sid
|
||||
}
|
||||
req.getWarehouseareas(query).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseRackList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseRackList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
selectWarehouseName(val) {
|
||||
console.log("selectWarehouseName", val);
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||
this.queryParams.params.warehouseName = choose[0].warehouseName
|
||||
this.queryParams.params.warehouseSid = choose[0].sid
|
||||
|
||||
this.getWarehouseAreaList(choose[0].sid)
|
||||
|
||||
},
|
||||
selectWarehouseAreaCode(val) {
|
||||
console.log("selectWarehouseAreaCode", val);
|
||||
|
||||
const choose = this.warehouseRackList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseAreaCode', choose)
|
||||
this.queryParams.params.warehouseRackName = choose[0].areaCode
|
||||
this.queryParams.params.warehouseRackSid = choose[0].sid
|
||||
|
||||
},
|
||||
|
||||
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 = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'build':
|
||||
// this.toBuild()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
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
|
||||
}
|
||||
}).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: {
|
||||
"goodsID": "",
|
||||
"billNo": "",
|
||||
"billType": "",
|
||||
"busTypeValue": "",
|
||||
"billObjName": "",
|
||||
"batchNumber": "",
|
||||
"goodsSpuName": "",
|
||||
"goodsSkuCode": "",
|
||||
"warehouseName": "",
|
||||
"warehouseRackCode": "",
|
||||
"createTimeStart": "",
|
||||
"createTimeEnd": ""
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
|
||||
toBuild() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
|
||||
req.exportExcel(this.queryParams.params).then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '出入库明细_' + this.queryParams.params.createDateStart + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
285
src/views/storage/inventory/inventory.vue
Normal file
285
src/views/storage/inventory/inventory.vue
Normal file
@@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="库存查询" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
||||
<!--Start查询列表部分-->
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
|
||||
<el-form-item label="商品ID">
|
||||
<el-input v-model="listQuery.params.goodsID" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码">
|
||||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-input v-model="listQuery.params.warehouseName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-input v-model="listQuery.params.warehouseRackCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="listQuery.params.batchNumber" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<div class="listtop">
|
||||
<div class="tit">商品信息列表</div>
|
||||
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" align="center" width="50"/>
|
||||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/>
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toCRK(scope.row)">出入库</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsID" label="商品ID" align="center" width="100" />
|
||||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="100" />
|
||||
<el-table-column prop="unit" label="单位" align="center" width="80" />
|
||||
<el-table-column prop="warehouseName" label="仓库" min-width="100" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" width="100" />
|
||||
<el-table-column prop="count" label="现有库存" align="center" width="100" />
|
||||
<el-table-column prop="allocateCount" label="分配库存" align="center" width="100" />
|
||||
<el-table-column prop="useCount" label="可用库存" align="center" width="100" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="90" />
|
||||
<el-table-column prop="firstInDate" label="首次入库日期" align="center" width="140" />
|
||||
<el-table-column prop="dateAge" label="库龄" width="80" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 出入库记录 -->
|
||||
<inventoryRecord v-show="viewState == 2" ref="divCRK" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/storage/inventory'
|
||||
import inventoryRecord from './inventoryRecord'
|
||||
|
||||
export default {
|
||||
name: 'Capital',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar,
|
||||
inventoryRecord
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
btnList: [
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: '',
|
||||
btnKey: 'toCarry',
|
||||
btnLabel: '结转'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'export',
|
||||
btnKey: 'doExport',
|
||||
btnLabel: '导出'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
batchNumber: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'toCarry':
|
||||
this.toCarry()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doExport':
|
||||
this.doExport()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 信息条数 获取点击时当前的sid
|
||||
handleSelectionChange(row) {
|
||||
const aa = []
|
||||
row.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 表中序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
req.listPage(this.listQuery).then(response => {
|
||||
this.listLoading = false
|
||||
if (response.success) {
|
||||
this.list = response.data.records
|
||||
this.listQuery.total = response.data.total
|
||||
} else {
|
||||
this.list = []
|
||||
this.listQuery.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
batchNumber: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
toCRK(row) {
|
||||
this.viewState = 2
|
||||
this.$refs['divCRK'].showInfo(row)
|
||||
},
|
||||
toCarry() {},
|
||||
doExport() {},
|
||||
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)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({ type: 'success', message: resp.msg, showClose: true })
|
||||
}
|
||||
this.getList()
|
||||
loading.close()
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
67
src/views/storage/inventory/inventoryRecord.vue
Normal file
67
src/views/storage/inventory/inventoryRecord.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">已还与欠款情况</div>
|
||||
<el-table :key="tableKey" :data="formobj.list" :index="index" border style="width: 100%">
|
||||
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center" />
|
||||
<el-table-column prop="billNo" label="来源单号" align="center" width="100" />
|
||||
<el-table-column prop="billType" label="单据类型" align="center" width="100" />
|
||||
<el-table-column prop="createTime" label="发生时间" align="center" width="100" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="100" />
|
||||
<el-table-column prop="billObjName" label="客户/供应商" align="center" min-width="140" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="100" />
|
||||
<el-table-column prop="count" label="数量" align="center" width="80" />
|
||||
<el-table-column prop="currentCount" label="出入库后的库存" align="center" width="160" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/inventory'
|
||||
|
||||
export default {
|
||||
name: 'InventoryRecord',
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
formobj: {
|
||||
list: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showInfo(row) {
|
||||
this.viewTitle = row.goodsID + '-' + row.goodsSpuName + '-' + row.goodsSkuCode
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
req.getWmsInventoryRecordList({ sid: row.sid }).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn() {
|
||||
this.formobj = {
|
||||
list: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
262
src/views/storage/inventory/inventoryRefer.vue
Normal file
262
src/views/storage/inventory/inventoryRefer.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="出入库查询" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
||||
<!--Start查询列表部分-->
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
|
||||
<el-form-item label="商品ID">
|
||||
<el-input v-model="listQuery.params.goodsID" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码">
|
||||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-input v-model="listQuery.params.warehouseName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-input v-model="listQuery.params.warehouseRackCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="listQuery.params.batchNumber" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源单号">
|
||||
<el-input v-model="listQuery.params.billNo" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据类型">
|
||||
<el-input v-model="listQuery.params.billType" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-input v-model="listQuery.params.busTypeValue" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生时间">
|
||||
<el-date-picker v-model="listQuery.params.createTimeStart" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
|
||||
<span style="padding: 0 8px">至</span>
|
||||
<el-date-picker v-model="listQuery.params.createTimeEnd" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<div class="listtop">
|
||||
<div class="tit">商品出入库列表</div>
|
||||
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;">
|
||||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/>
|
||||
<el-table-column prop="goodsID" label="商品ID" align="center" width="100" />
|
||||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="100" />
|
||||
<el-table-column prop="unit" label="单位" align="center" width="80" />
|
||||
<el-table-column prop="warehouseName" label="仓库" min-width="100" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" width="100" />
|
||||
<el-table-column prop="billNo" label="来源单号" align="center" width="100" />
|
||||
<el-table-column prop="createTime" label="发生时间" align="center" width="120" />
|
||||
<el-table-column prop="billType" label="单据类型" align="center" width="100" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="100" />
|
||||
<el-table-column prop="billObjName" label="客户/供应商" align="center" width="150" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="100" />
|
||||
<el-table-column prop="count" label="数量" align="center" width="140" />
|
||||
<el-table-column prop="currentCount" label="出入库后的库存" width="80" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/storage/inventory'
|
||||
|
||||
export default {
|
||||
name: 'InventoryRefer',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
btnList: [
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'export',
|
||||
btnKey: 'doExport',
|
||||
btnLabel: '导出'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
billNo: '',
|
||||
billType: '',
|
||||
busTypeValue: '',
|
||||
billObjName: '',
|
||||
batchNumber: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
createTimeStart: '',
|
||||
createTimeEnd: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'doExport':
|
||||
this.doExport()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 表中序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
req.pageList(this.listQuery).then(response => {
|
||||
this.listLoading = false
|
||||
if (response.success) {
|
||||
this.list = response.data.records
|
||||
this.listQuery.total = response.data.total
|
||||
} else {
|
||||
this.list = []
|
||||
this.listQuery.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
billNo: '',
|
||||
billType: '',
|
||||
busTypeValue: '',
|
||||
billObjName: '',
|
||||
batchNumber: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
createTimeStart: '',
|
||||
createTimeEnd: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
doExport() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.exportExcel(this.listQuery.params).then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '出入库记录' + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
322
src/views/storage/stocktaking/index.vue
Normal file
322
src/views/storage/stocktaking/index.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<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">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="开始日期">
|
||||
<el-date-picker v-model="queryParams.params.createDateStart" @change="selectTime1" type="date"
|
||||
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker v-model="queryParams.params.createDateEnd" @change="selectTime2" type="date"
|
||||
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</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>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">盘点列表</div>
|
||||
</div>
|
||||
<!-- 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-column prop="billNo" label="单据编号" align="center" />
|
||||
<el-table-column prop="createDate" label="单据日期" align="center" />
|
||||
<el-table-column prop="createByName" label="制单人姓名" align="center" />
|
||||
<el-table-column prop="checkStateName" label="盘点状态" align="center" />
|
||||
<el-table-column prop="completeDate" label="完成时间" align="center" />
|
||||
<el-table-column prop="createOrgName" label="门店" align="center" />
|
||||
<el-table-column prop="profitCount" label="盘盈数量" align="center" />
|
||||
<el-table-column prop="profitAmount" label="盘盈金额" align="center" />
|
||||
<el-table-column prop="lossCount" label="盘亏数量" align="center" />
|
||||
<el-table-column prop="lossAmount" label="盈亏金额" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<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" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/stocktaking.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './stocktakingAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
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: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"createDateStart": "",
|
||||
"createDateEnd": "",
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
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
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
selectTime1() {
|
||||
|
||||
},
|
||||
selectTime2() {
|
||||
|
||||
},
|
||||
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"createDateStart": "",
|
||||
"createDateEnd": "",
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
},
|
||||
toEdit(){
|
||||
if(this.selectionList.length!=1){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(this.selectionList[0].checkState!=1){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "此记录已完成,不可重复编辑。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
toBuild() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
|
||||
req.exportExcel(this.queryParams.params).then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '出入库明细_' + this.queryParams.params.createDateStart + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
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.deleteGoods(row.sid).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(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
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)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
412
src/views/storage/stocktaking/stocktakingAdd.vue
Normal file
412
src/views/storage/stocktaking/stocktakingAdd.vue
Normal file
@@ -0,0 +1,412 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="settle()">盘点</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div
|
||||
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;padding: 10px;">
|
||||
<div>商品列表</div>
|
||||
<div v-if="formobj.billNo!=''">单号:{{formobj.billNo}}</div>
|
||||
</div>
|
||||
|
||||
<el-table :key="commodityKey" :data="formobj.wmsInventoryCheckbillDetailList" :index="index" border
|
||||
style="width: 100%;">
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" />
|
||||
<el-table-column align="center" width="70" :render-header="commodityHeader">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="900" trigger="click">
|
||||
<div>
|
||||
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row
|
||||
@current-change="commodityCurrentChange($event, scope.row)">
|
||||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="型号" align="center" />
|
||||
<el-table-column prop="unit" label="单位" align="center" />
|
||||
<el-table-column prop="warehouseName" label="仓库" align="center" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" align="center" />
|
||||
<el-table-column prop="count" label="账面数量" align="center" />
|
||||
</el-table>
|
||||
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size"
|
||||
layout="total, pager" :total="commodityQuery.total" />
|
||||
</div>
|
||||
<el-input slot="reference" v-model="scope.row.goodsSpuName"
|
||||
@input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="carModel" label="型号" align="center" />
|
||||
<el-table-column prop="unit" label="单位" align="center" />
|
||||
<el-table-column prop="warehouseName" label="仓库" align="center" />
|
||||
<el-table-column prop="warehouseRackCode" label="货位" align="center" />
|
||||
<el-table-column prop="taxPrice" label="单价" align="center" />
|
||||
<el-table-column prop="bookCount" label="账面数量" align="center" />
|
||||
<el-table-column label="实盘数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" @input="commodityComputeYHAndXSJE(scope.row,$event)"
|
||||
v-model="scope.row.realCount" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" label="状态" align="center" width="100" />
|
||||
<el-table-column prop="profitandlossNumber" label="盈亏数" align="center" width="100" />
|
||||
<el-table-column prop="profitandlossAmount" label="盈亏金额" align="center" width="100" />
|
||||
</el-table>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item><span>盘盈数量:{{ profitandNumber }} , 盘盈金额:{{ profitandPrice }} , 盘亏数量:{{ lossNumber }} ,
|
||||
盘库金额:{{ lossPrice }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<el-form-item><span>备注</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="23">
|
||||
<el-form-item><el-input v-model="formobj.remarks" clearable placeholder="请填写备注..." /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/stocktaking.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
submitdisabled: false,
|
||||
settleVisible: false, //
|
||||
activeNames: '1',
|
||||
index: 0,
|
||||
|
||||
// commodity商品
|
||||
commodityKey: 1,
|
||||
commodityLoading: false,
|
||||
commodityQuery: {
|
||||
current: 1,
|
||||
size: 2,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
commodityData: [],
|
||||
formobj: {
|
||||
"sid": "",
|
||||
"remarks": "",
|
||||
"billNo": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createByName":window.sessionStorage.getItem('name'),
|
||||
"createDate": "",
|
||||
"createUserSid": window.sessionStorage.getItem('userSid'),
|
||||
"checkType": "",
|
||||
"profitAmount": "",
|
||||
"lossCount": "",
|
||||
"lossAmount": "",
|
||||
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"wmsInventoryCheckbillDetailList": [
|
||||
|
||||
]
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算盘盈数量
|
||||
profitandNumber() {
|
||||
let quantity = 0
|
||||
if (this.formobj.wmsInventoryCheckbillDetailList.length > 0) {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) < Number(e.realCount)) {
|
||||
quantity += e.realCount - e.bookCount
|
||||
}
|
||||
})
|
||||
}
|
||||
this.formobj.profitCount = quantity
|
||||
return quantity
|
||||
},
|
||||
// 计算盘盈金额
|
||||
profitandPrice() {
|
||||
let material = 0
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) < Number(e.realCount)) {
|
||||
material += (e.realCount - e.bookCount) * e.taxPrice
|
||||
}
|
||||
})
|
||||
this.formobj.profitAmount = material.toFixed(2)
|
||||
return material.toFixed(2)
|
||||
},
|
||||
// 计算盘亏数量
|
||||
lossNumber() {
|
||||
let quantity = 0
|
||||
if (this.formobj.wmsInventoryCheckbillDetailList.length > 0) {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) > Number(e.realCount)) {
|
||||
quantity += e.realCount - e.bookCount
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.formobj.lossCount = quantity
|
||||
|
||||
return quantity
|
||||
},
|
||||
// 计算盘亏金额
|
||||
lossPrice() {
|
||||
let material = 0
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) > Number(e.realCount)) {
|
||||
material += (e.realCount - e.bookCount) * e.taxPrice
|
||||
}
|
||||
})
|
||||
|
||||
this.formobj.lossAmount = material.toFixed(2)
|
||||
|
||||
return material.toFixed(2)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
showAdd() {
|
||||
this.viewTitle = '【新增】盘点记录'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
},
|
||||
showEdit(row) {
|
||||
this.viewTitle = '【修改】盘点记录'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
req.init(row.sid).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj = res.data
|
||||
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
this.commodityComputeYHAndXSJE(e, e.realCount)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
// 在头部标题上添加“新增”图标
|
||||
commodityHeader(h, {
|
||||
column
|
||||
}) {
|
||||
return h(
|
||||
'div',
|
||||
[
|
||||
h('span', column.label),
|
||||
h('i', {
|
||||
class: 'add-btn-icon el-icon-plus',
|
||||
style: 'color: red;font-size:20px',
|
||||
on: {
|
||||
click: this.commodityAdd // 点击执行函数
|
||||
}
|
||||
})
|
||||
]
|
||||
)
|
||||
},
|
||||
commodityAdd() {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.push({
|
||||
"sid": "",
|
||||
"state": "",
|
||||
"billSid": "",
|
||||
"inventorySid": "",
|
||||
"warehouseSid": "",
|
||||
"warehouseName": "",
|
||||
"warehouseRackSid": "",
|
||||
"warehouseRackCode": "",
|
||||
"taxPrice": "",
|
||||
"bookCount": "",
|
||||
"realCount": "",
|
||||
"profitandlossNumber": "",
|
||||
"profitandlossAmount": "",
|
||||
"picUrl": ""
|
||||
})
|
||||
},
|
||||
commodityInput(value) {
|
||||
this.commodityQuery.params.name = value
|
||||
this.commodityLoading = true
|
||||
req.getWarehousesGoods(this.commodityQuery).then((response) => {
|
||||
if (response.success) {
|
||||
this.commodityLoading = false
|
||||
this.commodityData = response.data.records
|
||||
this.commodityQuery.total = response.data.total
|
||||
} else {
|
||||
this.commodityLoading = false
|
||||
this.commodityData = []
|
||||
this.commodityQuery.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
commodityDelete(index) {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.splice(index, 1)
|
||||
},
|
||||
commodityCurrentChange(value, row) {
|
||||
row.sid = value.sid
|
||||
row.goodsName = value.goodsSpuName
|
||||
row.goodsSkuCode = value.goodsSkuCode
|
||||
row.goodsSkuOwnSpec = value.goodsSkuOwnSpec
|
||||
row.unit = value.unit
|
||||
row.warehouseName = value.warehouseName
|
||||
row.warehouseSid = value.warehouseSid
|
||||
row.warehouseRackCode = value.warehouseRackCode
|
||||
row.bookCount = value.count
|
||||
row.taxPrice = value.salesPrice
|
||||
row.realCount = ""
|
||||
row.profitandlossNumber = ""
|
||||
row.profitandlossAmount = ""
|
||||
document.body.click()
|
||||
},
|
||||
// 计算状态 盈亏数量 盈亏金额
|
||||
commodityComputeYHAndXSJE(row, val) {
|
||||
|
||||
console.log("aaa", row);
|
||||
console.log("aaa", val);
|
||||
|
||||
// 正常
|
||||
if (Number(row.bookCount) == Number(val)) {
|
||||
row.state = "正常"
|
||||
row.profitandlossNumber = "0"
|
||||
row.profitandlossAmount = "0.00"
|
||||
}
|
||||
|
||||
// 盘盈
|
||||
if (Number(row.bookCount) < Number(val)) {
|
||||
row.state = "盘盈"
|
||||
row.profitandlossNumber = val - row.bookCount
|
||||
row.profitandlossAmount = ((val - row.bookCount) * row.taxPrice).toFixed(2)
|
||||
}
|
||||
|
||||
// 盘亏
|
||||
if (Number(row.bookCount) > Number(val)) {
|
||||
row.state = "盘亏"
|
||||
row.profitandlossNumber = val - row.bookCount
|
||||
row.profitandlossAmount = ((val - row.bookCount) * row.taxPrice).toFixed(2)
|
||||
}
|
||||
|
||||
},
|
||||
saveOrUpdate() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.save(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
settle() {
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.inven(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '操作成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
confirm() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.settlement(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '结算成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sid": "",
|
||||
"remarks": "",
|
||||
"createBySid": "",
|
||||
"createDate": "",
|
||||
"createUserSid": "",
|
||||
"createByName": "",
|
||||
"checkType": "",
|
||||
"checkState": "",
|
||||
"profitCount": "",
|
||||
"profitAmount": "",
|
||||
"lossCount": "",
|
||||
"lossAmount": "",
|
||||
"useOrgSid": "",
|
||||
"createOrgName": "",
|
||||
"createOrgSid": "",
|
||||
"wmsInventoryCheckbillDetailList": []
|
||||
}
|
||||
this.submitdisabled = false
|
||||
this.settleVisible = false
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</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);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user