This commit is contained in:
魏啾 2024-11-28 14:28:00 +08:00
commit d101cd763b
7 changed files with 123 additions and 48 deletions

View File

@ -81,7 +81,8 @@ export default {
stocktakinNum: '', //
price: '', //
remark: "", //
stockNumber: 0
stockNumber: 0,
balance: ''
},
rules: {
stocktakinNum: [
@ -155,6 +156,7 @@ export default {
})
},
async show(obj) {
console.log(obj, 111)
let res = await hasPermission('允许耗材盘点');
if (!res) { return; }
this.form.remark = ''
@ -165,8 +167,9 @@ export default {
this.form = Object.assign(this.form, obj)
this.dialogVisible = true
this.form.conInfoId = obj.consId
this.form.stockNumber = obj.stockNumber
this.form.balance = obj.stockNumber
this.form.stockNumber = obj.balance < 0 ? 0 : obj.balance
// this.form.balance = obj.stockNumber
this.form.balance = obj.balance
this.form.price == null ? 0 : this.form.price
this.searhForm.productId = obj.id
this.getTableData()
@ -186,7 +189,7 @@ export default {
try {
this.tableData.loading = true
const res = await tbConCheckGet({
page: this.tableData.page,
size: this.tableData.size,
conInfoId: this.searhForm.productId,

View File

@ -123,13 +123,14 @@
<div class="tips" style="font-size: 16px;">原价
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice)
: scope.row.unit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice}}
/
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit == scope.row.conUnitTwo ?
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) :
scope.row.costPrice : scope.row.costPrice)
: scope.row.unit == scope.row.conUnitTwo ?
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) : scope.row.costPrice }}
/
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
@ -154,13 +155,13 @@
controls-position="right"
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
<div class="tips" style="font-size: 16px;">入库前
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number)
: scope.row.unit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}}
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit == scope.row.conUnitTwo ?
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number : scope.row.number)
: scope.row.unit == scope.row.conUnitTwo ?
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number }}
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
</div>
@ -343,6 +344,17 @@ export default {
mounted() {
this.resetForm = { ...this.queryForm }
this.tbShopPurveyorGet()
console.log(this.$route.query.consdata)
if (this.$route.query.consdata) {
let arr = this.$route.query.consdata.map(item => {
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
item.stockNumber = 0
item.costPrice = item.price
item.conInfoId = item.id
return item
})
this.tableData.list = [...this.tableData.list, ...arr]
}
},
methods: {
async querySearchAsync(queryString, cb) {//
@ -556,6 +568,7 @@ export default {
},
//
selectConsumable(res) {
console.log(res)
let arr = res.map(item => {
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
item.stockNumber = 0

View File

@ -126,8 +126,8 @@
<el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button>
<el-button type="text" size="mini"
@click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button>
<el-button type="text" size="mini" @click="stockData.size = 10,
stockData.page = 0, gettbConsInfoFlowstock(scope.row)">出入库记录</el-button>
<el-button type="text" size="mini" @click="stockData.size = 10,
stockData.page = 0, gettbConsInfoFlowstock(scope.row)">货单记录</el-button>
</template>
</el-table-column>
</el-table>
@ -175,10 +175,10 @@
</el-table>
</el-dialog>
<!--入库记录 -->
<el-dialog title="出入库记录" :visible.sync="variabilityshow" width="75%">
<el-dialog title="货单记录" :visible.sync="variabilityshow" width="75%">
<div class="head-container">
<el-table ref="table" :data="stockData.data" v-loading="stockData.loading" row-key="id" height="450">
<el-table-column label="类型" prop="type">
<!-- <el-table-column label="类型" prop="type">
<template v-slot="scope">
{{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }}
</template>
@ -194,16 +194,23 @@
<template v-slot="scope">
{{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="耗材" prop="name" />
<el-table-column label="单价" prop="price" />
<el-table-column label="数量" prop="stockNumber" />
<el-table-column label="单位" prop="unit" />
</el-table>
</div>
<div class="head-container">
<el-pagination :total="stockData.total" :current-page="stockData.page + 1" :page-size="stockData.size"
<div class="head-container" style="display: flex; justify-content: space-between; align-items: center;">
<!-- <el-pagination :total="stockData.total" :current-page="stockData.page + 1" :page-size="stockData.size"
layout="total, sizes, prev, pager, next, jumper" @current-change="wstockChange" @size-change="(e) => {
stockData.size = e;
stockData.page = 0;
gettbConsInfoFlowstock();
}" />
}" /> -->
<div></div>
<div style="color: #43a9fe;" @click="func()">转出库单</div>
</div>
</el-dialog>
</div>
@ -315,6 +322,7 @@ export default {
total: 0,
id: ''
},
consdata: []//
}
},
filters: {
@ -463,29 +471,40 @@ export default {
this.stockData.page = e - 1;
this.gettbConsInfoFlowstock();
},
func() {
this.$router.push({
name: 'operation_in',
query: {
consdata: this.consdata
}
})
},
async gettbConsInfoFlowstock(item) {
console.log(item)
if (item) {
this.stockData.id = item.id
this.consdata = item.cons
this.stockData.data = item.conFlows
}
this.variabilityshow = true
this.stockData.loading = true;
// this.stockData.loading = true;
let arr = []
// if (this.query.createdAt.length) {
// arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
// } else {
// arr = []
// }
let res = await tbProductStockOperatepage({
page: this.stockData.page,
size: this.stockData.size,
shopId: localStorage.getItem("shopId"),
type: ["cons_in", "cons_out"],//id
purveyorId: this.stockData.id,//
createdAt: arr//id
})
this.stockData.loading = false;
this.stockData.data = res.content;
this.stockData.total = res.totalElements;
// let res = await tbProductStockOperatepage({
// page: this.stockData.page,
// size: this.stockData.size,
// shopId: localStorage.getItem("shopId"),
// type: ["cons_in", "cons_out"],//id
// purveyorId: this.stockData.id,//
// createdAt: arr//id
// })
// this.stockData.loading = false;
// this.stockData.data = res.content;
// this.stockData.total = res.totalElements;
},
}
}

View File

@ -31,7 +31,7 @@
</template>
</el-table-column>
<el-table-column prop="username" label="用户名" />
<el-table-column prop="requestIp" label="IP" />
<!-- <el-table-column prop="requestIp" label="IP" /> -->
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源" />
<el-table-column prop="description" label="描述" />
<el-table-column prop="browser" label="浏览器" />

View File

@ -57,9 +57,9 @@
</el-form>
</div>
<div class="head-container">
<!-- <div class="head-container">
<div class="collect_wrap">
<!-- <div class="item">
<div class="item">
<div class="icon_wrap" style="--bg-color:#C978EE">
<i class="icon el-icon-s-goods"></i>
</div>
@ -68,7 +68,7 @@
<div class="t">总金额</div>
</div>
</div> -->
<!-- <div class="item" v-for="item in payCountList" :key="item.payType">
<!-- <div class="item" v-for="item in payCountList" :key="item.payType">
<div class="icon_wrap" style="--bg-color:#fff">
<el-image class="img" :src="item.icon"></el-image>
</div>
@ -76,9 +76,9 @@
<div class="m">{{ item.payAmount || 0 }}</div>
<div class="t">{{ item.payType }}</div>
</div>
</div> -->
</div>
</div>
</div>
</div>-->
<div class="head-container">
<el-table :data="tableData.data" v-loading="tableData.loading">
<el-table-column label="订单号信息">

View File

@ -192,7 +192,18 @@ export default {
},
//
selectConfirmGoods(res) {
this.$set(this.form.list, this.activeItem, { ...res[0] })
// this.form.list = res
const flag = this.form.list.filter(item => item.id == res[0].id)
if (flag.length) {
this.$notify({
title: '注意',
message: '请勿重复添加',
type: 'error'
})
} else {
this.$set(this.form.list, this.activeItem, { ...res[0] })
}
},
// tab
tabChange() {

View File

@ -7,8 +7,12 @@
</el-input>
</div>
<div class="tree_wrap">
<el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all
@node-click="treeItemClick"></el-tree>
<!-- <el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all
@node-click="treeItemClick"></el-tree> -->
<div class="item" :class="{ active: selectCatoryIndex == index }" v-for="(item, index) in treeData"
:key="item.id" @click="treeItemClick(item, index)">
{{ item.name }}
</div>
</div>
</div>
<div class="table_wrap">
@ -62,6 +66,7 @@ export default {
query: {
name: ''
},
selectCatoryIndex: 0,
selectCatory: '',
treeDataOrgin: [],
treeData: [],
@ -88,6 +93,12 @@ export default {
this.treeData = this.treeDataOrgin.filter(item => {
return item.name.includes(this.query.name)
})
if (this.treeData.length) {
this.selectCatoryIndex = 0
this.selectCatory = this.treeData[this.selectCatoryIndex]
this.getTableData()
}
},
//
tableDrag() {
@ -147,7 +158,8 @@ export default {
}
},
//
treeItemClick(data) {
treeItemClick(data, index) {
this.selectCatoryIndex = index
this.selectCatory = data
this.tableData.page = 1
this.getTableData()
@ -164,6 +176,7 @@ export default {
})
this.treeDataOrgin = res.content
this.treeData = res.content
this.selectCatory = res.content[this.selectCatoryIndex]
this.getTableData()
} catch (error) {
console.log(error)
@ -235,6 +248,22 @@ export default {
width: 100%;
height: calc(100% - 70px);
overflow-y: auto;
.item {
padding: 10px 15px;
font-size: 14px;
display: flex;
align-items: center;
&:hover {
cursor: pointer;
}
&.active {
background-color: #1890ff;
color: #fff;
}
}
}
}