This commit is contained in:
魏啾 2024-10-17 11:32:19 +08:00
commit 585c26fd4d
4 changed files with 65 additions and 77 deletions

View File

@ -39,13 +39,8 @@ export function puttbConsType(data) {
* @returns
*/
export function gettbConsInfo(data) {
// return request({
// url: '/api/tbConsInfo',
// method: "get",
// params
// });
return request({
url: "/api/viewConInfoFlow/get",
url: "/api/tbConsInfo/allAndPro",
method: "post",
data
});

View File

@ -14,7 +14,7 @@
/> -->
<div style="width: 150px">
<el-select v-model="query.conTypeId" placeholder="请选择耗材分类" style="width: 100%">
<el-option :label="item.conTypeName" :value="item.id" v-for="item in consTypeList"
<el-option :label="item.conTypeName" :value="item.id" v-for="item in tableDatatype.data"
:key="item.conTypeId" />
</el-select>
</div>
@ -30,15 +30,10 @@
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" value-format="yyyy-MM-dd">
</el-date-picker>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
</div>
<div class="row">
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出耗材</el-button>
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button>
</div>
</div>
<div class="row_wrap" style="margin-top: 12px">
<div class="row">
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
<el-button @click="$router.push({ name: 'operation_in' })">入库</el-button>
@ -46,6 +41,18 @@
<el-button @click="$router.push({ name: 'cons_record' })">耗材记录</el-button>
<el-button @click="$router.push({ name: 'type' })">分类管理</el-button>
<el-button @click="$router.push({ name: 'supplier_manage' })">供应商管理</el-button>
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出耗材</el-button>
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button>
</div>
</div>
<div class="row_wrap" style="margin-top: 12px">
<div class="row">
<!-- <el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
<el-button @click="$router.push({ name: 'operation_in' })">入库</el-button>
<el-button @click="$router.push({ name: 'operation_out' })">出库</el-button>
<el-button @click="$router.push({ name: 'cons_record' })">耗材记录</el-button>
<el-button @click="$router.push({ name: 'type' })">分类管理</el-button>
<el-button @click="$router.push({ name: 'supplier_manage' })">供应商管理</el-button> -->
</div>
<div class="row">
<el-select clearable v-model="query.sort" @change="getTableData" placeholder="排序">
@ -242,20 +249,15 @@
<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="conReturn" />-->
<el-table-column label="所属商品">
<template v-slot="scope">
<div class="goodslang">
<div class="goods-list">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item.productId)" :key="item.productId"
<el-button v-for="(item) in scope.row.product" @click="toGoods(item.id)" :key="item.productId"
type="text">{{
item.productName }}</el-button>
item.name }}</el-button><span v-if="scope.row.product.length > 1">,</span>
</div>
<el-dropdown trigger="click" v-if="scope.row.product.length > 1" @command="toGoods">
<span class="el-dropdown-link" style="color: blue;">
@ -264,7 +266,7 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item class="clearfix" v-for="(item) in scope.row.product" :key="item.productId"
:command="item.productId">
{{ item.productName }}
{{ item.name }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -273,8 +275,7 @@
</el-table-column>
<el-table-column label="库存数量" prop="stockNumber">
<template v-slot="scope">
{{ (scope.row.balance).toFixed(2) }}
<!-- {{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }} -->
{{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="预警值" prop="conWarning">
@ -290,15 +291,20 @@
{{ scope.row.conWarning }}
</span>
<i class="el-icon-edit" @click="editorHandle(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="状态" prop="status">
<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="status">
<template v-slot="scope">
<el-switch v-model="scope.row.status" active-value="1" inactive-value="0"
@change="changeswitchstatus(scope.row)"></el-switch>
</template>
</el-table-column>
</el-table-column> -->
<!-- <el-table-column label="创建时间" prop="createTime" width="200"> </el-table-column> -->
<el-table-column label="操作" width="250" fixed="right">
<template v-slot="scope">
@ -355,7 +361,7 @@
<el-form-item label="耗材类型" prop="conTypeId">
<el-select v-model="item.conTypeId" placeholder="请选择"
@change="selectChange($event, 'refruleForm' + index, 'conTypeId')">
<el-option v-for="option in consTypeList" :key="option.conTypeId" :label="option.conTypeName"
<el-option v-for="option in tableDatatype.data" :key="option.conTypeId" :label="option.conTypeName"
:value="option.id">
</el-option>
</el-select>
@ -418,7 +424,7 @@
</el-form-item>
<el-form-item label="耗材类型" prop="conTypeId" v-if="dialogtitle == '添加'">
<el-select v-model="ruleForm.conTypeId" placeholder="请选择">
<el-option v-for="item in consTypeList" :key="item.conTypeId" :label="item.conTypeName" :value="item.id">
<el-option v-for="item in tableDatatype.data" :key="item.conTypeId" :label="item.conTypeName" :value="item.id">
</el-option>
</el-select>
</el-form-item> -->
@ -456,9 +462,9 @@
<el-form-item label="预警值">
<el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input>
</el-form-item>
<el-form-item label="状态" v-if="dialogtitle == '编辑'">
<!-- <el-form-item label="状态" v-if="dialogtitle == '编辑'">
<el-switch v-model="ruleForm.status" active-value="1" inactive-value="0"></el-switch>
</el-form-item>
</el-form-item> -->
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
<el-input v-model="ruleForm.surplusStock" placeholder="请输入单位耗材值"></el-input>
</el-form-item> -->
@ -593,7 +599,6 @@ export default {
return {
tongji: {},//
dayjs,
consTypeList: [],
query: {
conTypeId: "",
conTypeName: "",
@ -643,7 +648,7 @@ export default {
tableDatatype: {
data: [],
page: 0,
size: 30,
size:100,
loading: false,
total: 0
},
@ -716,7 +721,6 @@ export default {
this.resetRuleForms()
this.getTableData();
this.getTableDatatype();
this.gettbConsType()
},
methods: {
lookDetail(row) {
@ -870,25 +874,27 @@ export default {
createTime: arr
});
this.tableData.loading = false;
// this.tableData.data = res.content;
this.tableData.total = res.totalElements;
this.tableData.data = res.content;
this.gettbConsInfoFlowcount()//
this.tableData.data = res.content.map(v => {
const productIds = v.productId ? v.productId.split(',') : []
return {
...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)
return {
productId,
productName: productName + `${(index == productIds.length - 1) ? '' : ','}`
}
})
}
});
console.log(this.tableData.data)
// this.tableData.data = res.content.map(v => {
// const productIds = v.productId ? v.productId.split(',') : []
// return {
// ...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)
// return {
// productId,
// productName: productName + `${(index == productIds.length - 1) ? '' : ','}`
// }
// })
// }
// });
console.log(this.tableData.data)
} catch (error) {
console.log(error);
}
@ -963,7 +969,7 @@ export default {
shopId: localStorage.getItem("shopId"),
productId: '',//id
column: this.stockData.column,//
conName:this.query.conName,
conName: this.query.conName,
createdAt: arr//id
})
this.stockData.loading = false;
@ -976,19 +982,6 @@ export default {
this.gettbConsInfoFlowstock();
},
//
async gettbConsType() {
try {
const res = await gettbConsType({
page: 0,
size: 100,
shopId: localStorage.getItem("shopId")
})
this.consTypeList = res.content
} catch (error) {
console.log(error);
}
},
//
async getTableDatatype() {
this.tableDatatype.loading = true;
try {
@ -1047,7 +1040,7 @@ export default {
if (type == "add") {
//
this.dialogtitle = "添加";
this.gettbConsType()
this.getTableDatatype()
this.$nextTick(() => {
this.$refs.refruleForm.resetFields();
this.resetRuleForms()

View File

@ -23,8 +23,8 @@
<template v-slot="scope">
<el-select v-model="scope.row.conInfoId" filterable remote reserve-keyword placeholder="请输入关键词"
:remote-method="remoteMethod" :loading="loading" @change="selectionChange($event, scope.row)">
<el-option v-for="item in options" :key="item.consId" :label="item.conName"
:value="item.consId">
<el-option v-for="item in options" :key="item.id" :label="item.conName"
:value="item.id">
</el-option>
</el-select>
<div class="tips" v-if="scope.row.stockNumber">库存{{ scope.row.stockNumber }}</div>
@ -65,8 +65,8 @@
<el-select v-model="item.conInfoId" filterable remote reserve-keyword placeholder="请输入关键词"
:remote-method="remoteMethod" :loading="loading"
@change="skuSelectionChange($event, item)">
<el-option v-for="item in options" :key="item.consId" :label="item.conName"
:value="item.consId">
<el-option v-for="item in options" :key="item.id" :label="item.conName"
:value="item.id">
</el-option>
</el-select>
<div class="tips" v-if="scope.row.stockNumber">库存{{ scope.row.stockNumber }}</div>
@ -188,13 +188,13 @@ export default {
},
//
selectionChange(e, row) {
let item = this.options.find(item => item.consId == e)
let item = this.options.find(item => item.id == e)
row.name = item.conName
row.conUnit = item.conUnit
},
//
skuSelectionChange(e, row) {
let item = this.options.find(item => item.consId == e)
let item = this.options.find(item => item.id == e)
row.name = item.conName
row.conUnit = item.conUnit
},

View File

@ -49,12 +49,12 @@
</div>
<div class="info">
<div class="row">
<span>增加数量</span>
<span>增加数量:</span>
<span class="link" @click="showStockHistory('addCountNumber')">{{ countInfo.addCountNumber || 0 }}</span>
</div>
<div class="row">
<div class="row">
<span>手动增加</span>
<span>手动增加:</span>
<span class="link" @click="showStockHistory('addNumber')">{{ countInfo.addNumber || 0 }}</span>
</div>
<div class="line"></div>
@ -71,12 +71,12 @@
</div>
<div class="info">
<div class="row">
<span>减少数量</span>
<span>减少数量:</span>
<span class="link" @click="showStockHistory('subCountNumber')">{{ countInfo.subCountNumber || 0 }}</span>
</div>
<div class="row">
<div class="row">
<span>手动减少</span>
<span>手动减少:</span>
<span class="link" @click="showStockHistory('subNumber')">{{ countInfo.subNumber || 0 }}</span>
</div>
<div class="line"></div>