1.优化首页 2.优化绑定耗材

This commit is contained in:
gyq 2024-10-24 15:38:55 +08:00
parent 2261b0520a
commit f585e2f020
2 changed files with 120 additions and 106 deletions

View File

@ -220,13 +220,13 @@
<div class="number">{{ productCount }}</div>
<div class="product_chart_wrap" ref="productCountChart"></div>
</div>
<div class="card">
<!-- <div class="card">
<div class="sale_data_header">
<div class="card_title">销售金额</div>
</div>
<div class="number">{{ productSum }}</div>
<div class="product_chart_wrap" ref="productSumChart"></div>
</div>
</div> -->
</div>
<div class="table">
<el-table :data="saleTable" v-loading="saleTableLoading">
@ -336,9 +336,9 @@ export default {
if (this.productCountChart) {
this.productCountChart.resize();
}
if (this.productSumChart) {
this.productSumChart.resize();
}
// if (this.productSumChart) {
// this.productSumChart.resize();
// }
}, 100);
window.addEventListener("resize", this.__resizeHandler);
// this.initCardUserChart();
@ -679,7 +679,7 @@ export default {
{
name: '订单金额',
type: "bar",
barWidth: time.length <= 7 ? "30%" : "20%",
barWidth: time.length <= 7 ? "50%" : "30%",
data: data.map(item => item.orderAmount),
},
// {
@ -688,12 +688,12 @@ export default {
// barWidth: time.length <= 7 ? "30%" : "20%",
// data: data.map(item => item.actualAmount),
// },
{
name: '优惠金额',
type: "bar",
barWidth: time.length <= 7 ? "30%" : "20%",
data: data.map(item => item.discountAmount),
}
// {
// name: '',
// type: "bar",
// barWidth: time.length <= 7 ? "30%" : "20%",
// data: data.map(item => item.discountAmount),
// }
]
});
},
@ -754,7 +754,7 @@ export default {
return {
orderAmount: item.orderAmount,
// actualAmount: item.actualAmount,
discountAmount: item.discountAmount
// discountAmount: item.discountAmount
}
});
const time = res.total.map(item => item.tradeDay);
@ -840,7 +840,7 @@ export default {
//
initProduceChart(p1, p2) {
this.productCountChart = echarts.init(this.$refs.productCountChart);
this.productSumChart = echarts.init(this.$refs.productSumChart);
// this.productSumChart = echarts.init(this.$refs.productSumChart);
this.productCountChart.setOption({
tooltip: {
@ -913,76 +913,76 @@ export default {
]
});
this.productSumChart.setOption({
tooltip: {
trigger: "axis"
},
grid: {
x: 0,
y: 0,
x2: 0,
y2: 0
},
xAxis: [
{
boundaryGap: false,
type: "category",
data: p2[0],
show: false, // 线线
axisTick: {
show: false // 线
},
axisLine: {
show: false // 线
},
axisLabel: {
show: false //
},
splitLine: {
show: false // 线
}
}
],
color: "#409eff",
yAxis: [
{
type: "value",
show: false, // 线线
axisTick: {
show: false // 线
},
axisLine: {
show: false // 线
},
axisLabel: {
show: false //
},
splitLine: {
show: false // 线
}
}
],
series: [
{
data: p2[1],
type: "line",
symbol: "none",
smooth: true,
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#409eff" //
},
{
offset: 1,
color: "#409eff" //
}
])
}
}
]
});
// this.productSumChart.setOption({
// tooltip: {
// trigger: "axis"
// },
// grid: {
// x: 0,
// y: 0,
// x2: 0,
// y2: 0
// },
// xAxis: [
// {
// boundaryGap: false,
// type: "category",
// data: p2[0],
// show: false, // 线线
// axisTick: {
// show: false // 线
// },
// axisLine: {
// show: false // 线
// },
// axisLabel: {
// show: false //
// },
// splitLine: {
// show: false // 线
// }
// }
// ],
// color: "#409eff",
// yAxis: [
// {
// type: "value",
// show: false, // 线线
// axisTick: {
// show: false // 线
// },
// axisLine: {
// show: false // 线
// },
// axisLabel: {
// show: false //
// },
// splitLine: {
// show: false // 线
// }
// }
// ],
// series: [
// {
// data: p2[1],
// type: "line",
// symbol: "none",
// smooth: true,
// areaStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "#409eff" //
// },
// {
// offset: 1,
// color: "#409eff" //
// }
// ])
// }
// }
// ]
// });
},
//
async summaryDateGet(res) {

View File

@ -1,5 +1,5 @@
<template>
<el-dialog width="80%" :visible.sync="dialogVisible" :show-close="false" @close="reset">
<el-dialog top="10vh" :visible.sync="dialogVisible" :show-close="false" @close="reset">
<div class="header_wrap">
<div class="title">耗材信息</div>
<div class="btn_wrap">
@ -23,8 +23,7 @@
<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.id" :label="item.conName"
:value="item.id">
<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>
@ -41,13 +40,15 @@
<el-input-number v-model="scope.row.surplusStock" :min="0" />
</template>
</el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="100">
<template v-slot="scope">
<div class="table_btn_wrap">
<div class="btn sub" v-if="scope.$index > 0" @click="tableData.cons.splice(scope.$index, 1)">
<div class="btn sub" v-if="tableData.cons.length > 1"
@click="tableData.cons.splice(scope.$index, 1)">
<i class="el-icon-remove-outline"></i>
</div>
<div class="btn add" @click="createItem(scope.row)">
<div class="btn add" v-if="scope.$index == tableData.cons.length - 1"
@click="createItem(scope.row)">
<i class="el-icon-circle-plus-outline"></i>
</div>
</div>
@ -55,7 +56,7 @@
</el-table-column>
</el-table>
<!-- 绑定到规格 -->
<el-table :data="tableData.cons" border v-show="type == 2">
<el-table :data="tableData.cons" border v-show="type == 2" height="500px">
<el-table-column label="序号" type="index" width="100"></el-table-column>
<el-table-column label="规格名称" prop="specSnap"></el-table-column>
<el-table-column label="耗材" width="600">
@ -86,18 +87,20 @@
<el-table-column label="消耗量">
<template v-slot="scope">
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
<el-input-number v-model="item.surplusStock" :min="0" />
<el-input-number v-model="item.surplusStock" :min="1" />
</div>
</template>
</el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="100">
<template v-slot="scope">
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
<div class="table_btn_wrap t">
<div class="btn sub" v-if="index > 0" @click="scope.row.consList.splice(index, 1)">
<div class="btn sub" v-if="scope.row.consList.length > 1"
@click="scope.row.consList.splice(index, 1)">
<i class="el-icon-remove-outline"></i>
</div>
<div class="btn add" @click="skuCreateItem(scope.$index)">
<div class="btn add" v-if="index == scope.row.consList.length - 1"
@click="skuCreateItem(scope.$index)">
<i class="el-icon-circle-plus-outline"></i>
</div>
</div>
@ -247,7 +250,7 @@ export default {
item.conInfoId = ''
item.name = ''
item.conUnit = ''
item.surplusStock = 0
item.surplusStock = 1
item.status = 1
this.tableData.cons.push(item)
} else {
@ -278,7 +281,7 @@ export default {
item.conInfoId = ''
item.name = ''
item.conUnit = ''
item.surplusStock = 0
item.surplusStock = 1
item.status = 1
this.tableData.cons.push(item)
}
@ -295,7 +298,7 @@ export default {
item.conInfoId = ''
item.name = ''
item.conUnit = ''
item.surplusStock = 0
item.surplusStock = 1
item.status = 1
item.specSnap = val.name
@ -315,13 +318,24 @@ export default {
this.tableData.cons.map(val => {
this.goodsDetail.conInfos.map(item => {
if (item.productSkuId == val.productSkuId) {
val.consList.unshift({
id: item.id,
surplusStock: item.surplusStock,
conInfoId: item.conInfoId,
name: item.conName,
conUnit: item.conUnit
})
if (val.consList.length == 1 && val.consList[0].conInfoId == '') {
val.consList = []
val.consList.push({
id: item.id,
surplusStock: item.surplusStock,
conInfoId: item.conInfoId,
name: item.conName,
conUnit: item.conUnit
})
} else {
val.consList.push({
id: item.id,
surplusStock: item.surplusStock,
conInfoId: item.conInfoId,
name: item.conName,
conUnit: item.conUnit
})
}
}
})
})
@ -339,7 +353,7 @@ export default {
item.conInfoId = ''
item.name = ''
item.conUnit = ''
item.surplusStock = 0
item.surplusStock = 1
item.status = 1
this.tableData.cons.push(item)