Merge branch 'gyq' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into dwb
This commit is contained in:
commit
010db705ac
|
|
@ -45,6 +45,7 @@
|
||||||
"path-to-regexp": "2.4.0",
|
"path-to-regexp": "2.4.0",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"qs": "^6.10.1",
|
"qs": "^6.10.1",
|
||||||
|
"reconnecting-websocket": "^4.4.0",
|
||||||
"screenfull": "4.2.0",
|
"screenfull": "4.2.0",
|
||||||
"sortablejs": "^1.15.2",
|
"sortablejs": "^1.15.2",
|
||||||
"vue": "^2.6.14",
|
"vue": "^2.6.14",
|
||||||
|
|
|
||||||
|
|
@ -300,3 +300,33 @@ export function tbShopPurveyorTransacttransactPayInfos(params) {
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询耗材信息
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function tbConsInfoGet(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/tbConsInfo`,
|
||||||
|
method: "get",
|
||||||
|
params: {
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材出入库
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function stockInOut(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/tbConsInfo/stockInOut`,
|
||||||
|
method: "post",
|
||||||
|
data: {
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<template>
|
||||||
|
<div>点歌</div>
|
||||||
|
</template>
|
||||||
|
|
@ -0,0 +1,134 @@
|
||||||
|
<!-- 耗材列表 -->
|
||||||
|
<template>
|
||||||
|
<el-dialog title="选择耗材" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||||
|
<el-form :model="searchForm" inline>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="searchForm.conTypeName" placeholder="耗材类型名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="searchForm.conCode" placeholder="耗材代码"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="searchForm.conName" placeholder="耗材名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
|
<el-button @click="resetHandle">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading">
|
||||||
|
<el-table-column label="耗材名称" prop="conName"></el-table-column>
|
||||||
|
<el-table-column label="价格" prop="price"></el-table-column>
|
||||||
|
<el-table-column label="耗材代码" prop="conCode"></el-table-column>
|
||||||
|
<el-table-column label="耗材类型名称" prop="conTypeName"></el-table-column>
|
||||||
|
<el-table-column label="单位" prop="conUnit"></el-table-column>
|
||||||
|
<el-table-column label="最近入库量" prop="lasterInStock"></el-table-column>
|
||||||
|
<el-table-column label="库存数量" prop="stockNumber"></el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="confirmHandle(scope.row)">选择</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||||
|
@current-change="paginationChange" @size-change="sizeChange"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { tbConsInfoGet } from "@/api/invoicing";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
searchForm: {
|
||||||
|
conTypeId: '',
|
||||||
|
conTypeName: '',
|
||||||
|
conCode: '',
|
||||||
|
conName: ''
|
||||||
|
},
|
||||||
|
resetSearchForm: '',
|
||||||
|
tableData: {
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
list: []
|
||||||
|
},
|
||||||
|
goods: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.resetSearchForm = { ...this.searchForm }
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 确定选商品
|
||||||
|
confirmHandle(row) {
|
||||||
|
this.$emit('success', row)
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
// 重置查询
|
||||||
|
resetHandle() {
|
||||||
|
this.searchForm = { ...this.resetSearchForm }
|
||||||
|
this.tableData.page = 0
|
||||||
|
this.tableData.size = 10
|
||||||
|
this.tableData.list = []
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
// 分页大小改变
|
||||||
|
sizeChange(e) {
|
||||||
|
this.tableData.size = e
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
// 分页回调
|
||||||
|
paginationChange(e) {
|
||||||
|
this.tableData.page = e - 1
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
// 耗材列表
|
||||||
|
async getTableData() {
|
||||||
|
this.tableData.loading = true
|
||||||
|
try {
|
||||||
|
const res = await tbConsInfoGet({
|
||||||
|
page: this.tableData.page,
|
||||||
|
size: this.tableData.size,
|
||||||
|
...this.searchForm
|
||||||
|
})
|
||||||
|
this.tableData.list = res.content
|
||||||
|
this.tableData.total = res.totalElements
|
||||||
|
|
||||||
|
if (this.goods.length) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.selection()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.tableData.loading = false
|
||||||
|
}, 500);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
show(goods) {
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.dialogVisible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.shop_info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -65,10 +65,10 @@
|
||||||
<el-button type="text" @click="clicksee(scope.row)">查看</el-button>
|
<el-button type="text" @click="clicksee(scope.row)">查看</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||||
<el-button type="text" @click="clickdialogfadd(scope.row)">入库</el-button>
|
<el-button type="text" @click="clickdialogfadd(scope.row)">编辑</el-button>
|
||||||
<!-- <el-button type="text" icon="el-icon-edit" @click="clickdialogframe('edit', scope.row)">编辑</el-button> -->
|
<!-- <el-button type="text" icon="el-icon-edit" @click="clickdialogframe('edit', scope.row)">编辑</el-button> -->
|
||||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||||
|
|
@ -159,25 +159,28 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog title="耗材信息" :visible.sync="clickseetypedialogshow">
|
<el-dialog title="耗材信息" :visible.sync="clickseetypedialogshow">
|
||||||
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id">
|
<div class="head-container">
|
||||||
<el-table-column label="消耗金额" prop="amount" />
|
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id"
|
||||||
<el-table-column label="剩余额" prop="balance" />
|
height="450">
|
||||||
<el-table-column label="业务编码" prop="bizCode" />
|
<el-table-column label="变动库存" prop="amount">
|
||||||
<el-table-column label="业务说明" prop="bizName" />
|
<template v-slot="scope">
|
||||||
<el-table-column label="正负号标识" prop="bizType" />
|
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount }}</span>
|
||||||
<el-table-column label="耗材名称" prop="conName" />
|
</template>
|
||||||
<el-table-column label="耗材id" prop="consId" />
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" prop="createTime">
|
<el-table-column label="现有库存" prop="balance" />
|
||||||
|
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
|
||||||
|
<el-table-column label="业务说明" prop="bizName" />
|
||||||
|
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
||||||
|
<el-table-column label="耗材名称" prop="conName" />
|
||||||
|
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
||||||
|
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||||
|
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="更新时间" prop="updateTime">
|
</el-table>
|
||||||
<template v-slot="scope">
|
</div>
|
||||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
||||||
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
|
@ -523,4 +526,8 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
color: rgb(219, 32, 32);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -2,7 +2,18 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
||||||
<el-form-item label="出库类型">
|
<el-form-item label="入库内容">
|
||||||
|
<div class="shop_type_box">
|
||||||
|
<div class="item" v-for="item in inTabs" :key="item.value"
|
||||||
|
:class="{ active: inTabValue == item.value }" @click="inTabValue = item.value">
|
||||||
|
<div class="s_title">{{ item.label }}</div>
|
||||||
|
<div class="active_dot">
|
||||||
|
<i class="el-icon-check"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="入库类型">
|
||||||
<div class="shop_type_box">
|
<div class="shop_type_box">
|
||||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||||
|
|
@ -38,7 +49,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="实收金额">
|
<el-form-item label="实付金额">
|
||||||
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额"
|
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额"
|
||||||
style="width: 220px;"></el-input>
|
style="width: 220px;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -67,17 +78,61 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)">选择商品</el-button>
|
<el-button type="primary" @click="$refs.ConsumableList.show()"
|
||||||
|
v-if="inTabValue == 'consumable'">选择耗材</el-button>
|
||||||
|
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-button type="primary" plain>
|
<el-button type="primary" plain v-if="inTabValue == 'consumable'">
|
||||||
|
共{{ tableData.list.length }}种耗材,金额合计<span style="color: red;">¥{{ queryForm.totalAmount }}</span>
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" plain v-else>
|
||||||
共{{ tableData.list.length }}种商品,金额合计<span style="color: red;">¥{{ queryForm.totalAmount }}</span>
|
共{{ tableData.list.length }}种商品,金额合计<span style="color: red;">¥{{ queryForm.totalAmount }}</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-table :data="tableData.list">
|
<el-table :data="tableData.list" v-if="inTabValue == 'consumable'">
|
||||||
|
<el-table-column label="耗材名称" prop="conName">
|
||||||
|
<template v-slot="scope">
|
||||||
|
{{ scope.row.conName }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="进价">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||||
|
@change="e => { queryForm.totalAmount = formatDecimal(e * scope.row.stockNumber) }"></el-input-number>
|
||||||
|
<div class="tips">原价¥{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="数量">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
|
||||||
|
@change="e => { queryForm.totalAmount = formatDecimal(e * scope.row.price) }"></el-input-number>
|
||||||
|
<div class="tips">入库前:{{ scope.row.number }}{{ scope.row.conUnit }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="小计">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||||
|
controls-position="right"></el-input-number> -->
|
||||||
|
<el-input :value="formatDecimal(scope.row.price * scope.row.stockNumber)" readonly
|
||||||
|
style="width: 100px;" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="变动后剩余库存">
|
||||||
|
<template v-slot="scope">
|
||||||
|
{{ scope.row.stockNumber + scope.row.number }}{{ scope.row.conUnit }}
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="操作" width="80">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button type="text" @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-table :data="tableData.list" v-else>
|
||||||
<el-table-column type="index" width="50"></el-table-column>
|
<el-table-column type="index" width="50"></el-table-column>
|
||||||
<el-table-column label="商品名称" prop="name">
|
<el-table-column label="商品名称" prop="name">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
@ -123,7 +178,10 @@
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 选择商品 -->
|
||||||
<shopList ref="shopList" @success="selectShop" />
|
<shopList ref="shopList" @success="selectShop" />
|
||||||
|
<!-- 选择耗材 -->
|
||||||
|
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||||
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
||||||
:close-on-click-modal="false">
|
:close-on-click-modal="false">
|
||||||
<el-result icon="success" title="入库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
<el-result icon="success" title="入库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
||||||
|
|
@ -141,13 +199,28 @@
|
||||||
<script>
|
<script>
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import shopList from './components/shopList'
|
import shopList from './components/shopList'
|
||||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn } from '@/api/invoicing'
|
import ConsumableList from './components/consumableList'
|
||||||
|
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
|
||||||
|
import { formatDecimal } from '@/utils'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
shopList
|
shopList,
|
||||||
|
ConsumableList
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
formatDecimal,
|
||||||
|
inTabValue: 'goods',
|
||||||
|
inTabs: [
|
||||||
|
{
|
||||||
|
label: '商品入库',
|
||||||
|
value: 'goods'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '耗材入库',
|
||||||
|
value: 'consumable'
|
||||||
|
}
|
||||||
|
],
|
||||||
shopTypesActive: 0,
|
shopTypesActive: 0,
|
||||||
shopTypes: [
|
shopTypes: [
|
||||||
{
|
{
|
||||||
|
|
@ -207,7 +280,7 @@ export default {
|
||||||
this.tableData.list.forEach(ele => {
|
this.tableData.list.forEach(ele => {
|
||||||
zong += ele.costPrice * ele.number
|
zong += ele.costPrice * ele.number
|
||||||
})
|
})
|
||||||
this.queryForm.totalAmount = parseFloat(zong.toFixed(2))
|
this.queryForm.totalAmount = parseFloat(zong.toFixed(2))
|
||||||
},
|
},
|
||||||
// 提交
|
// 提交
|
||||||
submitHandle() {
|
submitHandle() {
|
||||||
|
|
@ -215,8 +288,27 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
this.queryFormLoading = true
|
this.queryFormLoading = true
|
||||||
this.queryForm.list = this.tableData.list
|
switch (this.inTabValue) {
|
||||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
case 'goods':
|
||||||
|
this.queryForm.list = this.tableData.list
|
||||||
|
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||||
|
break;
|
||||||
|
case 'consumable':
|
||||||
|
const con = { ...this.tableData.list[0] }
|
||||||
|
await stockInOut({
|
||||||
|
accountsPayable: this.queryForm.totalAmount,
|
||||||
|
actualPayment: this.queryForm.paidAmount,
|
||||||
|
conInfoId: con.id,
|
||||||
|
paymentTime: this.queryForm.paidAt,
|
||||||
|
price: con.price,
|
||||||
|
stockNumber: con.stockNumber,
|
||||||
|
supplierId: this.queryForm.purveyorId,
|
||||||
|
type: 'in'
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
this.queryFormLoading = false
|
this.queryFormLoading = false
|
||||||
this.showResult = true
|
this.showResult = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -226,6 +318,14 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 选择耗材
|
||||||
|
selectConsumable(res) {
|
||||||
|
const n_res = { ...res }
|
||||||
|
res.costPrice = n_res.price
|
||||||
|
res.number = n_res.stockNumber
|
||||||
|
this.tableData.list = [res]
|
||||||
|
this.queryForm.totalAmount = formatDecimal(res.price * res.stockNumber)
|
||||||
|
},
|
||||||
// 选择商品
|
// 选择商品
|
||||||
selectShop(res) {
|
selectShop(res) {
|
||||||
let arr = []
|
let arr = []
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,17 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
||||||
|
<el-form-item label="出库内容">
|
||||||
|
<div class="shop_type_box">
|
||||||
|
<div class="item" v-for="item in inTabs" :key="item.value"
|
||||||
|
:class="{ active: inTabValue == item.value }" @click="inTabValue = item.value">
|
||||||
|
<div class="s_title">{{ item.label }}</div>
|
||||||
|
<div class="active_dot">
|
||||||
|
<i class="el-icon-check"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="出库类型">
|
<el-form-item label="出库类型">
|
||||||
<div class="shop_type_box">
|
<div class="shop_type_box">
|
||||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||||
|
|
@ -67,7 +78,9 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)">选择商品</el-button>
|
<el-button type="primary" @click="$refs.ConsumableList.show()"
|
||||||
|
v-if="inTabValue == 'consumable'">选择耗材</el-button>
|
||||||
|
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -77,7 +90,47 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-table :data="tableData.list">
|
|
||||||
|
<el-table :data="tableData.list" v-if="inTabValue == 'consumable'">
|
||||||
|
<el-table-column label="耗材名称" prop="conName">
|
||||||
|
<template v-slot="scope">
|
||||||
|
{{ scope.row.conName }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="进价">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||||
|
@change="e => { queryForm.totalAmount = formatDecimal(e * scope.row.stockNumber) }"></el-input-number>
|
||||||
|
<div class="tips">原价¥{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="数量">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
|
||||||
|
@change="e => { queryForm.totalAmount = formatDecimal(e * scope.row.price) }"></el-input-number>
|
||||||
|
<div class="tips">出库前:{{ scope.row.number }}{{ scope.row.conUnit }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="小计">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||||
|
controls-position="right"></el-input-number> -->
|
||||||
|
<el-input :value="formatDecimal(scope.row.price * scope.row.stockNumber)" readonly
|
||||||
|
style="width: 100px;" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="变动后剩余库存">
|
||||||
|
<template v-slot="scope">
|
||||||
|
{{ scope.row.stockNumber - scope.row.number }}{{ scope.row.conUnit }}
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="操作" width="80">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button type="text" @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-table :data="tableData.list" v-else>
|
||||||
<el-table-column type="index" width="50"></el-table-column>
|
<el-table-column type="index" width="50"></el-table-column>
|
||||||
<el-table-column label="商品名称" prop="name">
|
<el-table-column label="商品名称" prop="name">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
@ -90,14 +143,14 @@
|
||||||
<el-table-column label="进价">
|
<el-table-column label="进价">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
|
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
|
||||||
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
|
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
|
||||||
<div class="tips">成本价¥{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
|
<div class="tips">成本价¥{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="数量">
|
<el-table-column label="数量">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
||||||
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
|
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
|
||||||
<div class="tips">出库前:{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
|
<div class="tips">出库前:{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -123,7 +176,10 @@
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 选择商品 -->
|
||||||
<shopList ref="shopList" @success="selectShop" />
|
<shopList ref="shopList" @success="selectShop" />
|
||||||
|
<!-- 选择耗材 -->
|
||||||
|
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||||
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
||||||
:close-on-click-modal="false">
|
:close-on-click-modal="false">
|
||||||
<el-result icon="success" title="出库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
<el-result icon="success" title="出库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
||||||
|
|
@ -141,13 +197,28 @@
|
||||||
<script>
|
<script>
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import shopList from './components/shopList'
|
import shopList from './components/shopList'
|
||||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn } from '@/api/invoicing'
|
import ConsumableList from './components/consumableList'
|
||||||
|
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
|
||||||
|
import { formatDecimal } from '@/utils'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
shopList
|
shopList,
|
||||||
|
ConsumableList
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
formatDecimal,
|
||||||
|
inTabValue: 'goods',
|
||||||
|
inTabs: [
|
||||||
|
{
|
||||||
|
label: '商品出库',
|
||||||
|
value: 'goods'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '耗材出库',
|
||||||
|
value: 'consumable'
|
||||||
|
}
|
||||||
|
],
|
||||||
shopTypesActive: 0,
|
shopTypesActive: 0,
|
||||||
shopTypes: [
|
shopTypes: [
|
||||||
{
|
{
|
||||||
|
|
@ -215,8 +286,27 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
this.queryFormLoading = true
|
this.queryFormLoading = true
|
||||||
this.queryForm.list = this.tableData.list
|
switch (this.inTabValue) {
|
||||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
case 'goods':
|
||||||
|
this.queryForm.list = this.tableData.list
|
||||||
|
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||||
|
break;
|
||||||
|
case 'consumable':
|
||||||
|
const con = { ...this.tableData.list[0] }
|
||||||
|
await stockInOut({
|
||||||
|
accountsPayable: this.queryForm.totalAmount,
|
||||||
|
actualPayment: this.queryForm.paidAmount,
|
||||||
|
conInfoId: con.id,
|
||||||
|
paymentTime: this.queryForm.paidAt,
|
||||||
|
price: con.price,
|
||||||
|
stockNumber: con.stockNumber,
|
||||||
|
supplierId: this.queryForm.purveyorId,
|
||||||
|
type: 'out'
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
this.queryFormLoading = false
|
this.queryFormLoading = false
|
||||||
this.showResult = true
|
this.showResult = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -226,6 +316,14 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 选择耗材
|
||||||
|
selectConsumable(res) {
|
||||||
|
const n_res = { ...res }
|
||||||
|
res.costPrice = n_res.price
|
||||||
|
res.number = n_res.stockNumber
|
||||||
|
this.tableData.list = [res]
|
||||||
|
this.queryForm.totalAmount = formatDecimal(res.price * res.stockNumber)
|
||||||
|
},
|
||||||
// 选择商品
|
// 选择商品
|
||||||
selectShop(res) {
|
selectShop(res) {
|
||||||
let arr = []
|
let arr = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue