Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-03-11 09:14:23 +08:00
2 changed files with 52 additions and 5 deletions

View File

@@ -42,3 +42,16 @@ export function delCoilStatisticsSummary(summaryId) {
method: 'delete'
})
}
// 检查今天是否已经创建过该类型的透视表
// 如果已经创建过返回该透视表的id
// 如果没有创建过返回null
export function checkCoilStatisticsSummaryExist(statType) {
return request({
url: '/wms/coilStatisticsSummary/checkToday',
method: 'get',
params: {
statType
}
})
}

View File

@@ -15,7 +15,9 @@
<Preview :data="currentRow.statJson" :statType="currentRow.statType" />
</div>
<div v-else>
<div>钢卷生产统计详情</div>
<div>
<el-empty description="请点击左侧列表查看或创建透视表" />
</div>
</div>
</div>
</el-col>
@@ -33,7 +35,9 @@
<Preview :data="liveData" :statType="form.statType" />
</div>
<div v-else>
<div>钢卷生产统计详情</div>
<div>
<el-empty description="未知的透视表" />
</div>
</div>
</div>
</el-dialog>
@@ -41,7 +45,7 @@
</template>
<script>
import { getCoilStatisticsSummary, delCoilStatisticsSummary, addCoilStatisticsSummary, updateCoilStatisticsSummary } from "@/api/wms/coilStatisticsSummary";
import { getCoilStatisticsSummary, delCoilStatisticsSummary, addCoilStatisticsSummary, updateCoilStatisticsSummary, checkCoilStatisticsSummaryExist } from "@/api/wms/coilStatisticsSummary";
import LeftList from "./components/LeftList.vue";
import Preview from "@/views/wms/coil/panels/Perspective/index.vue";
@@ -136,9 +140,39 @@ export default {
};
},
/** 新增按钮操作 */
handleAdd(form) {
this.previewOpen = true;
async handleAdd(form) {
this.form = form;
// 先检查今天是否已经创建过该类型的透视表
const {data: existingSummary} = await checkCoilStatisticsSummaryExist(form.statType);
// 如果已经创建过
if (existingSummary) {
// 先提示是否继续创建
try {
await this.$confirm('该类型已存在透视表,是否继续创建?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
});
} catch (error) {
return;
}
// 如果要继续创建,则提示是否要覆盖已经存在的透视表
try {
await this.$confirm('是否覆盖已存在的透视表?', '提示', {
confirmButtonText: '删除并重新创建',
cancelButtonText: '保留已有透视表',
type: 'warning'
});
delCoilStatisticsSummary(existingSummary).then(() => {
this.$modal.msgSuccess("删除成功");
this.getList();
});
} catch (error) {
}
}
this.previewOpen = true;
if (form.statType == '热轧原料') {
this.previewLoading = true;
listRawMaterialPerspective().then(response => {