Commit da99a0e6 by wangzhihui

优化bug

1 parent 944f154c
......@@ -781,3 +781,4 @@ export function listExcellentCaseCategories(data = {}) {
data.method = "dj.api.supervisor.excellent.case.categories";
return request(data, "post");
}
......@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-06-12 15:21:09
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-03-19 11:44:04
* @LastEditTime: 2026-03-20 15:21:07
* @FilePath: \dj-car-life-system\src\views\goods\grounding\components\relateStoreTable.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -26,12 +26,12 @@
<el-table-column align="center"
label="库存管控">
<template #default="scope">
<span v-if="isDetail">{{ scope.row.inventoryType == 1 ? '虚拟管控' : '实物管控' }}</span>
<span v-if="isDetail">{{ scope.row.inventoryType == 1 ? '虚拟' : '实物' }}</span>
<el-select v-else
v-model="scope.row.inventoryType"
placeholder="请选择">
<el-option label="虚拟管控" :value="1"></el-option>
<el-option label="实物管控" :value="2"></el-option>
<el-option label="虚拟" :value="1"></el-option>
<el-option label="实物" :value="2"></el-option>
</el-select>
</template>
</el-table-column>
......
......@@ -562,7 +562,7 @@ export default {
prop: "inventoryType",
width: "120",
formatter: (cellValue) => {
return cellValue.inventoryType == 1 ? "虚拟管控" : cellValue.inventoryType == 2 ? "实物管控" : "-";
return cellValue.inventoryType == 1 ? "虚拟" : cellValue.inventoryType == 2 ? "实物" : "-";
},
}, {
label: "校验最低价",
......
......@@ -413,6 +413,10 @@ export default {
this.$message.error("请先勾选发货单");
return;
}
if (this.filterIds().length === 1) {
this.$message.error("至少选择两个发货单");
return;
}
const params = {
ids: this.filterIds().join(","),
};
......
......@@ -44,13 +44,13 @@
<span class="dot"
:style="{
background: getStatusColor(
scope && scope.scope && scope.scope.status,
scope && scope.scope && scope.scope.reviewStatus,
'reviewCaseStatusOptMap',
),
}">
</span>
{{
getStatusItem(baseData, "reviewCaseStatusOpt", scope.scope, "status")
getStatusItem(baseData, "reviewCaseStatusOpt", scope.scope, "reviewStatus")
}}
</div>
</div>
......@@ -58,11 +58,11 @@
<template #auth-button="scope">
<div>
<!-- 通过 -->
<span style="margin-right: 10px">
<span v-if="scope.scope.reviewStatus === 0" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122601']" />
</span>
<!-- 驳回 -->
<span style="margin-right: 10px">
<span v-if="scope.scope.reviewStatus === 1" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122602']" />
</span>
<!-- 下载录音 -->
......@@ -78,9 +78,9 @@
</template>
<script>
import { approveExcellentCase, downloadExcellentCaseAudio, listExcellentCase, listExcellentCaseCategories, rejectExcellentCase } from "@/api/resident";
import { approveExcellentCase, listExcellentCase, listExcellentCaseCategories, rejectExcellentCase } from "@/api/resident";
import { reviewCaseStatusOpt, reviewCaseStatusOptMap } from "@/common/constants.js";
import { deepClone, downLoadFile, Util } from "@/common/util";
import { deepClone, Util } from "@/common/util";
export default {
data() {
......@@ -164,7 +164,12 @@ export default {
{
label: "提交时间",
prop: "createTime",
width: 120,
width: 150,
formatter(row, column) {
return row.createTime
? Util.dateFormate(row.createTime, "YYYY-MM-DD HH:mm:ss")
: "-";
},
},
],
},
......@@ -172,7 +177,7 @@ export default {
searchForm: {
merchantName: "",
staffName: "",
customerCategory: "",
customerType: "",
submitterName: "",
reviewStatus: 0,
},
......@@ -239,7 +244,7 @@ export default {
// });
approveExcellentCase(params).then((res) => {
if (res) {
this.notice.okTips("操作成功");
this.$message.success("操作成功");
this.handleSearch();
}
});
......@@ -252,7 +257,7 @@ export default {
};
rejectExcellentCase(params).then((res) => {
if (res) {
this.notice.okTips("操作成功");
this.$message.success("操作成功");
this.handleSearch();
}
});
......@@ -311,8 +316,14 @@ export default {
listExcellentCaseCategories(),
]);
const customerCategoryOptMap = customerCategoryOpt.map((item) => {
return {
itemName: item,
itemValue: item,
};
});
// 处理返回的数据
this.baseData.customerCategoryOpt = customerCategoryOpt;
this.baseData.customerCategoryOpt = customerCategoryOptMap;
this.getOptionsList(this, "showFormData", true);
} catch (error) {
console.error(error);
......@@ -334,14 +345,14 @@ export default {
// 下载录音
handleDownload(row) {
const params = {
id: row.id,
};
downloadExcellentCaseAudio(params).then((res) => {
if (res) {
downLoadFile(res);
}
});
const recordingUrl = row.recordingUrl;
if (!recordingUrl) {
this.$message.error("录音文件不存在");
return;
}
// downLoadFile(recordingUrl);
window.open(recordingUrl);
},
getParams() {
......
......@@ -277,29 +277,66 @@ export default {
const n = Number(cfg?.maxValue);
return Number.isFinite(n) ? n : null;
},
// 格式化数字,最多两位小数
// 格式化数字,最多两位小数
formatDecimal(value) {
if (value === "" || value === null || value === undefined) {
return "";
}
// 只允许数字和小数点
let str = String(value).replace(/[^\d.]/g, "");
// 保证只有一个小数点
const parts = str.split(".");
if (parts.length > 2) {
str = parts[0] + "." + parts.slice(1).join("");
}
// 处理以小数点开头的情况,补 0
if (str.startsWith(".")) {
str = "0" + str;
}
// 限制两位小数
const finalParts = str.split(".");
if (finalParts.length === 2) {
finalParts[1] = finalParts[1].slice(0, 2);
str = finalParts.join(".");
}
return str;
},
// 将当前行的结束值同步给下一行的起始值(若存在下一行)
handleMaxInput(index, value) {
const list = this.addForm.configList || [];
const nextIndex = index + 1;
// 格式化输入值,限制两位小数
const formattedValue = this.formatDecimal(value);
this.$set(list[index], "maxValue", formattedValue);
if (nextIndex < list.length) {
this.$set(list[nextIndex], "minValue", value);
this.$set(list[nextIndex], "minValue", formattedValue);
}
},
handleMinInput(index, value) {
const list = this.addForm.configList || [];
const row = list[index];
if (!row)
return;
const min = Number(value);
// 格式化输入值,限制两位小数
const formattedValue = this.formatDecimal(value);
this.$set(row, "minValue", formattedValue);
const min = Number(formattedValue);
if (!Number.isFinite(min))
return;
// 结束值为 +∞(或该行为绿灯)不做处理
const isMaxInfinite
= row.maxValueInf === 1
|| row.warningLevel === 2
|| row.maxValue === "+∞";
const isMaxInfinite = row.maxValueInf === 1 || row.warningLevel === 2 || row.maxValue === "+∞";
if (isMaxInfinite)
return;
......
......@@ -217,7 +217,7 @@ export default {
prop: "inventoryType",
width: "120",
formatter: (cellValue) => {
return cellValue.inventoryType == 1 ? "虚拟管控" : cellValue.inventoryType == 2 ? "实物管控" : "-";
return cellValue.inventoryType == 1 ? "虚拟" : cellValue.inventoryType == 2 ? "实物" : "-";
},
},
{
......@@ -324,6 +324,7 @@ export default {
productCode: "",
businessCode: "",
queryFlowTypes: [],
inventoryType: "",
};
this.$refs.purchasementReviewTable.refreshTable(true);
},
......
......@@ -287,7 +287,7 @@ export default {
prop: "inventoryType",
width: "120",
formatter: (cellValue) => {
return cellValue.inventoryType == 1 ? "虚拟管控" : cellValue.inventoryType == 2 ? "实物管控" : "-";
return cellValue.inventoryType == 1 ? "虚拟" : cellValue.inventoryType == 2 ? "实物" : "-";
},
}, {
label: "出库仓库",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!