Commit e2a07d7c by 张立顺

Merge branch 'v1.4.0' of http://192.168.3.233:8090/usedCarAuction/aus into v1.4.0

2 parents 3829a97a 035001e7
......@@ -3,12 +3,14 @@ package com.glsx.usedcar.export;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.glsx.usedcar.module.coupon.vo.CouponDistributionRecordRespVO;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Data
......@@ -52,6 +54,13 @@ public class CouponDistributionRecordExportBean implements Serializable {
private String couponName;
/**
* 优惠券模板ID
*/
@ExcelProperty("优惠券模板ID")
@ColumnWidth(30)
private String couponTemplateId;
/**
* 发放用户名
*/
@ExcelProperty("发放用户名")
......@@ -148,6 +157,9 @@ public class CouponDistributionRecordExportBean implements Serializable {
// 优惠券名称
this.couponName = vo.getTemplateName();
// 优惠券模板ID
this.couponTemplateId = vo.getCouponTemplateId();
// 发放用户名
this.accountName = vo.getAccountName();
......
......@@ -7,6 +7,7 @@ import com.glsx.usedcar.module.vehicle.entity.Vehicle;
import com.glsx.usedcar.util.NumberToChinese;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
......@@ -69,10 +70,20 @@ public record DocTemplateRequest(String docTemplateId, String fileName, List<Com
}
}
double totalAmount = actualOrderPrice + actualCommissionPrice;
// 1. 车款 - 两位小数+向上取整
String hammerPrice = new BigDecimal(String.valueOf(actualOrderPrice)).setScale(2, RoundingMode.CEILING).max(BigDecimal.ZERO).toString();
// 2. 佣金 - 两位小数+向上取整
String otherFees = new BigDecimal(String.valueOf(actualCommissionPrice)).setScale(2, RoundingMode.CEILING).max(BigDecimal.ZERO).toString();
components.add(new Component("hammerPrice", actualOrderPrice + ""));
components.add(new Component("otherFees", actualCommissionPrice + ""));
double totalAmount = new BigDecimal(hammerPrice)
.add(new BigDecimal(otherFees))
.setScale(2, RoundingMode.DOWN)
.max(BigDecimal.ZERO)
.doubleValue();
// 放入组件
components.add(new Component("hammerPrice", hammerPrice));
components.add(new Component("otherFees", otherFees));
components.add(new Component("totalAmount", totalAmount + ""));
components.add(new Component("totalAmountInWords", NumberToChinese.toChinese(totalAmount)));
......
No preview for this file type
......@@ -20,7 +20,7 @@
"core-js": "^3.6.5",
"dayjs": "^1.10.7",
"echarts": "^5.2.2",
"glsk-oss-jssdk": "^1.0.6",
"glsk-oss-jssdk": "^1.0.8",
"image-conversion": "^2.1.1",
"ionicons": "^8.0.9",
"lib": "file:../lib",
......
......@@ -45,8 +45,8 @@ importers:
specifier: ^5.2.2
version: 5.6.0
glsk-oss-jssdk:
specifier: ^1.0.6
version: 1.0.6
specifier: ^1.0.8
version: 1.0.8
image-conversion:
specifier: ^2.1.1
version: 2.1.1
......@@ -1826,8 +1826,8 @@ packages:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
glsk-oss-jssdk@1.0.6:
resolution: {integrity: sha512-uifUcPNbb6Roas0Dlx6LRldHPwU1yQqJbQRldUaNB+e6stFvn9XrsewCueNDUty3cZw4NCg3yao2WVCUm3T2Og==}
glsk-oss-jssdk@1.0.8:
resolution: {integrity: sha512-X6UeEMQdVJS6T6m587E+wTr7MEmpxrewGC1uX5PfonrWXIuOU3AwUD0bb1CVIMRLrKqDBcNHEfA/VlmKgwCGMg==}
good-listener@1.2.2:
resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==}
......@@ -5014,7 +5014,7 @@ snapshots:
merge2: 1.4.1
slash: 3.0.0
glsk-oss-jssdk@1.0.6:
glsk-oss-jssdk@1.0.8:
dependencies:
ali-oss: 6.23.0
axios: 1.15.0
......
......@@ -29,7 +29,20 @@ export const DetectionRouter: Array<RouteRecordRaw> = [
breadcrumbs: [
{ name: "检测管理" },
{ name: "检测工单管理", path: "/detection/order" },
{ name: "编辑检测报告" },
{ name: "编辑检测项" },
],
},
},
{
path: "/detection/order/report",
component: () =>
import("@/views/detection/order/DetectionOrderEdit.vue"),
meta: {
readonly: true,
breadcrumbs: [
{ name: "检测管理" },
{ name: "检测工单管理", path: "/detection/order" },
{ name: "查看检测项" },
],
},
},
......
/**
* 复制文本到剪贴板。优先 Clipboard API,非 HTTPS 等场景回退 execCommand。
*/
export async function copyText(text: unknown): Promise<void> {
const value = String(text ?? "").trim();
if (!value) {
throw new Error("empty");
}
if (navigator.clipboard?.writeText) {
try {
await navigator.clipboard.writeText(value);
return;
} catch {
// 非安全上下文或权限被拒时回退
}
}
const textarea = document.createElement("textarea");
textarea.value = value;
textarea.setAttribute("readonly", "");
textarea.style.position = "fixed";
textarea.style.left = "-9999px";
textarea.style.top = "0";
textarea.style.opacity = "0";
document.body.appendChild(textarea);
textarea.focus();
textarea.select();
textarea.setSelectionRange(0, value.length);
const ok = document.execCommand("copy");
document.body.removeChild(textarea);
if (!ok) {
throw new Error("copy failed");
}
}
......@@ -100,7 +100,9 @@
<template v-if="record.payType==='拍卖保证金'">
<deposit-state-tag :deposit-state="record.payState"></deposit-state-tag>
</template>
<template v-else-if="record.payType === '优惠券抵扣'">-</template>
<template v-else-if="record.payType === '优惠券抵扣'">
<a-tag color="green">已抵扣</a-tag>
</template>
<template v-else-if="orderTransaction">
<audit-state-tag :audit-state="orderTransaction.auditState"></audit-state-tag>
</template>
......@@ -333,7 +335,7 @@ export default class ViewAuctionOrder extends Vue {
}
const youhuiquan = {
payType: '优惠券抵扣',
amount: '-¥' + this.couponUseData?.faceAmount,
amount: '-¥' + this.couponUseData?.actualDeduction,
payAmount: '-',
payState: '已抵扣',
payMethod: '-',
......
......@@ -31,10 +31,11 @@
<div
v-if="item.allowNoStructure"
class="allowNoStructureBox"
@click="
item.resultStatus =
!item.resultStatus
"
:class="{
'allowNoStructureBox--readonly':
readonly,
}"
@click="toggleNoStructure(item)"
>
<div
v-if="!item.resultStatus"
......@@ -57,7 +58,7 @@
getValidationRules(item).maxLength ||
120
"
:disabled="item.editPermission == '0'"
:disabled="isFieldDisabled(item)"
allow-clear
/>
</div>
......@@ -73,7 +74,7 @@
getValidationRules(item).maxLength ||
120
"
:disabled="item.editPermission == '0'"
:disabled="isFieldDisabled(item)"
:auto-size="{ minRows: 2, maxRows: 5 }"
show-word-limit
show-count
......@@ -95,7 +96,7 @@
"
step="0.01"
:placeholder="item.placeholder"
:disabled="item.editPermission == '0'"
:disabled="isFieldDisabled(item)"
@input="
(e) => {
item.value =
......@@ -116,7 +117,10 @@
'radio_button_select'
"
>
<a-radio-group v-model:value="item.value">
<a-radio-group
v-model:value="item.value"
:disabled="isFieldDisabled(item)"
>
<a-radio
v-for="option in getOptionList(item)"
:key="option.value"
......@@ -139,7 +143,7 @@
style="width: 100%"
v-model:value="item.value"
:placeholder="item.placeholder"
:disabled="item.editPermission == '0'"
:disabled="isFieldDisabled(item)"
:disabled-date="disabledDateBefore1990"
placement="bottomLeft"
allow-clear
......@@ -152,7 +156,7 @@
value-format="YYYY-MM"
picker="month"
:placeholder="item.placeholder"
:disabled="item.editPermission == '0'"
:disabled="isFieldDisabled(item)"
:disabled-date="disabledMonthBefore1990"
placement="bottomLeft"
allow-clear
......@@ -164,7 +168,7 @@
v-model:value="item.value"
:placeholder="item.placeholder"
placement="bottomLeft"
:disabled="item.editPermission == '0'"
:disabled="isFieldDisabled(item)"
style="width: 100%"
allow-clear
>
......@@ -182,6 +186,7 @@
<CustomizeFormButtonSelect
:columnsList="getOptionList(item)"
:item="item"
:readonly="readonly"
:value="item.value"
@update="item.value = $event"
/>
......@@ -195,6 +200,7 @@
>
<CustomizeFormUploadFile
:item="item"
:readonly="readonly"
:value="item.value"
@update="item.value = $event"
/>
......@@ -209,11 +215,13 @@
<CustomizeFormButtonSelect
:columnsList="getOptionList(item)"
:item="item"
:readonly="readonly"
:value="item.value"
@update="item.value = $event"
/>
<CustomizeFormButtonSelectUploadFile
:item="item"
:readonly="readonly"
@update="item.uploadValue = $event"
/>
</div>
......@@ -222,7 +230,7 @@
</a-row>
</div>
</a-form>
<div class="footer-submit">
<div v-if="!readonly" class="footer-submit">
<a-button type="primary" class="mr-10" @click="submitForm"
>保存</a-button
>
......@@ -255,6 +263,9 @@ const DATE_PICKER_MIN = dayjs("1990-01-01");
},
})
export default class CustomizeForm extends Vue {
@Prop({ default: false })
readonly = false;
postData: any = {};
columnsList: any = [];
......@@ -323,6 +334,17 @@ export default class CustomizeForm extends Vue {
this.onMainScroll = null;
}
isFieldDisabled(item: any): boolean {
return this.readonly || item.editPermission == "0";
}
toggleNoStructure(item: any) {
if (this.readonly) {
return;
}
item.resultStatus = !item.resultStatus;
}
//初始化数据
init(data) {
//重置表单数据
......@@ -333,7 +355,25 @@ export default class CustomizeForm extends Vue {
this.carTypeList = data.carTypeList || [];
this.activeNodeId = data.activeNodeId || "";
this.taskId = data.taskId || "";
this.snapshotInitialValues();
this.scheduleSnapshotInitialValues();
}
getLeafSnapshotValue(node: any): string {
if (node?.interactionType === "image_upload_and_button_select") {
return TrackHelper.normalize({
value: node.value,
uploadValue: node.uploadValue,
});
}
return TrackHelper.normalize(node.value);
}
scheduleSnapshotInitialValues() {
this.$nextTick(() => {
this.$nextTick(() => {
this.snapshotInitialValues();
});
});
}
snapshotInitialValues() {
......@@ -344,7 +384,7 @@ export default class CustomizeForm extends Vue {
if (node?.childrenNodes && node.childrenNodes.length) {
walk(node.childrenNodes);
} else if (node?.id != null) {
leafMap[node.id] = TrackHelper.normalize(node.value);
leafMap[node.id] = this.getLeafSnapshotValue(node);
nameMap[node.id] = node.nodeName || String(node.id);
}
});
......@@ -354,6 +394,10 @@ export default class CustomizeForm extends Vue {
this.leafIdToName = nameMap;
}
hasUnsavedChanges(): boolean {
return this.collectModifiedFieldNames().length > 0;
}
collectModifiedFieldNames(): string[] {
const current: Record<string, any> = {};
const walk = (nodes: any[] = []) => {
......@@ -361,7 +405,7 @@ export default class CustomizeForm extends Vue {
if (node?.childrenNodes && node.childrenNodes.length) {
walk(node.childrenNodes);
} else if (node?.id != null) {
current[node.id] = TrackHelper.normalize(node.value);
current[node.id] = this.getLeafSnapshotValue(node);
}
});
};
......@@ -537,7 +581,7 @@ export default class CustomizeForm extends Vue {
this.$emit("submitSuccess", res);
message.success(res.message || "保存成功");
this.sendSaveTrack(modifiedFields);
this.snapshotInitialValues();
this.scheduleSnapshotInitialValues();
} else {
message.error(res.message || "保存失败");
}
......@@ -738,6 +782,11 @@ export default class CustomizeForm extends Vue {
cursor: pointer;
}
.allowNoStructureBox--readonly {
cursor: default;
pointer-events: none;
}
.checkCircleNo {
width: 12px;
height: 12px;
......
......@@ -2,7 +2,7 @@
<div>
<div class="selectList">
<div v-for="(col, index) in columnsList" :key="index" class="selectBut"
:class="{ 'pitchOn': pickerValue.includes(col.value) }" @click="handleBut(col)">
:class="{ 'pitchOn': pickerValue.includes(col.value), 'selectBut--readonly': readonly }" @click="handleBut(col)">
{{ col.text }}
<div v-if="pickerValue.includes(col.value)" class="pitchImg"></div>
</div>
......@@ -11,6 +11,7 @@
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-facing-decorator";
import { TrackHelper } from "@/common/TrackHelper";
@Component({ components: {} })
......@@ -19,12 +20,14 @@ export default class CustomizeFormButtonSelect extends Vue {
columnsList: any = [];
@Prop({ default: () => [] })
item: any = {};
@Prop({ default: false })
readonly = false;
pickerValue = []
// item.resultStatus 变化时,清空选择项
@Watch('item.resultStatus', { deep: true, immediate: true })
watchItem(newValue: any, oldValue: any): void {
@Watch("item.resultStatus")
watchItem(newValue: boolean): void {
if (newValue) {
this.pickerValue = [];
this.setupdate();
......@@ -37,11 +40,25 @@ export default class CustomizeFormButtonSelect extends Vue {
// 初始化数据
initData() {
this.pickerValue = this.item?.inspectionResultVO?.inspectionValueList?.filter(item => item.valueKey && item.interactionType == "button_select")?.map(item => item.valueKey) || [];
if (this.item?.resultStatus) {
this.pickerValue = [];
return;
}
this.pickerValue =
this.item?.inspectionResultVO?.inspectionValueList
?.filter(
(entry) =>
entry.valueKey &&
entry.interactionType == "button_select",
)
?.map((entry) => entry.valueKey) || [];
this.setupdate();
}
handleBut(item: { value: string }) {
if (this.readonly) {
return;
}
if (item.value) {
this.item.resultStatus = false;
}
......@@ -54,15 +71,22 @@ export default class CustomizeFormButtonSelect extends Vue {
}
setupdate() {
const valueList = (this.pickerValue || []).map(item => {
const object = (this.columnsList || []).find(finditem => finditem.value == item) || {};
const valueList = (this.pickerValue || []).map((item) => {
const object =
(this.columnsList || []).find(
(finditem) => finditem.value == item,
) || {};
return { valueText: object.text || "", valueKey: item || "" };
});
if (valueList.length > 0) {
this.$emit("update", JSON.stringify(valueList || []));
} else {
this.$emit("update", "");
const nextValue =
valueList.length > 0 ? JSON.stringify(valueList) : "";
if (
TrackHelper.normalize(this.item?.value) ===
TrackHelper.normalize(nextValue)
) {
return;
}
this.$emit("update", nextValue);
}
}
......@@ -94,6 +118,10 @@ export default class CustomizeFormButtonSelect extends Vue {
border-radius: 6px;
}
.selectBut--readonly {
cursor: default;
}
.pitchOn {
color: #185EFE !important;
background: #ecf1ff !important;
......
<template>
<div>
<div class="abnormal-image-upload">
<div class="abnormal-image-upload__title">
异常图片<span class="abnormal-image-upload__required">*</span>
</div>
<div class="abnormal-image-upload__subtitle">
有损伤请拍摄图片,无损伤请忽略
</div>
<div class="hidden-input">
<input
ref="fileInputRef"
......@@ -12,7 +18,8 @@
<div
v-if="(getValidationRules().maxCount || 3) > pickerValue.length"
class="uploadBox"
@click="handlePickFile()"
:class="{ 'uploadBox--readonly': readonly }"
@click="handleUploadBoxClick()"
>
<PlusOutlined class="plusBox" />
<div class="uploadTxt">上传图片</div>
......@@ -24,6 +31,7 @@
>
<!-- 删除按钮 -->
<div
v-if="!readonly"
class="deleteBox"
title="点击删除"
@click="handleDelete(url)"
......@@ -41,17 +49,20 @@ import { Component, Prop, Vue, Watch } from "vue-facing-decorator";
import { uploadFile, isLikelyImageFile } from "@/utils/upload.js";
import { PlusOutlined, CloseCircleOutlined } from "@ant-design/icons-vue";
import { message } from "ant-design-vue";
import { TrackHelper } from "@/common/TrackHelper";
@Component({ components: { PlusOutlined, CloseCircleOutlined } })
export default class CustomizeFormButtonSelectUploadFile extends Vue {
@Prop({ default: () => {} })
item: any = {};
@Prop({ default: false })
readonly = false;
pickerValue: any = [];
// item.resultStatus 变化时,清空选择项
@Watch("item.resultStatus", { deep: true, immediate: true })
watchItem(newValue: any, oldValue: any): void {
@Watch("item.resultStatus")
watchItem(newValue: boolean): void {
if (newValue) {
this.pickerValue = [];
this.updateData();
......@@ -79,6 +90,13 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue {
return JSON.parse(this.item.validationRules || "{}");
}
handleUploadBoxClick() {
if (this.readonly) {
return;
}
this.handlePickFile();
}
//点击上传文件
handlePickFile() {
this.$refs.fileInputRef?.click();
......@@ -129,16 +147,49 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue {
}
updateData() {
if (this.pickerValue.length > 0) {
this.$emit("update", JSON.stringify(this.pickerValue));
} else {
this.$emit("update", "");
const nextValue =
this.pickerValue.length > 0
? JSON.stringify(this.pickerValue)
: "";
if (
TrackHelper.normalize(this.item?.uploadValue) ===
TrackHelper.normalize(nextValue)
) {
return;
}
this.$emit("update", nextValue);
}
}
</script>
<style scoped lang="less">
.abnormal-image-upload {
width: 100%;
float: left;
margin-top: 8px;
}
.abnormal-image-upload__title {
font-size: 14px;
font-weight: 500;
line-height: 22px;
color: #2f3133;
}
.abnormal-image-upload__required {
margin-left: 4px;
color: #eb4e4e;
}
.abnormal-image-upload__subtitle {
margin-top: 4px;
margin-bottom: 12px;
font-size: 12px;
font-weight: 400;
line-height: 20px;
color: #777c85;
}
.hidden-input {
position: absolute;
width: 0;
......@@ -165,6 +216,12 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue {
border-radius: 6px;
cursor: pointer;
}
.uploadBox--readonly {
cursor: default;
pointer-events: none;
}
.uploadBox :deep(.ant-image),
.uploadBox :deep(.ant-image-img) {
width: 100%;
......
......@@ -16,7 +16,8 @@
<div
v-if="(getValidationRules().maxCount || 3) > pickerValue.length"
class="uploadBox"
@click="handlePickFile()"
:class="{ 'uploadBox--readonly': readonly }"
@click="handleUploadBoxClick()"
>
<PlusOutlined class="plusBox" />
<div class="uploadTxt">
......@@ -34,6 +35,7 @@
>
<!-- 删除按钮 -->
<div
v-if="!readonly"
class="deleteBox"
title="点击删除"
@click="handleDelete(url)"
......@@ -84,11 +86,14 @@ import { Component, Prop, Vue } from "vue-facing-decorator";
import { uploadFile, isLikelyImageFile, isLikelyVideoFile } from "@/utils/upload.js";
import { PlusOutlined, CloseCircleOutlined } from "@ant-design/icons-vue";
import { message } from "ant-design-vue";
import { TrackHelper } from "@/common/TrackHelper";
@Component({ components: { PlusOutlined, CloseCircleOutlined } })
export default class CustomizeFormUploadFile extends Vue {
@Prop({ default: () => {} })
item: any = {};
@Prop({ default: false })
readonly = false;
pickerValue: any = [];
......@@ -112,6 +117,13 @@ export default class CustomizeFormUploadFile extends Vue {
return JSON.parse(this.item.validationRules || "{}");
}
handleUploadBoxClick() {
if (this.readonly) {
return;
}
this.handlePickFile();
}
//点击上传文件
handlePickFile() {
this.$refs.fileInputRef?.click();
......@@ -167,11 +179,17 @@ export default class CustomizeFormUploadFile extends Vue {
}
updateData() {
if (this.pickerValue.length > 0) {
this.$emit("update", JSON.stringify(this.pickerValue));
} else {
this.$emit("update", "");
const nextValue =
this.pickerValue.length > 0
? JSON.stringify(this.pickerValue)
: "";
if (
TrackHelper.normalize(this.item?.value) ===
TrackHelper.normalize(nextValue)
) {
return;
}
this.$emit("update", nextValue);
}
previewVideo(url: string) {
......@@ -212,6 +230,11 @@ export default class CustomizeFormUploadFile extends Vue {
border-radius: 6px;
cursor: pointer;
}
.uploadBox--readonly {
cursor: default;
pointer-events: none;
}
.uploadBox :deep(.ant-image),
.uploadBox :deep(.ant-image-img) {
width: 100%;
......
......@@ -53,6 +53,7 @@
import { Component, Vue } from "vue-facing-decorator";
import { DetectionController } from "@/api/DetectionController";
import { CopyOutlined } from "@ant-design/icons-vue";
import { copyText } from "@/utils/copyText";
import { message } from "ant-design-vue";
import { h, type VNode } from "vue";
......@@ -191,7 +192,7 @@ export default class OperationLog extends Vue {
return;
}
try {
await navigator.clipboard.writeText(text);
await copyText(text);
message.success("复制成功");
} catch {
message.error("复制失败");
......
......@@ -12,9 +12,10 @@
v-model:value="postData.exteriorScore"
:min="0"
:max="100"
:step="0.01"
:precision="2"
:step="1"
:precision="0"
:controls="false"
:disabled="readonly"
class="score-value-input"
placeholder="请输入"
/>
......@@ -28,7 +29,8 @@
v-model:value="postData.exteriorScore"
:min="0"
:max="100"
:step="0.01"
:step="1"
:disabled="readonly"
/>
</div>
</div>
......@@ -41,6 +43,7 @@
placeholder="请说明外观主要扣分项,如:全车多处划痕,右后门有钣金修复."
:auto-size="{ minRows: 3, maxRows: 5 }"
:maxlength="200"
:disabled="readonly"
show-count
/>
</div>
......@@ -106,8 +109,9 @@
class="selectBut"
:class="{
pitchOn: postData.skeletonLevel == col.value,
'selectBut--readonly': readonly,
}"
@click="postData.skeletonLevel = col.value"
@click="setLevel('skeletonLevel', col.value)"
>
{{ col.text }}
<div
......@@ -125,6 +129,7 @@
placeholder="请说明关键损伤部位和程度,如:右前纵梁头有轻微变形修复"
:auto-size="{ minRows: 3, maxRows: 5 }"
:maxlength="200"
:disabled="readonly"
show-count
/>
</div>
......@@ -190,8 +195,9 @@
class="selectBut"
:class="{
pitchOn: postData.interiorLevel == col.value,
'selectBut--readonly': readonly,
}"
@click="postData.interiorLevel = col.value"
@click="setLevel('interiorLevel', col.value)"
>
{{ col.text }}
<div
......@@ -209,6 +215,7 @@
placeholder="请说明内饰主要瑕疵,如:座椅有轻微磨损,方向盘有污渍。"
:auto-size="{ minRows: 3, maxRows: 5 }"
:maxlength="200"
:disabled="readonly"
show-count
/>
</div>
......@@ -224,10 +231,11 @@
<a-input-number
v-model:value="postData.overallScore"
:min="0"
:max="200"
:step="0.01"
:precision="2"
:max="100"
:step="1"
:precision="0"
:controls="false"
:disabled="readonly"
class="score-value-input"
placeholder="请对车况做整体总结,如:车况良好,仅有正常使痕迹,无重大事故..."
/>
......@@ -241,7 +249,8 @@
v-model:value="postData.overallScore"
:min="0"
:max="100"
:step="0.01"
:step="1"
:disabled="readonly"
/>
</div>
</div>
......@@ -254,12 +263,13 @@
placeholder="请对车辆综合情况进行评价..."
:auto-size="{ minRows: 3, maxRows: 5 }"
:maxlength="150"
:disabled="readonly"
show-count
/>
</div>
</div>
</a-form>
<div class="footer-submit">
<div v-if="!readonly" class="footer-submit">
<a-button type="primary" @click="submitForm()" class="mr-10"
>保存</a-button
>
......@@ -269,7 +279,7 @@
</template>
<script lang="ts">
import { Component, Vue } from "vue-facing-decorator";
import { Component, Prop, Vue } from "vue-facing-decorator";
import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
import { DetectionController } from "@/api/DetectionController";
import { message } from "ant-design-vue";
......@@ -279,6 +289,9 @@ import { TrackHelper } from "@/common/TrackHelper";
components: { TitleTipIcon },
})
export default class TestingScore extends Vue {
@Prop({ default: false })
readonly = false;
columnsList: any = [
{ value: "A", text: "A" },
{ value: "B", text: "B" },
......@@ -374,6 +387,13 @@ export default class TestingScore extends Vue {
initialPostData: Record<string, any> = {};
setLevel(field: string, value: string) {
if (this.readonly) {
return;
}
(this.postData as any)[field] = value;
}
created(): void {
this.getInspectionNodeData();
}
......@@ -388,6 +408,8 @@ export default class TestingScore extends Vue {
if (data.length > 0) {
const inspectionScore = data[0].inspectionScoreVO || {};
this.postData = { ...this.postData, ...inspectionScore };
this.postData.exteriorScore = this.normalizeIntegerScore(this.postData.exteriorScore);
this.postData.overallScore = this.normalizeIntegerScore(this.postData.overallScore);
}
this.snapshotInitialPostData();
});
......@@ -401,6 +423,10 @@ export default class TestingScore extends Vue {
this.initialPostData = snap;
}
hasUnsavedChanges(): boolean {
return this.collectModifiedFieldNames().length > 0;
}
collectModifiedFieldNames(): string[] {
const current: Record<string, any> = {};
Object.keys(this.postData).forEach((k) => {
......@@ -411,6 +437,18 @@ export default class TestingScore extends Vue {
return changed.filter((k) => !ignoreKeys.has(k));
}
/** 将评分规范为 0–100 的整数,无效值返回 null */
normalizeIntegerScore(value: unknown): number | null {
if (value === null || value === undefined || value === "") {
return null;
}
const n = Math.round(Number(value));
if (Number.isNaN(n) || n < 0 || n > 100) {
return null;
}
return n;
}
/** 评分为 0 视为已填写;仅 null / undefined / 空字符串 视为未填 */
isScoreFilled(value: unknown): boolean {
if (value === 0 || value === "0") {
......@@ -475,7 +513,7 @@ export default class TestingScore extends Vue {
return;
}
if (!this.postData.exteriorComment) {
message.error("请说明外观主要扣分项");
message.error("请输入外观评分的评分依据");
return;
}
if (!this.postData.skeletonLevel) {
......@@ -483,7 +521,7 @@ export default class TestingScore extends Vue {
return;
}
if (!this.postData.skeletonComment) {
message.error("请查验车辆骨架相关部位和程度");
message.error("请输入骨架评级的评分依据");
return;
}
if (!this.postData.interiorLevel) {
......@@ -491,7 +529,7 @@ export default class TestingScore extends Vue {
return;
}
if (!this.postData.interiorComment) {
message.error("请查验车辆内饰相关部位和程度");
message.error("请输入内饰评级的评分依据");
return;
}
if (!this.isScoreFilled(this.postData.overallScore)) {
......@@ -499,13 +537,15 @@ export default class TestingScore extends Vue {
return;
}
if (!this.postData.overallComment) {
message.error("请对车辆综合情况进行评价...");
message.error("请输入综合评分的综合评价");
return;
}
const routeData = this.$route.query || {};
const postData = {
...this.postData,
taskId: Number(routeData.id) || 0,
exteriorScore: this.normalizeIntegerScore(this.postData.exteriorScore),
overallScore: this.normalizeIntegerScore(this.postData.overallScore),
};
const modifiedFields = this.collectModifiedFieldNames();
DetectionController.inspectRecordSaveScore(this.axios, postData)
......@@ -828,6 +868,10 @@ export default class TestingScore extends Vue {
overflow: hidden;
}
.selectBut--readonly {
cursor: default;
}
.selectBut {
position: relative;
float: left;
......
......@@ -161,6 +161,7 @@ import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
import VehicleStateTag from "@/views/vehicle/inventory/VehicleStateTag.vue";
import { CopyOutlined } from "@ant-design/icons-vue";
import { message } from "ant-design-vue";
import { copyText } from "@/utils/copyText";
@Component({
components: { TitleDivider, TitleTipIcon, VehicleStateTag, CopyOutlined }
......@@ -174,12 +175,12 @@ export default class DetectionOrderView extends PaginationComponent<Vehicle> {
@Prop({ type: Object, required: true })
inspectionReportResp: any;
async copyCustomText(text) {
async copyCustomText(text: unknown) {
try {
await navigator.clipboard.writeText(text);
message.success('复制成功');
} catch (err) {
message.error('复制失败');
await copyText(text);
message.success("复制成功");
} catch {
message.error("复制失败");
}
}
......
......@@ -199,12 +199,33 @@ export function syncLeafNodeFormValue(
return;
}
if (interactionType === "button_select") {
const entries = list.map((entry) => ({
valueKey: String(entry.valueKey ?? ""),
valueText: String(entry.valueText ?? ""),
}));
if (
interactionType === "button_select" ||
interactionType === "image_upload_and_button_select"
) {
const entries = list
.filter((entry) => entry.interactionType === "button_select")
.map((entry) => ({
valueKey: String(entry.valueKey ?? ""),
valueText: String(entry.valueText ?? ""),
}));
node.value = entries.length > 0 ? JSON.stringify(entries) : "";
if (interactionType === "image_upload_and_button_select") {
const uploadUrls = list
.filter((entry) => entry.interactionType === "image_upload")
.map((entry) => String(entry.valueText ?? ""))
.filter((text) => text !== "");
node.uploadValue =
uploadUrls.length > 0 ? JSON.stringify(uploadUrls) : "";
}
return;
}
if (interactionType === "image_upload" || interactionType === "video_upload") {
const urls = list
.map((entry) => String(entry.valueText ?? ""))
.filter((text) => text !== "");
node.value = urls.length > 0 ? JSON.stringify(urls) : "";
return;
}
......
......@@ -146,7 +146,7 @@ export default class DiscountCouponPage extends PaginationComponent<Vehicle> {
return (this.getPagination().pageIndex - 1) * this.getPagination().pageSize + index + 1;
},
},
{ title: '优惠券ID', dataIndex: 'templateId', key: 'templateId', align: 'left', width: 220, resizable: true, ellipsis: true },
{ title: '优惠券模板ID', dataIndex: 'templateId', key: 'templateId', align: 'left', width: 220, resizable: true, ellipsis: true },
{ title: '优惠券名称', dataIndex: 'templateName', key: 'templateName', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '优惠券有效期', dataIndex: "woId", key: 'woId', align: 'left', width: 200, resizable: true, ellipsis: true },
{ title: '抵扣类型', dataIndex: 'deductionType', key: 'deductionType', align: 'left', width: 170, resizable: true, ellipsis: true },
......@@ -170,7 +170,7 @@ export default class DiscountCouponPage extends PaginationComponent<Vehicle> {
this.init(this.axios, DiscountController.PAGE_COUPON_TEMPLATE)
this.buildQueryForm({
templateName: [null, { label: '优惠券名称', field: 'templateName', placeholder: '请输入优惠券名称', operator: Operator.like }],
templateId: [null, { label: '优惠券ID', field: 'templateId', placeholder: '请输入优惠券ID', operator: Operator.like }],
templateId: [null, { label: '优惠券模板ID', field: 'templateId', placeholder: '请输入优惠券模板ID', operator: Operator.like }],
couponType: [null, { label: '优惠券类型', field: 'couponType', type: 'select', allowClear: true, optionItems: this.couponTypeList, operator: Operator.eq }],
deductionType: [null, { label: '抵扣类型', type: 'select', optionItems: this.deductionTypeList, allowClear: true, field: 'deductionType', operator: Operator.eq }],
status: [null, { label: '状态', field: 'status', type: 'select', allowClear: true, optionItems: this.statusList, operator: Operator.eq }],
......
......@@ -229,6 +229,7 @@ export default class DiscountActivityPage extends PaginationComponent<Vehicle> {
},
{ title: '活动ID / 名称', dataIndex: 'activityName', key: 'activityName', align: 'left', width: 220, resizable: true, ellipsis: true },
{ title: '优惠券ID / 名称', dataIndex: 'templateName', key: 'templateName', align: 'left', width: 200, resizable: true, ellipsis: true },
{ title: '优惠券模板ID', dataIndex: 'couponTemplateId', key: 'couponTemplateId', align: 'left', width: 220, resizable: true, ellipsis: true },
{ title: '发放用户名 / 手机号', dataIndex: 'accountName', key: 'accountName', align: 'left', width: 150, resizable: true, ellipsis: true },
{ title: '发放类型', dataIndex: 'distributionType', key: 'distributionType', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '优惠券状态', dataIndex: 'couponStatus', key: 'couponStatus', align: 'left', width: 150, resizable: true, ellipsis: true },
......
......@@ -62,9 +62,9 @@
<knife4j.version>4.6.0</knife4j.version>
<!-- 仓库地址(抽离统一维护) -->
<company.nexus.url>http://192.168.3.194:9898/nexus/content/groups/public/</company.nexus.url>
<company.nexus.releases.url>http://192.168.3.194:9898/nexus/content/repositories/releases/</company.nexus.releases.url>
<company.nexus.snapshots.url>http://192.168.3.194:9898/nexus/content/repositories/snapshots/</company.nexus.snapshots.url>
<company.nexus.url>http://192.168.3.233/nexus/content/groups/public/</company.nexus.url>
<company.nexus.releases.url>http://192.168.3.233/nexus/content/repositories/releases/</company.nexus.releases.url>
<company.nexus.snapshots.url>http://192.168.3.233/nexus/content/repositories/snapshots/</company.nexus.snapshots.url>
<!-- 插件版本(统一维护) -->
<maven.compiler.plugin.version>3.12.1</maven.compiler.plugin.version>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!