广告功能

This commit is contained in:
duan
2024-08-19 17:54:21 +08:00
parent 13df97b949
commit c51d5cd064
12 changed files with 517 additions and 64 deletions

View File

@@ -1,12 +1,12 @@
<!-- 耗材列表的新增耗材盘点 -->
<template>
<el-dialog title="耗材盘点" :visible.sync="dialogVisible" width="80%" @open="form.note = ''">
<el-dialog title="耗材盘点" :visible.sync="dialogVisible" width="80%">
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
<el-form-item label="账存数量">
<el-input v-model="form.balance" readonly style="width: 180px;"></el-input>
</el-form-item>
<el-form-item label="实际数量">
<el-input-number v-model="form.stocktakinNum" :min="0" :step="1" step-strictly
<el-input-number v-model="form.stockNumber" :min="0" :step="1" step-strictly
style="width: 180px;"></el-input-number>
</el-form-item>
<el-form-item label="盈亏数量">
@@ -78,7 +78,8 @@ export default {
productId: '', // 必传
stocktakinNum: '', // 必传
price: '', // 商品价格 非必传 为空盘点价格为商品价格
note: "" // 盘点备注 非必传
remark: "", // 盘点备注 非必传
stockNumber: 0
},
rules: {
stocktakinNum: [
@@ -109,20 +110,29 @@ export default {
},
computed: {
profitNumber() {
return this.form.stocktakinNum - this.form.balance
console.log(this.form, '盈亏数量')
if (this.form.balance == undefined) {
return this.form.stockNumber - 0
} else {
return this.form.stockNumber - this.form.balance
}
},
profitPrice() {
return formatDecimal(this.profitNumber * this.form.price && 0)
console.log(this.form, '盈亏金额')
return formatDecimal((this.form.stockNumber - this.form.balance) * this.form.price)
}
},
methods: {
onSubmitHandle() {
this.$refs.form.validate(async valid => {
if (valid) {
try {
this.form.lpNum = this.profitNumber
// this.form.stockNumber = this.form.stocktakinNum
this.loading = true
let res = await tbConCheck(this.form)
console.log(this.form);
this.$emit('success', res)
// this.dialogVisible = false
this.loading = false
@@ -140,10 +150,16 @@ export default {
})
},
show(obj) {
this.form.remark = ''
this.form.stocktakinNum = 0
this.form.lpNum = 0
// this.form.stockNumber = 0
this.form = Object.assign(this.form, obj)
this.dialogVisible = true
this.form.conInfoId = obj.consId
this.form.stockNumber = obj.balance
this.form.stockNumber = obj.balance * 1
this.form.price == null ? 0 : this.form.price
this.searhForm.skuId = obj.productId
this.searhForm.productId = obj.consId
@@ -166,9 +182,7 @@ export default {
const res = await tbConCheckGet({
page: this.tableData.page,
size: this.tableData.size,
name: this.searhForm.name,
skuId: this.searhForm.category,
productId: this.searhForm.productId,
conInfoId: this.searhForm.productId,
sort: 'id,desc',
})
this.tableData.list = res.content

View File

@@ -110,9 +110,11 @@ export default {
},
computed: {
profitNumber() {
// 盈亏数量
return this.form.stocktakinNum - this.detail.stockNumber
},
profitPrice() {
// 盈亏金额
return formatDecimal((this.form.stocktakinNum - this.detail.stockNumber) * this.detail.salePrice)
}
},

View File

@@ -52,70 +52,75 @@
</div>
<div class="head-container" id="table_drag">
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
<!-- <el-table-column prop="id" label="ID" width="50px" /> -->
<el-table-column label="耗材名称" prop="conName" align="center" />
<!-- <el-table-column label="耗材代码" prop="conCode" /> -->
<el-table-column label="分类名称" prop="conTypeName" align="center" />
<el-table-column label="单位" prop="conUnit" align="center" />
<el-table-column label="耗材名称" prop="conName" style="width: 100px;">
<template v-slot="scope">
<div v-if="scope.row.editNYD == 1">
<el-input v-model="scope.row.conName" placeholder="请输入内容" @blur="conNameClick(scope.row)"></el-input>
</div>
<span v-else>
{{ scope.row.conName }}
</span>
<i class="el-icon-edit" @click="scope.row.editNYD = 1"></i>
</template>
</el-table-column>
<el-table-column label="分类名称" prop="conTypeName"></el-table-column>
<el-table-column label="单位" prop="conUnit">
<template v-slot="scope">
<div v-if="scope.row.editNYD == 2">
<el-input v-model="scope.row.conUnit" placeholder="请输入内容" @blur="conNameClick(scope.row)"></el-input>
</div>
<span v-else>
{{ scope.row.conUnit }}
</span>
<i class="el-icon-edit" @click="scope.row.editNYD = 2"></i>
</template>
<el-table-column label="现有库存" align="center">
</el-table-column>
<el-table-column label="现有库存">
<template v-slot="scope">
<span :class="[computedClass(scope.row.balance)]"> {{ scope.row.balance }}</span>
</template>
</el-table-column>
<el-table-column label="耗材消耗" prop="conConsume" align="center" />
<el-table-column label="耗材入库" prop="conIn" align="center" />
<el-table-column label="耗材出库" prop="conOut" align="center" />
<el-table-column label="耗材反还" prop="conReturn" align="center" />
<el-table-column label="库存开关" prop="conReturn" align="center">
<el-table-column label="耗材消耗" prop="conConsume" />
<el-table-column label="耗材入库" prop="conIn" />
<el-table-column label="耗材出库" prop="conOut" />
<el-table-column label="耗材反还" prop="conReturn" />
<el-table-column label="库存开关" prop="conReturn">
<template v-slot="scope">
<el-switch v-model="scope.row.isCheck" active-value="1" inactive-value="0"
@change="showChange($event, scope.row)"></el-switch>
</template>
</el-table-column>
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
<!-- <el-table-column label="业务说明" prop="bizName" /> -->
<!-- <el-table-column label="商品名称" prop="productName" /> -->
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
<!-- <el-table-column label="耗材id" prop="consId" /> -->
<!-- <el-table-column label="创建时间" prop="createTime"></el-table-column> -->
<!-- <el-table-column label="所属商品" width="320" align="center">
<el-table-column label="所属商品" width="220">
<template v-slot="scope">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
item.productName }}</el-button>
{{ scope.row.productId }}
</template>
</el-table-column> -->
<el-table-column label="所属商品" width="320" align="center">
<template v-slot="scope">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
item.productName }}</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="最近入库量" prop="lasterInStock" /> -->
<el-table-column label="库存数量" align="center" prop="stockNumber">
<el-table-column label="库存数量" prop="stockNumber">
<template v-slot="scope">
{{ (scope.row.balance).toFixed(2) }}
<!-- {{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }} -->
</template>
</el-table-column>
<el-table-column label="预警值" prop="conWarning">
<template v-slot="scope">
<div v-if="scope.row.editNYD == 3">
<el-input v-model="scope.row.conWarning" placeholder="请输入内容" @blur="conNameClick(scope.row)"></el-input>
</div>
<span v-else>
{{ scope.row.conWarning }}
</span>
<i class="el-icon-edit" @click="scope.row.editNYD = 3"></i>
</template>
</el-table-column>
<el-table-column label="预警值" align="center" prop="conWarning" />
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<el-table-column label="创建时间" prop="createTime" width="200">
<!-- <template v-slot="scope">
{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template> -->
</el-table-column>
<!-- <el-table-column label="更新时间" prop="updateTime" width="200"> -->
<!-- <template v-slot="scope">
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
</template> -->
<!-- </el-table-column> -->
<el-table-column label="操作" width="250" fixed="right">
<template v-slot="scope">
<el-button type="text" @click="editorHandle(scope.row)">编辑</el-button>
@@ -506,7 +511,7 @@ export default {
downloadLoading: false,
uploadLoading: false,
dialogVisible: false,
consRecordItem: ''
consRecordItem: '',
};
},
mounted() {
@@ -541,7 +546,7 @@ export default {
}
},
toGoods(data) {
this.$router.push({
path: '/product/product',
query: {
@@ -569,6 +574,15 @@ export default {
console.log(error);
}
},
async conNameClick(row) {
await postapitbConsInfo([{
id: row.consId,
...row,
shopId: localStorage.getItem('shopId')
}])
row.editNYD = 0
this.$message.success('修改成功')
},
computedClass(num) {
if (num > 0) {
return 'green'
@@ -639,8 +653,9 @@ export default {
this.tableData.data = res.content.map(v => {
const productIds = v.productId ? v.productId.split(',') : []
return {
...v,
product: productIds.map((str, index) => {
...v,
editNYD: 0,
product: productIds.map((str, index) => {
const startIndex = str.indexOf('_')
const productId = str.slice(0, startIndex)
const productName = str.slice(startIndex + 1, str.length)
@@ -815,6 +830,7 @@ export default {
},
// 显示耗材记录
async clicksee(item) {
console.log(item, '耗材记录')
this.consRecordItem = item
this.clickseetypedialogshow = true;
this.getConsRecord()
@@ -826,7 +842,7 @@ export default {
const res = await gettbConsInfoFlow({
page: this.clickseetableData.page,
size: this.clickseetableData.size,
consId: this.consRecordItem.id,
consId: this.consRecordItem.consId,
conName: this.consRecordItem.conName,
shopId: localStorage.getItem("shopId")
});

View File

@@ -962,10 +962,8 @@ export default {
},
async submitForm(formName) {
if (this.dialogtitle == "编辑") {
let { id, surplusStock } = this.surplusStocks;
await puttbProskuCon({
id,
surplusStock,
...this.surplusStocks
});
this.$message({
message: "修改成功",