Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -42,3 +42,16 @@ export function delCoilStatisticsSummary(summaryId) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查今天是否已经创建过该类型的透视表
|
||||||
|
// 如果已经创建过,返回该透视表的id
|
||||||
|
// 如果没有创建过,返回null
|
||||||
|
export function checkCoilStatisticsSummaryExist(statType) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/coilStatisticsSummary/checkToday',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
statType
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,7 +15,9 @@
|
|||||||
<Preview :data="currentRow.statJson" :statType="currentRow.statType" />
|
<Preview :data="currentRow.statJson" :statType="currentRow.statType" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div>钢卷生产统计详情</div>
|
<div>
|
||||||
|
<el-empty description="请点击左侧列表查看或创建透视表" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -33,7 +35,9 @@
|
|||||||
<Preview :data="liveData" :statType="form.statType" />
|
<Preview :data="liveData" :statType="form.statType" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div>钢卷生产统计详情</div>
|
<div>
|
||||||
|
<el-empty description="未知的透视表" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -41,7 +45,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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 LeftList from "./components/LeftList.vue";
|
||||||
import Preview from "@/views/wms/coil/panels/Perspective/index.vue";
|
import Preview from "@/views/wms/coil/panels/Perspective/index.vue";
|
||||||
|
|
||||||
@@ -136,9 +140,39 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd(form) {
|
async handleAdd(form) {
|
||||||
this.previewOpen = true;
|
|
||||||
this.form = 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 == '热轧原料') {
|
if (form.statType == '热轧原料') {
|
||||||
this.previewLoading = true;
|
this.previewLoading = true;
|
||||||
listRawMaterialPerspective().then(response => {
|
listRawMaterialPerspective().then(response => {
|
||||||
|
|||||||
Reference in New Issue
Block a user