|
@@ -72,6 +72,7 @@
|
|
|
<!-- 暂存关联列表 -->
|
|
|
<div class="submit-area">
|
|
|
<div class="card">
|
|
|
+ <h3>调整原因<span class="required-star">*</span></h3>
|
|
|
<el-input
|
|
|
v-model="formData.reason"
|
|
|
placeholder="请输入调整原因"
|
|
@@ -326,6 +327,14 @@ const removeTempRelation = (deviceIds: string[]) => {
|
|
|
|
|
|
const submitRelations = async () => {
|
|
|
try {
|
|
|
+ // 校验所有调整原因
|
|
|
+ const hasEmptyReason = tempRelations.value.some(
|
|
|
+ item => !item.reason?.trim()
|
|
|
+ )
|
|
|
+ if (hasEmptyReason) {
|
|
|
+ ElMessage.error('请填写调整原因')
|
|
|
+ return
|
|
|
+ }
|
|
|
// 转换为后端需要的格式
|
|
|
const submitData = tempRelations.value.flatMap(relation => {
|
|
|
return relation.deviceIds.map(deviceId => ({
|
|
@@ -417,4 +426,10 @@ h3 {
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
}
|
|
|
+
|
|
|
+.required-star {
|
|
|
+ color: #ff4d4f;
|
|
|
+ margin-left: 3px;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
</style>
|