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

View File

@ -123,13 +123,14 @@
<div class="tips" style="font-size: 16px;">原价 <div class="tips" style="font-size: 16px;">原价
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} --> <!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
{{ !scope.row.unit ? {{ !scope.row.unit ?
(scope.row.defaultUnit ? (scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo? scope.row.defaultUnit == scope.row.conUnitTwo ?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice) ((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) :
: scope.row.unit== scope.row.conUnitTwo? scope.row.costPrice : scope.row.costPrice)
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): 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.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }} scope.row.conUnit) : scope.row.unit }}
@ -154,13 +155,13 @@
controls-position="right" controls-position="right"
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number> @change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
<div class="tips" style="font-size: 16px;">入库前 <div class="tips" style="font-size: 16px;">入库前
{{ !scope.row.unit ? {{ !scope.row.unit ?
(scope.row.defaultUnit ? (scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo? scope.row.defaultUnit == scope.row.conUnitTwo ?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number) (scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number : scope.row.number)
: scope.row.unit== scope.row.conUnitTwo? : scope.row.unit == scope.row.conUnitTwo ?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}} (scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number }}
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit : {{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }} scope.row.conUnit) : scope.row.unit }}
</div> </div>
@ -343,6 +344,17 @@ export default {
mounted() { mounted() {
this.resetForm = { ...this.queryForm } this.resetForm = { ...this.queryForm }
this.tbShopPurveyorGet() 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: { methods: {
async querySearchAsync(queryString, cb) {// async querySearchAsync(queryString, cb) {//
@ -556,6 +568,7 @@ export default {
}, },
// //
selectConsumable(res) { selectConsumable(res) {
console.log(res)
let arr = res.map(item => { let arr = res.map(item => {
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true) item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
item.stockNumber = 0 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" round @click="Uppop(scope.row.id)">付款</el-button>
<el-button type="text" size="mini" <el-button type="text" size="mini"
@click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button> @click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button>
<el-button type="text" size="mini" @click="stockData.size = 10, <el-button type="text" size="mini" @click="stockData.size = 10,
stockData.page = 0, gettbConsInfoFlowstock(scope.row)">出入库记录</el-button> stockData.page = 0, gettbConsInfoFlowstock(scope.row)">货单记录</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -175,10 +175,10 @@
</el-table> </el-table>
</el-dialog> </el-dialog>
<!--入库记录 --> <!--入库记录 -->
<el-dialog title="出入库记录" :visible.sync="variabilityshow" width="75%"> <el-dialog title="货单记录" :visible.sync="variabilityshow" width="75%">
<div class="head-container"> <div class="head-container">
<el-table ref="table" :data="stockData.data" v-loading="stockData.loading" row-key="id" height="450"> <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"> <template v-slot="scope">
{{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }} {{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }}
</template> </template>
@ -194,16 +194,23 @@
<template v-slot="scope"> <template v-slot="scope">
{{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }} {{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }}
</template> </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> </el-table>
</div> </div>
<div class="head-container"> <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" <!-- <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) => { layout="total, sizes, prev, pager, next, jumper" @current-change="wstockChange" @size-change="(e) => {
stockData.size = e; stockData.size = e;
stockData.page = 0; stockData.page = 0;
gettbConsInfoFlowstock(); gettbConsInfoFlowstock();
}" /> }" /> -->
<div></div>
<div style="color: #43a9fe;" @click="func()">转出库单</div>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -315,6 +322,7 @@ export default {
total: 0, total: 0,
id: '' id: ''
}, },
consdata: []//
} }
}, },
filters: { filters: {
@ -463,29 +471,40 @@ export default {
this.stockData.page = e - 1; this.stockData.page = e - 1;
this.gettbConsInfoFlowstock(); this.gettbConsInfoFlowstock();
}, },
func() {
this.$router.push({
name: 'operation_in',
query: {
consdata: this.consdata
}
})
},
async gettbConsInfoFlowstock(item) { async gettbConsInfoFlowstock(item) {
console.log(item)
if (item) { if (item) {
this.stockData.id = item.id this.stockData.id = item.id
this.consdata = item.cons
this.stockData.data = item.conFlows
} }
this.variabilityshow = true this.variabilityshow = true
this.stockData.loading = true; // this.stockData.loading = true;
let arr = [] let arr = []
// if (this.query.createdAt.length) { // if (this.query.createdAt.length) {
// arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59'] // arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
// } else { // } else {
// arr = [] // arr = []
// } // }
let res = await tbProductStockOperatepage({ // let res = await tbProductStockOperatepage({
page: this.stockData.page, // page: this.stockData.page,
size: this.stockData.size, // size: this.stockData.size,
shopId: localStorage.getItem("shopId"), // shopId: localStorage.getItem("shopId"),
type: ["cons_in", "cons_out"],//id // type: ["cons_in", "cons_out"],//id
purveyorId: this.stockData.id,// // purveyorId: this.stockData.id,//
createdAt: arr//id // createdAt: arr//id
}) // })
this.stockData.loading = false; // this.stockData.loading = false;
this.stockData.data = res.content; // this.stockData.data = res.content;
this.stockData.total = res.totalElements; // this.stockData.total = res.totalElements;
}, },
} }
} }

View File

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

View File

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

View File

@ -192,7 +192,18 @@ export default {
}, },
// //
selectConfirmGoods(res) { 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 // tab
tabChange() { tabChange() {

View File

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