|
@@ -0,0 +1,284 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="时间" prop="time">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="queryParams.time"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="bpDayList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+<!-- <el-table-column label="ID" align="center" prop="id" />-->
|
|
|
+ <el-table-column label="时间" align="center" prop="time" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+<!-- <el-table-column label="产线编号" align="center" prop="deviceId" />-->
|
|
|
+ <el-table-column label="卷数统计(卷)" align="center">
|
|
|
+ <el-table-column label="最大库存" align="center" prop="rollMax" />
|
|
|
+ <el-table-column label="最小库存" align="center" prop="rollMin" />
|
|
|
+ <el-table-column label="平均库存" align="center" prop="rollAvg" />
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="米数统计(米)" align="center">
|
|
|
+ <el-table-column label="最大库存" align="center" prop="meterMax" />
|
|
|
+ <el-table-column label="最小库存" align="center" prop="meterMin" />
|
|
|
+ <el-table-column label="平均库存" align="center" prop="meterAvg" />
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="重量统计(KG)" align="center">
|
|
|
+ <el-table-column label="最大库存" align="center" prop="weightMax" />
|
|
|
+ <el-table-column label="最小库存" align="center" prop="weightMin" />
|
|
|
+ <el-table-column label="平均库存" align="center" prop="weightAvg" />
|
|
|
+ </el-table-column>
|
|
|
+<!-- <el-table-column label="明细数据-卷" align="center" prop="rollData" />-->
|
|
|
+<!-- <el-table-column label="明细数据-米" align="center" prop="meterData" />-->
|
|
|
+<!-- <el-table-column label="明细数据-重" align="center" prop="weightData" />-->
|
|
|
+<!-- <el-table-column label="备注" align="center" prop="remark" />-->
|
|
|
+<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
|
|
+<!-- <template #default="scope">-->
|
|
|
+<!-- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['inventory:bpDay:edit']">修改</el-button>-->
|
|
|
+<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['inventory:bpDay:remove']">删除</el-button>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </el-table-column>-->
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 添加或修改白坯库日统计数据对话框 -->
|
|
|
+ <el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="bpDayRef" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="时间" prop="time">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="form.time"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产线编号" prop="deviceId">
|
|
|
+ <el-input v-model="form.deviceId" placeholder="请输入产线编号" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最大库存-卷" prop="rollMax">
|
|
|
+ <el-input v-model="form.rollMax" placeholder="请输入最大库存-卷" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最大库存-米" prop="meterMax">
|
|
|
+ <el-input v-model="form.meterMax" placeholder="请输入最大库存-米" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最大库存-重" prop="weightMax">
|
|
|
+ <el-input v-model="form.weightMax" placeholder="请输入最大库存-重" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最小库存-卷" prop="rollMin">
|
|
|
+ <el-input v-model="form.rollMin" placeholder="请输入最小库存-卷" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最小库存-米" prop="meterMin">
|
|
|
+ <el-input v-model="form.meterMin" placeholder="请输入最小库存-米" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最小库存-重" prop="weightMin">
|
|
|
+ <el-input v-model="form.weightMin" placeholder="请输入最小库存-重" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="平均库存-卷" prop="rollAvg">
|
|
|
+ <el-input v-model="form.rollAvg" placeholder="请输入平均库存-卷" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="平均库存-米" prop="meterAvg">
|
|
|
+ <el-input v-model="form.meterAvg" placeholder="请输入平均库存-米" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="平均库存-重" prop="weightAvg">
|
|
|
+ <el-input v-model="form.weightAvg" placeholder="请输入平均库存-重" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="明细数据-卷" prop="rollData">
|
|
|
+ <el-input v-model="form.rollData" placeholder="请输入明细数据-卷" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="明细数据-米" prop="meterData">
|
|
|
+ <el-input v-model="form.meterData" placeholder="请输入明细数据-米" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="明细数据-重" prop="weightData">
|
|
|
+ <el-input v-model="form.weightData" placeholder="请输入明细数据-重" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name="BpDay">
|
|
|
+import { listBpDay, getBpDay, delBpDay, addBpDay, updateBpDay } from "@/api/inventory/bpDay";
|
|
|
+
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+
|
|
|
+const bpDayList = ref([]);
|
|
|
+const open = ref(false);
|
|
|
+const loading = ref(true);
|
|
|
+const showSearch = ref(true);
|
|
|
+const ids = ref([]);
|
|
|
+const single = ref(true);
|
|
|
+const multiple = ref(true);
|
|
|
+const total = ref(0);
|
|
|
+const title = ref("");
|
|
|
+
|
|
|
+const data = reactive({
|
|
|
+ form: {},
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ time: null,
|
|
|
+ deviceId: null,
|
|
|
+ rollMax: null,
|
|
|
+ meterMax: null,
|
|
|
+ weightMax: null,
|
|
|
+ rollMin: null,
|
|
|
+ meterMin: null,
|
|
|
+ weightMin: null,
|
|
|
+ rollAvg: null,
|
|
|
+ meterAvg: null,
|
|
|
+ weightAvg: null,
|
|
|
+ rollData: null,
|
|
|
+ meterData: null,
|
|
|
+ weightData: null,
|
|
|
+ remark: null
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+const { queryParams, form, rules } = toRefs(data);
|
|
|
+
|
|
|
+/** 查询白坯库日统计数据列表 */
|
|
|
+function getList() {
|
|
|
+ loading.value = true;
|
|
|
+ listBpDay(queryParams.value).then(response => {
|
|
|
+ bpDayList.value = response.rows;
|
|
|
+ total.value = response.total;
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 取消按钮
|
|
|
+function cancel() {
|
|
|
+ open.value = false;
|
|
|
+ reset();
|
|
|
+}
|
|
|
+
|
|
|
+// 表单重置
|
|
|
+function reset() {
|
|
|
+ form.value = {
|
|
|
+ id: null,
|
|
|
+ time: null,
|
|
|
+ deviceId: null,
|
|
|
+ rollMax: null,
|
|
|
+ meterMax: null,
|
|
|
+ weightMax: null,
|
|
|
+ rollMin: null,
|
|
|
+ meterMin: null,
|
|
|
+ weightMin: null,
|
|
|
+ rollAvg: null,
|
|
|
+ meterAvg: null,
|
|
|
+ weightAvg: null,
|
|
|
+ rollData: null,
|
|
|
+ meterData: null,
|
|
|
+ weightData: null,
|
|
|
+ remark: null
|
|
|
+ };
|
|
|
+ proxy.resetForm("bpDayRef");
|
|
|
+}
|
|
|
+
|
|
|
+/** 搜索按钮操作 */
|
|
|
+function handleQuery() {
|
|
|
+ queryParams.value.pageNum = 1;
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+/** 重置按钮操作 */
|
|
|
+function resetQuery() {
|
|
|
+ proxy.resetForm("queryRef");
|
|
|
+ handleQuery();
|
|
|
+}
|
|
|
+
|
|
|
+// 多选框选中数据
|
|
|
+function handleSelectionChange(selection) {
|
|
|
+ ids.value = selection.map(item => item.id);
|
|
|
+ single.value = selection.length != 1;
|
|
|
+ multiple.value = !selection.length;
|
|
|
+}
|
|
|
+
|
|
|
+/** 新增按钮操作 */
|
|
|
+function handleAdd() {
|
|
|
+ reset();
|
|
|
+ open.value = true;
|
|
|
+ title.value = "添加白坯库日统计数据";
|
|
|
+}
|
|
|
+
|
|
|
+/** 修改按钮操作 */
|
|
|
+function handleUpdate(row) {
|
|
|
+ reset();
|
|
|
+ const _id = row.id || ids.value
|
|
|
+ getBpDay(_id).then(response => {
|
|
|
+ form.value = response.data;
|
|
|
+ open.value = true;
|
|
|
+ title.value = "修改白坯库日统计数据";
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/** 提交按钮 */
|
|
|
+function submitForm() {
|
|
|
+ proxy.$refs["bpDayRef"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (form.value.id != null) {
|
|
|
+ updateBpDay(form.value).then(response => {
|
|
|
+ proxy.$modal.msgSuccess("修改成功");
|
|
|
+ open.value = false;
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addBpDay(form.value).then(response => {
|
|
|
+ proxy.$modal.msgSuccess("新增成功");
|
|
|
+ open.value = false;
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/** 删除按钮操作 */
|
|
|
+function handleDelete(row) {
|
|
|
+ const _ids = row.id || ids.value;
|
|
|
+ proxy.$modal.confirm('是否确认删除白坯库日统计数据编号为"' + _ids + '"的数据项?').then(function() {
|
|
|
+ return delBpDay(_ids);
|
|
|
+ }).then(() => {
|
|
|
+ getList();
|
|
|
+ proxy.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+}
|
|
|
+
|
|
|
+/** 导出按钮操作 */
|
|
|
+function handleExport() {
|
|
|
+ proxy.download('inventory/bpDay/export', {
|
|
|
+ ...queryParams.value
|
|
|
+ }, `bpDay_${new Date().getTime()}.xlsx`)
|
|
|
+}
|
|
|
+
|
|
|
+getList();
|
|
|
+</script>
|