23 changed files with 724 additions and 51 deletions
-
2canvas-container/assets/font_icon/iconfont.json
-
8src/api/commodity.js
-
19src/api/shopSys.js
-
48src/api/stockNote.js
-
4src/styles/elDialog.scss
-
2src/views/active/index.vue
-
2src/views/commodity/commodityList/commodityGroup.vue
-
8src/views/commodity/commoditySystem/addComponent.vue
-
2src/views/commodity/commoditySystem/index.vue
-
6src/views/customer/operate/index.vue
-
2src/views/distributor/achievement/humens.vue
-
4src/views/distributor/achievement/order.vue
-
2src/views/distributor/customer/popSearch.vue
-
2src/views/distributor/personnel/list.vue
-
2src/views/distributor/personnel/msg.vue
-
2src/views/distributor/personnel/sys.vue
-
17src/views/finance/list/index.vue
-
2src/views/login/index.vue
-
2src/views/marketing/channelCoupons/index.vue
-
42src/views/shop/material/index.vue
-
335src/views/stock/stocknote/Edit.vue
-
214src/views/stock/stocknote/index.vue
-
48src/views/system/shopSys/index.vue
@ -0,0 +1,48 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
//* ******************** 出入库记录 *********************
|
||||
|
// 出入库记录查询
|
||||
|
export function stocknoteGetAll(data) { |
||||
|
return request({ |
||||
|
url: '/stocknote/getAll', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 出入库记录详情
|
||||
|
export function stocknoteGetById(data) { |
||||
|
return request({ |
||||
|
url: '/stocknote/getById', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 添加出入库记录
|
||||
|
export function stocknoteAdd(data) { |
||||
|
return request({ |
||||
|
url: '/stocknote/save', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 修改出入库记录
|
||||
|
export function stocknoteUpdate(data) { |
||||
|
return request({ |
||||
|
url: '/stocknote/update', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除仓库
|
||||
|
export function stocknoteDelete(data) { |
||||
|
return request({ |
||||
|
url: '/stocknote/delete', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
@ -0,0 +1,335 @@ |
|||||
|
<template> |
||||
|
<el-dialog |
||||
|
:close-on-click-modal="false" |
||||
|
:title="title" |
||||
|
:type="type" |
||||
|
:visible.sync="isVisible" |
||||
|
:modal-append-to-body="false" |
||||
|
:center="true" |
||||
|
width="80%" |
||||
|
top="50px" |
||||
|
class="dialog-wrap" |
||||
|
> |
||||
|
<el-form ref="ruleForm" :model="params" label-width="150px"> |
||||
|
<el-form-item label="仓库"> |
||||
|
<el-select v-model="params.storehouseId" placeholder="请选择仓库" @change="changeStorehouseValue" clearable> |
||||
|
<el-option |
||||
|
v-for="(item,index) in storehouseList" |
||||
|
:key="index" |
||||
|
:label="item.storehouseName" |
||||
|
:value="item.storehouseId" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="商品"> |
||||
|
<el-select v-model="params.productId" placeholder="请选择商品" @change="changeProductValue" clearable> |
||||
|
<el-option |
||||
|
v-for="(item,index) in productList" |
||||
|
:key="index" |
||||
|
:label="item.productName" |
||||
|
:value="item.productId" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="SKU" v-if="isSkuVisible == 1"> |
||||
|
<el-select v-model="params.skuId" placeholder="请选择规格" clearable> |
||||
|
<el-option |
||||
|
v-for="(item,index) in skuList" |
||||
|
:key="index" |
||||
|
:label="item.skuName" |
||||
|
:value="item.skuId" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="单据类型"> |
||||
|
<el-radio-group v-model="params.billTypeId"> |
||||
|
<el-radio :disabled="isDisabled" :label="1">采购入库</el-radio> |
||||
|
<el-radio :disabled="isDisabled" :label="4">报废出库</el-radio> |
||||
|
</el-radio-group> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="数量"> |
||||
|
<div class="form-item-row"> |
||||
|
<div class="el-row" style="margin-bottom: 10px;"> |
||||
|
<el-input |
||||
|
v-model="params.quantity" |
||||
|
maxlength="20" |
||||
|
:readonly="isDisabled" |
||||
|
onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="价格"> |
||||
|
<div class="form-item-row"> |
||||
|
<div class="el-row" style="margin-bottom: 10px;"> |
||||
|
<el-input |
||||
|
v-model="params.price" |
||||
|
maxlength="20" |
||||
|
:readonly="isDisabled" |
||||
|
onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<!-- <el-table-column label="商品"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.productId" placeholder="请选择商品" clearable> |
||||
|
<el-option |
||||
|
v-for="(item,index) in productList" |
||||
|
:key="index" |
||||
|
:label="item.productName" |
||||
|
:value="item.productId" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column label="规格"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.skuId" placeholder="请选择规格" clearable> |
||||
|
<el-option |
||||
|
v-for="(item,index) in skuList" |
||||
|
:key="index" |
||||
|
:label="item.skuName" |
||||
|
:value="item.skuId" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
--> |
||||
|
|
||||
|
<div slot="footer" class="btn-wrap"> |
||||
|
<el-button type="primary" @click="onSubmit">确定</el-button> |
||||
|
<el-button @click="isVisible = false">取消</el-button> |
||||
|
</div> |
||||
|
|
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
|
||||
|
import { stocknoteGetById, stocknoteAdd, stocknoteUpdate } from '@/api/stockNote' |
||||
|
import { storehouseGetList } from '@/api/shopSys' |
||||
|
import { getClassifyGetList,getClassifyGetById } from '@/api/commodity' |
||||
|
|
||||
|
export default { |
||||
|
props: { |
||||
|
dialogVisible: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
type: { |
||||
|
type: String, |
||||
|
default: 'add' |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
params: { |
||||
|
storehouseId: 0, |
||||
|
storehouseName: '', |
||||
|
productId: 0, |
||||
|
productName: '', |
||||
|
skuId : 0, |
||||
|
skuName: '', |
||||
|
billTypeId: 0,//新增的都是采购入库单 |
||||
|
billTypeName: '', |
||||
|
originPrice: 0, |
||||
|
price: 0, |
||||
|
quantity: 0 |
||||
|
}, |
||||
|
storehouseList:[],//仓库列表 |
||||
|
productList:[],//商品列表 |
||||
|
skuList:[],//商品列表 |
||||
|
isSkuVisible : 1, |
||||
|
checkId: null |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
isVisible: { |
||||
|
get() { |
||||
|
return this.dialogVisible |
||||
|
}, |
||||
|
set() { |
||||
|
this.close() |
||||
|
this.reset() |
||||
|
} |
||||
|
}, |
||||
|
isDisabled() { |
||||
|
return this.type === 'check' |
||||
|
}, |
||||
|
title() { |
||||
|
const titleMap = { |
||||
|
add: '新建出入库单', |
||||
|
check: '查看出入库单', |
||||
|
edit: '修改出入库单' |
||||
|
} |
||||
|
return titleMap[this.type] |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.getStorehouseList(); |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取仓库 |
||||
|
async getStorehouseList() { |
||||
|
const res = await storehouseGetList({}) |
||||
|
this.storehouseList = res.data |
||||
|
if(this.storehouseList && this.storehouseList.length > 0){ |
||||
|
this.params.storehouseId = this.storehouseList[0].storehouseId |
||||
|
this.params.storehouseName = this.storehouseList[0].storehouseName |
||||
|
this.getProductList(); |
||||
|
} |
||||
|
}, |
||||
|
// 获取商品 |
||||
|
async getProductList() { |
||||
|
const res = await getClassifyGetList({ storehouseId: this.params.storehouseId}) |
||||
|
this.productList = res.data |
||||
|
if(this.productList && this.productList.length > 0){ |
||||
|
this.params.productId = this.productList[0].productId |
||||
|
this.params.productName = this.productList[0].productName |
||||
|
this.getSkuList(); |
||||
|
} |
||||
|
}, |
||||
|
async getSkuList() { |
||||
|
const res = await getClassifyGetById({ productId: this.params.productId}) |
||||
|
this.skuList = res.data.skus |
||||
|
if(this.skuList && this.skuList.length > 0){ |
||||
|
this.params.skuId = this.skuList[0].skuId |
||||
|
this.params.skuName = this.skuList[0].skuName |
||||
|
if(this.skuList[0].skuAttrCodeDTOList.length > 0){ |
||||
|
//多款式 |
||||
|
this.isSkuVisible = 1 |
||||
|
}else{ |
||||
|
this.isSkuVisible = 0 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
async changeStorehouseValue(){ |
||||
|
this.getProductList(); |
||||
|
}, |
||||
|
async changeProductValue(){ |
||||
|
this.getSkuList(); |
||||
|
}, |
||||
|
|
||||
|
close() { |
||||
|
this.$emit('close') |
||||
|
}, |
||||
|
async reset() { |
||||
|
console.log("reset") |
||||
|
this.params = { |
||||
|
storehouseId: 0, |
||||
|
storehouseName: '', |
||||
|
productId: 0, |
||||
|
productName: '', |
||||
|
skuId : 0, |
||||
|
skuName: '', |
||||
|
billTypeId: 0,//新增的都是采购入库单 |
||||
|
billTypeName: '', |
||||
|
originPrice: 0, |
||||
|
price: 0, |
||||
|
quantity: 0 |
||||
|
} |
||||
|
if(this.storehouseList && this.storehouseList.length > 0){ |
||||
|
this.params.storehouseId = this.storehouseList[0].storehouseId |
||||
|
this.getProductList(); |
||||
|
} |
||||
|
}, |
||||
|
// 查看详情 |
||||
|
async getDetails() { |
||||
|
const res = await stocknoteGetById({ stockNoteId: this.checkId }) |
||||
|
if (res.code === '') { |
||||
|
this.params = res.data |
||||
|
} |
||||
|
}, |
||||
|
async onSubmit() { |
||||
|
this.params.originPrice = this.params.price; |
||||
|
if (this.params.storehouseName === '') { |
||||
|
this.$message.error('请输入仓库名称') |
||||
|
} else if (this.type === 'add') { |
||||
|
this.add() |
||||
|
} else if (this.type === 'edit') { |
||||
|
this.update() |
||||
|
} else { |
||||
|
this.isVisible = false |
||||
|
} |
||||
|
}, |
||||
|
async add() { |
||||
|
const res = await stocknoteAdd(this.params) |
||||
|
if (res.code === '') { |
||||
|
this.isVisible = false |
||||
|
this.$message({ |
||||
|
message: '成功添加', |
||||
|
type: 'success' |
||||
|
}) |
||||
|
this.$emit('success') |
||||
|
} |
||||
|
}, |
||||
|
async update() { |
||||
|
const res = await stocknoteUpdate(this.params) |
||||
|
if (res.code === '') { |
||||
|
this.isVisible = false |
||||
|
this.$message({ |
||||
|
message: '成功', |
||||
|
type: 'success' |
||||
|
}); |
||||
|
this.$emit('success') |
||||
|
} |
||||
|
}, |
||||
|
setParams(val = {}) { |
||||
|
if (val['params']) { |
||||
|
this.params = val['params'] |
||||
|
} |
||||
|
if (val['checkId']) { |
||||
|
this.checkId = val['checkId'] |
||||
|
this.getDetails() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
.dialog-wrap { |
||||
|
::v-deep .el-dialog { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
max-height: 80vh; |
||||
|
max-width: 900px; |
||||
|
overflow: hidden; |
||||
|
|
||||
|
.el-dialog__body { |
||||
|
flex: 1; |
||||
|
overflow: auto; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dialog-from { |
||||
|
width: 90%; |
||||
|
margin: auto; |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
.btn-wrap { |
||||
|
margin: 45px auto 0; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.form-item-row { |
||||
|
// padding-top: 40px; |
||||
|
::v-deep .el-input { |
||||
|
width: 80px; |
||||
|
margin: 0 5px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</style> |
@ -0,0 +1,214 @@ |
|||||
|
<!-- --> |
||||
|
<template> |
||||
|
<div> |
||||
|
<div class="pending"> |
||||
|
<!-- 搜索 --> |
||||
|
<div class="formSearch"> |
||||
|
<el-form :inline="true" :model="formParams" class="demo-form-inline"> |
||||
|
<!-- <el-form-item label="仓库名称"> |
||||
|
<el-input v-model="formParams.logisticsName" placeholder="请输入仓库名称" /> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item> |
||||
|
<el-button type="success" plain @click="add">新增出入库单</el-button> |
||||
|
<!-- <el-button type="primary" plain @click="search">查询</el-button>--> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<!-- 表格 --> |
||||
|
<div class="tableBox"> |
||||
|
<el-table |
||||
|
ref="multipleTable" |
||||
|
:data="tableData" |
||||
|
border |
||||
|
:header-cell-style="{ background: '#EEF3FF', color: '#333333' }" |
||||
|
tooltip-effect="dark" |
||||
|
style="width: 100%" |
||||
|
> |
||||
|
<el-table-column label="仓库名称" width="200"> |
||||
|
<template slot-scope="scope">{{ scope.row.storehouseName }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="商品名称" width="200"> |
||||
|
<template slot-scope="scope">{{ scope.row.productName }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="SKU" width="200"> |
||||
|
<template slot-scope="scope">{{ scope.row.skuName }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="单据类型" width="100"> |
||||
|
<template slot-scope="scope">{{ scope.row.billTypeName }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="出入库数量" width="100"> |
||||
|
<template slot-scope="scope">{{ scope.row.quantity }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="成本单价" width="100"> |
||||
|
<template slot-scope="scope">{{ scope.row.originPrice }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="出入库单价" width="100"> |
||||
|
<template slot-scope="scope">{{ scope.row.price }}</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" show-overflow-tooltip> |
||||
|
<template slot-scope="scope"> |
||||
|
<div class="btnList"> |
||||
|
<el-button type="text" :visible="false" @click="seeMore(scope.row)">查看</el-button> |
||||
|
<el-button type="text" :visible="false" @click="edit(scope.row)">编辑</el-button> |
||||
|
<el-button type="text" @click="del(scope.row)">删除</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="fenye"> |
||||
|
<el-pagination |
||||
|
:current-page="currentPage" |
||||
|
:page-sizes="[10, 20, 50, 100]" |
||||
|
:page-size="10" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
:total="total" |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 方案组件 --> |
||||
|
<stock-note-edit |
||||
|
ref="edit" |
||||
|
:dialog-visible="dialog.isVisible" |
||||
|
:type="dialog.type" |
||||
|
@close="editClose" |
||||
|
@success="getLists" |
||||
|
/> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { stocknoteGetAll, stocknoteDelete } from '@/api/stockNote' |
||||
|
import StockNoteEdit from './Edit' |
||||
|
export default { |
||||
|
components: { |
||||
|
StockNoteEdit |
||||
|
}, |
||||
|
data() { |
||||
|
// 这里存放数据 |
||||
|
return { |
||||
|
formParams: { |
||||
|
storehouseName: '', |
||||
|
page: 1, |
||||
|
pageSize: 10 |
||||
|
}, |
||||
|
total: 1, |
||||
|
tableData: [], |
||||
|
currentPage: 1, |
||||
|
dialog: { |
||||
|
type: 'add', |
||||
|
isVisible: false |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 监听属性 类似于data概念 |
||||
|
computed: {}, |
||||
|
// 监控data中的数据变化 |
||||
|
watch: {}, |
||||
|
// 生命周期 - 创建完成(可以访问当前this实例) |
||||
|
created() {}, |
||||
|
// 生命周期 - 挂载完成(可以访问DOM元素) |
||||
|
mounted() { |
||||
|
this.getList(this.formParams) |
||||
|
}, |
||||
|
// 方法集合 |
||||
|
methods: { |
||||
|
btnClick(id) { |
||||
|
console.log(id) |
||||
|
if (id.permissionName === '新增') { |
||||
|
this.add() |
||||
|
} |
||||
|
}, |
||||
|
handleSizeChange(val) { |
||||
|
this.formParams.pageSize = val |
||||
|
this.getList(this.formParams) |
||||
|
}, |
||||
|
handleCurrentChange(val) { |
||||
|
this.formParams.page = val |
||||
|
this.getList(this.formParams) |
||||
|
}, |
||||
|
getLists() { |
||||
|
this.getList(this.formParams) |
||||
|
}, |
||||
|
// 查询 |
||||
|
search() { |
||||
|
this.total = 1 |
||||
|
this.formParams.page = 1 |
||||
|
this.getList(this.formParams) |
||||
|
}, |
||||
|
// 新建方案 |
||||
|
add() { |
||||
|
this.dialog = { |
||||
|
type: 'add', |
||||
|
isVisible: true |
||||
|
} |
||||
|
}, |
||||
|
// 查看 |
||||
|
seeMore(row) { |
||||
|
const { storehouseId } = row |
||||
|
this.dialog = { |
||||
|
type: 'check', |
||||
|
isVisible: true |
||||
|
} |
||||
|
this.$refs.edit.setParams({ |
||||
|
checkId: storehouseId |
||||
|
}) |
||||
|
}, |
||||
|
// 编辑 |
||||
|
edit(row) { |
||||
|
const { storehouseId } = row |
||||
|
this.dialog = { |
||||
|
type: 'edit', |
||||
|
isVisible: true |
||||
|
} |
||||
|
this.$refs.edit.setParams({ |
||||
|
checkId: storehouseId |
||||
|
}) |
||||
|
}, |
||||
|
// 关闭弹框 |
||||
|
editClose() { |
||||
|
this.dialog.isVisible = false |
||||
|
}, |
||||
|
// 删除 |
||||
|
del(row) { |
||||
|
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}) |
||||
|
.then(() => { |
||||
|
stocknoteDelete({ stockNoteId: row.stockNoteId }).then(res => { |
||||
|
if (res.code === '') { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '删除成功!' |
||||
|
}) |
||||
|
} |
||||
|
this.getList(this.formParams) |
||||
|
}) |
||||
|
}) |
||||
|
.catch(() => {}) |
||||
|
}, |
||||
|
// 初始化查询所有数据 |
||||
|
async getList(formParams) { |
||||
|
const res = await stocknoteGetAll(formParams) |
||||
|
this.tableData = res.data.list |
||||
|
this.total = res.data.total |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang='scss' scoped> |
||||
|
//@import url(); 引入公共css类 |
||||
|
@import url("../../../styles/elDialog.scss"); |
||||
|
.pending { |
||||
|
padding: 30px; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 10px; |
||||
|
} |
||||
|
.fenye { |
||||
|
margin-top: 20px; |
||||
|
} |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue