Procházet zdrojové kódy

物资清单中状态查询条件重置没有清空;物资清单编辑清空后修改成功页面上名称未改变

wyn před 2 měsíci
rodič
revize
88e780756f

+ 13 - 8
src/views/material/information/MaterialForm.vue

@@ -16,6 +16,7 @@
               clearable
               placeholder="请选择绑定物资柜"
               class="!w-348px"
+              @clear="handleClearCabinet"
             >
               <el-option
                 v-for="dict in cabinets"
@@ -88,12 +89,12 @@
 <!--              <h3>{{ property.propertyName }}</h3>-->
               <div class="property-values">
                 <div
-                  v-for="value in PropertyValueList.filter((v) => v.propertyId === property.id)"
+                  v-for="value in PropertyValueList.filter((v) => v.propertyId == property.id)"
                   :key="value.id"
                   :class="[
                     'property-value',
                     {
-                      selected: selectedValues[property.id] === value.id
+                      selected: selectedValues[property.id] == value.id
                     }
                   ]"
                   @click="selectValue(property.id, value.id)"
@@ -269,13 +270,17 @@ onMounted(async () => {
   const data = await MaterialTypeApi.listType(params)
   materialtypeOptions.value = handleTree(data.list, 'id', 'parentId')
   const cabinet = await MaterialCabinetApi.listMaterialsCabinet(params)
-  cabinets.value = cabinet.list.map((cabinet) => {
-    return {
-      value: cabinet.id,
-      label: cabinet.cabinetName
-    }
-  })
+  cabinets.value = cabinet.list.map((cabinet) => ({
+    value: cabinet.id,
+    label: cabinet.cabinetName
+  })).concat({ value: 0, label: '空' })
 })
+
+// 清空时执行
+const handleClearCabinet = () => {
+  formData.value.materialsCabinetId = 0
+}
+
 // 监听物资类型变化
 watch(
   () => formData.value.materialsTypeId,

+ 2 - 0
src/views/material/information/index.vue

@@ -345,6 +345,7 @@ const queryParams = reactive({
   supplier: undefined,
   expirationDate: undefined,
   recordId: undefined,
+  status: undefined,
   propertyId: undefined
 })
 
@@ -517,6 +518,7 @@ const resetQuery = () => {
   queryParams.supplier = undefined
   queryParams.propertyId = undefined
   queryParams.recordId = undefined
+  queryParams.status = undefined
   handleQuery()
 }