소스 검색

物资类型模块取消物资编码的展示

wangyani 9 달 전
부모
커밋
7227885ca1
1개의 변경된 파일294개의 추가작업 그리고 305개의 파일을 삭제
  1. 294 305
      src/views/mes/material/typeofmaterial/index.vue

+ 294 - 305
src/views/mes/material/typeofmaterial/index.vue

@@ -25,16 +25,16 @@
         />
       </el-form-item>
 
-<!--      <el-form-item label="状态" prop="status">-->
-<!--        <el-select v-model="queryParams.status" placeholder="状态">-->
-<!--          <el-option-->
-<!--            v-for="dict in dict.type.material_type_status"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
+      <!--      <el-form-item label="状态" prop="status">-->
+      <!--        <el-select v-model="queryParams.status" placeholder="状态">-->
+      <!--          <el-option-->
+      <!--            v-for="dict in dict.type.material_type_status"-->
+      <!--            :key="dict.value"-->
+      <!--            :label="dict.label"-->
+      <!--            :value="dict.value"-->
+      <!--          />-->
+      <!--        </el-select>-->
+      <!--      </el-form-item>-->
       <el-form-item style="margin-left: 50px">
         <el-button
           v-no-more-click
@@ -42,17 +42,15 @@
           icon="el-icon-search"
           size="mini"
           @click="handleQuery"
-        >搜索
-        </el-button
-        >
+          >搜索
+        </el-button>
         <el-button
           v-no-more-click
           icon="el-icon-refresh"
           size="mini"
           @click="resetQuery"
-        >重置
-        </el-button
-        >
+          >重置
+        </el-button>
       </el-form-item>
     </el-form>
     <el-button
@@ -62,9 +60,8 @@
       icon="el-icon-plus"
       v-hasPermi="['mes:mat:type:add']"
       @click="handleAdd"
-    >新增
-    </el-button
-    >
+      >新增
+    </el-button>
     <el-table
       v-loading="loading"
       :data="machinerytypeList"
@@ -72,49 +69,46 @@
       default-expand-all
       :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
     >
-      <el-table-column
+      <!-- <el-table-column
         label="物资类型编码"
         align="center"
         prop="materialsTypeCode"
-      />
+      /> -->
       <el-table-column
         label="物资类型名称"
         align="center"
         prop="materialsTypeName"
         :show-overflow-tooltip="true"
       />
-<!--      <el-table-column label="状态" align="center" prop="status">-->
-<!--        <template slot-scope="scope">-->
-<!--          <el-tag v-if="scope.row.status == 'y'">启用</el-tag>-->
-<!--          <el-tag v-else type="danger">禁用</el-tag>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="出借时长" align="center" prop="loanDuration">-->
-<!--        <template slot-scope="scope">-->
-<!--          <span>{{ formattedTime(scope.row.loanDuration) }}</span>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="提醒时间" align="center" prop="reminderTime">-->
-<!--        <template slot-scope="scope">-->
-<!--          <span>{{ formattedTime(scope.row.reminderTime) }}</span>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="报警时间" align="center" prop="timeoutAlarm">-->
-<!--        <template slot-scope="scope">-->
-<!--          <span>{{ formattedTime(scope.row.timeoutAlarm) }}</span>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-      <el-table-column
-        label="物资类型图标"
-        prop="materialsTypeIcon"
-      >
+      <!--      <el-table-column label="状态" align="center" prop="status">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <el-tag v-if="scope.row.status == 'y'">启用</el-tag>-->
+      <!--          <el-tag v-else type="danger">禁用</el-tag>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <!--      <el-table-column label="出借时长" align="center" prop="loanDuration">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <span>{{ formattedTime(scope.row.loanDuration) }}</span>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <!--      <el-table-column label="提醒时间" align="center" prop="reminderTime">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <span>{{ formattedTime(scope.row.reminderTime) }}</span>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <!--      <el-table-column label="报警时间" align="center" prop="timeoutAlarm">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <span>{{ formattedTime(scope.row.timeoutAlarm) }}</span>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <el-table-column label="物资类型图标" prop="materialsTypeIcon">
         <template slot-scope="scope">
           <div class="img-box" v-if="scope.row.materialsTypeIcon">
             <el-image
               style="width: 50px; height: 50px"
               :preview-teleported="true"
               class="images"
-              :hide-on-click-modal=true
+              :hide-on-click-modal="true"
               :src="scope.row.materialsTypeIcon"
               :zoom-rate="1.2"
               :preview-src-list="[scope.row.materialsTypeIcon]"
@@ -127,17 +121,14 @@
           <span v-else>-</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="物资类型缩略图"
-        prop="materialsTypePicture"
-      >
+      <el-table-column label="物资类型缩略图" prop="materialsTypePicture">
         <template slot-scope="scope">
           <div class="img-box" v-if="scope.row.materialsTypePicture">
             <el-image
               style="width: 50px; height: 50px"
               :preview-teleported="true"
               class="images"
-              :hide-on-click-modal=true
+              :hide-on-click-modal="true"
               :src="scope.row.materialsTypePicture"
               :zoom-rate="1.2"
               :preview-src-list="[scope.row.materialsTypePicture]"
@@ -151,16 +142,16 @@
         </template>
       </el-table-column>
 
-<!--      <el-table-column-->
-<!--        label="是否需要归还"-->
-<!--        align="center"-->
-<!--        prop="restitutionRequired"-->
-<!--      >-->
-<!--        <template slot-scope="scope">-->
-<!--          <el-tag v-if="scope.row.restitutionRequired == '1'">是</el-tag>-->
-<!--          <el-tag v-else type="danger">否</el-tag>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
+      <!--      <el-table-column-->
+      <!--        label="是否需要归还"-->
+      <!--        align="center"-->
+      <!--        prop="restitutionRequired"-->
+      <!--      >-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <el-tag v-if="scope.row.restitutionRequired == '1'">是</el-tag>-->
+      <!--          <el-tag v-else type="danger">否</el-tag>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
       <el-table-column
         label="操作"
         align="center"
@@ -174,9 +165,8 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['mes:mat:type:edit']"
-          >编辑
-          </el-button
-          >
+            >编辑
+          </el-button>
           <el-button
             v-no-more-click
             size="mini"
@@ -184,9 +174,8 @@
             icon="el-icon-plus"
             v-hasPermi="['mes:mat:type:add']"
             @click="handleAdd(scope.row)"
-          >新增
-          </el-button
-          >
+            >新增
+          </el-button>
           <!--           v-if="scope.row.parentId != 0"-->
           <el-button
             v-no-more-click
@@ -195,9 +184,8 @@
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['mes:mat:type:remove']"
-          >删除
-          </el-button
-          >
+            >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -244,7 +232,11 @@
           />
         </el-form-item>
         <el-form-item label="物资规格" prop="propertyId">
-          <el-select style="width: 318px" v-model="form.propertyIds" placeholder="请选择规格">
+          <el-select
+            style="width: 318px"
+            v-model="form.propertyIds"
+            placeholder="请选择规格"
+          >
             <el-option
               v-for="property in PropertyList"
               :key="property.propertyId"
@@ -262,7 +254,6 @@
                 :fileSize="5"
                 @onUploaded="handleImgUplaoded"
                 @onRemoved="handleImgRemoved"
-
               ></ImageUploadSingle>
             </el-form-item>
           </el-col>
@@ -297,93 +288,92 @@
             style="width: 420px"
           />
         </el-form-item>
-<!--        <el-form-item label="是否需要归还" prop="restitutionRequired">-->
-<!--          <el-radio-group v-model="form.restitutionRequired" @change="changeLabel">-->
-<!--            <el-radio :label="1">需要归还</el-radio>-->
-<!--            <el-radio :label="2">不需要归还</el-radio>-->
-<!--          </el-radio-group>-->
-<!--        </el-form-item>-->
-<!--        <el-form-item label="借用时长" prop="loanDuration" v-if="this.form.restitutionRequired==1">-->
-<!--          <div class="time-picker">-->
-<!--            <div-->
-<!--              class="time-unit"-->
-<!--              v-for="(unit, index) in timeUnits"-->
-<!--              :key="index"-->
-<!--            >-->
-<!--              <select-->
-<!--                v-model="timeValues.loanDuration[unit.name]"-->
-<!--                :id="unit.name"-->
-<!--              >-->
-<!--                <option-->
-<!--                  v-for="option in unit.options"-->
-<!--                  :key="option"-->
-<!--                  :value="option"-->
-<!--                >-->
-<!--                  {{ option }}-->
-<!--                </option>-->
-<!--              </select>-->
-<!--              <label :for="unit.name">{{ unit.label }}</label>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </el-form-item>-->
-<!--        <el-form-item label="提醒设置" prop="reminderTime" v-if="this.form.restitutionRequired==1">-->
-<!--          <div class="time-picker">-->
-<!--            <div-->
-<!--              class="time-unit"-->
-<!--              v-for="(unit, index) in timeUnits"-->
-<!--              :key="index"-->
-<!--            >-->
-<!--              <select-->
-<!--                v-model="timeValues.reminderTime[unit.name]"-->
-<!--                :id="unit.name"-->
-<!--              >-->
-<!--                <option-->
-<!--                  v-for="option in unit.options"-->
-<!--                  :key="option"-->
-<!--                  :value="option"-->
-<!--                >-->
-<!--                  {{ option }}-->
-<!--                </option>-->
-<!--              </select>-->
-<!--              <label :for="unit.name">{{ unit.label }}</label>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </el-form-item>-->
-<!--        <el-form-item label="超时报警" prop="timeoutAlarm" v-if="this.form.restitutionRequired==1">-->
-<!--          <div class="time-picker">-->
-<!--            <div-->
-<!--              class="time-unit"-->
-<!--              v-for="(unit, index) in timeUnits"-->
-<!--              :key="index"-->
-<!--            >-->
-<!--              <select-->
-<!--                v-model="timeValues.timeoutAlarm[unit.name]"-->
-<!--                :id="unit.name"-->
-<!--              >-->
-<!--                <option-->
-<!--                  v-for="option in unit.options"-->
-<!--                  :key="option"-->
-<!--                  :value="option"-->
-<!--                >-->
-<!--                  {{ option }}-->
-<!--                </option>-->
-<!--              </select>-->
-<!--              <label :for="unit.name">{{ unit.label }}</label>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </el-form-item>-->
-<!--        <el-form-item label="状态" prop="status">-->
-<!--          <el-radio-group v-model="form.status">-->
-<!--            <el-radio :label="'y'">启用</el-radio>-->
-<!--            <el-radio :label="'n'">禁用</el-radio>-->
-<!--          </el-radio-group>-->
-<!--        </el-form-item>-->
+        <!--        <el-form-item label="是否需要归还" prop="restitutionRequired">-->
+        <!--          <el-radio-group v-model="form.restitutionRequired" @change="changeLabel">-->
+        <!--            <el-radio :label="1">需要归还</el-radio>-->
+        <!--            <el-radio :label="2">不需要归还</el-radio>-->
+        <!--          </el-radio-group>-->
+        <!--        </el-form-item>-->
+        <!--        <el-form-item label="借用时长" prop="loanDuration" v-if="this.form.restitutionRequired==1">-->
+        <!--          <div class="time-picker">-->
+        <!--            <div-->
+        <!--              class="time-unit"-->
+        <!--              v-for="(unit, index) in timeUnits"-->
+        <!--              :key="index"-->
+        <!--            >-->
+        <!--              <select-->
+        <!--                v-model="timeValues.loanDuration[unit.name]"-->
+        <!--                :id="unit.name"-->
+        <!--              >-->
+        <!--                <option-->
+        <!--                  v-for="option in unit.options"-->
+        <!--                  :key="option"-->
+        <!--                  :value="option"-->
+        <!--                >-->
+        <!--                  {{ option }}-->
+        <!--                </option>-->
+        <!--              </select>-->
+        <!--              <label :for="unit.name">{{ unit.label }}</label>-->
+        <!--            </div>-->
+        <!--          </div>-->
+        <!--        </el-form-item>-->
+        <!--        <el-form-item label="提醒设置" prop="reminderTime" v-if="this.form.restitutionRequired==1">-->
+        <!--          <div class="time-picker">-->
+        <!--            <div-->
+        <!--              class="time-unit"-->
+        <!--              v-for="(unit, index) in timeUnits"-->
+        <!--              :key="index"-->
+        <!--            >-->
+        <!--              <select-->
+        <!--                v-model="timeValues.reminderTime[unit.name]"-->
+        <!--                :id="unit.name"-->
+        <!--              >-->
+        <!--                <option-->
+        <!--                  v-for="option in unit.options"-->
+        <!--                  :key="option"-->
+        <!--                  :value="option"-->
+        <!--                >-->
+        <!--                  {{ option }}-->
+        <!--                </option>-->
+        <!--              </select>-->
+        <!--              <label :for="unit.name">{{ unit.label }}</label>-->
+        <!--            </div>-->
+        <!--          </div>-->
+        <!--        </el-form-item>-->
+        <!--        <el-form-item label="超时报警" prop="timeoutAlarm" v-if="this.form.restitutionRequired==1">-->
+        <!--          <div class="time-picker">-->
+        <!--            <div-->
+        <!--              class="time-unit"-->
+        <!--              v-for="(unit, index) in timeUnits"-->
+        <!--              :key="index"-->
+        <!--            >-->
+        <!--              <select-->
+        <!--                v-model="timeValues.timeoutAlarm[unit.name]"-->
+        <!--                :id="unit.name"-->
+        <!--              >-->
+        <!--                <option-->
+        <!--                  v-for="option in unit.options"-->
+        <!--                  :key="option"-->
+        <!--                  :value="option"-->
+        <!--                >-->
+        <!--                  {{ option }}-->
+        <!--                </option>-->
+        <!--              </select>-->
+        <!--              <label :for="unit.name">{{ unit.label }}</label>-->
+        <!--            </div>-->
+        <!--          </div>-->
+        <!--        </el-form-item>-->
+        <!--        <el-form-item label="状态" prop="status">-->
+        <!--          <el-radio-group v-model="form.status">-->
+        <!--            <el-radio :label="'y'">启用</el-radio>-->
+        <!--            <el-radio :label="'n'">禁用</el-radio>-->
+        <!--          </el-radio-group>-->
+        <!--        </el-form-item>-->
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-no-more-click type="primary" @click="submitForm"
-        >确 定
-        </el-button
-        >
+          >确 定
+        </el-button>
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -396,18 +386,18 @@ import {
   addMaterialsType,
   updateMaterialsType,
   selectMaterialsTypeById,
-  deleteMaterialsType
-} from '@/api/mes/material/typeindex'
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-import { genCode } from '@/api/system/autocode/rule'
-import { PropertyPage } from '@/api/mes/standard'
+  deleteMaterialsType,
+} from "@/api/mes/material/typeindex";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { genCode } from "@/api/system/autocode/rule";
+import { PropertyPage } from "@/api/mes/standard";
 
 export default {
-  name: 'hardwareType',
-  dicts: ['material_type_status'],
+  name: "hardwareType",
+  dicts: ["material_type_status"],
   components: {
-    Treeselect
+    Treeselect,
   },
   data() {
     return {
@@ -422,9 +412,9 @@ export default {
       machinerytypeList: [],
       // 设备类型树选项
       machinerytypeOptions: [],
-      PropertyList: [],//属性名 物资规格
+      PropertyList: [], //属性名 物资规格
       // 弹出层标题
-      title: '',
+      title: "",
       // 是否显示弹出层
       open: false,
       // 总条数
@@ -434,14 +424,14 @@ export default {
         current: 1,
         size: -1,
         materialsTypeCode: null,
-        materialsTypeName: null
+        materialsTypeName: null,
       },
       // 表单参数
       form: {
         parentId: 0,
-        ancestors: '0',
+        ancestors: "0",
         // restitutionRequired: 2, // 默认为 "不需要归还"
-        status: 'y' // 默认为 "启用"
+        status: "y", // 默认为 "启用"
       },
       EditId: null, //编辑传递id
       // 借用时长
@@ -450,286 +440,285 @@ export default {
           days: 0,
           hours: 0,
           minutes: 0,
-          seconds: 0
+          seconds: 0,
         },
         loanDuration: {
           days: 0,
           hours: 0,
           minutes: 0,
-          seconds: 0
+          seconds: 0,
         },
         timeoutAlarm: {
           days: 0,
           hours: 0,
           minutes: 0,
-          seconds: 0
-        }
+          seconds: 0,
+        },
       },
       timeUnits: [
         {
-          name: 'days',
-          label: '天',
-          options: Array.from({ length: 31 }, (_, i) => i)
+          name: "days",
+          label: "天",
+          options: Array.from({ length: 31 }, (_, i) => i),
         },
         {
-          name: 'hours',
-          label: '时',
-          options: Array.from({ length: 24 }, (_, i) => i)
+          name: "hours",
+          label: "时",
+          options: Array.from({ length: 24 }, (_, i) => i),
         },
         {
-          name: 'minutes',
-          label: '分',
-          options: Array.from({ length: 60 }, (_, i) => i)
+          name: "minutes",
+          label: "分",
+          options: Array.from({ length: 60 }, (_, i) => i),
         },
         {
-          name: 'seconds',
-          label: '秒',
-          options: Array.from({ length: 60 }, (_, i) => i)
-        }
+          name: "seconds",
+          label: "秒",
+          options: Array.from({ length: 60 }, (_, i) => i),
+        },
       ],
       // 表单校验
       rules: {
         materialsTypeCode: [
-          { required: true, message: '物资类型编码不能为空', trigger: 'blur' }
+          { required: true, message: "物资类型编码不能为空", trigger: "blur" },
         ],
         materialsTypeName: [
-          { required: true, message: '物资类型名称不能为空', trigger: 'blur' }
-        ]
-      }
-    }
+          { required: true, message: "物资类型名称不能为空", trigger: "blur" },
+        ],
+      },
+    };
   },
   created() {
-    this.getList()
+    this.getList();
   },
   methods: {
     /** 查询设备类型列表 */
     getList() {
-      this.loading = true
+      this.loading = true;
       listType(this.queryParams).then((response) => {
-        console.log(response, '物资类型列表')
+        console.log(response, "物资类型列表");
         this.machinerytypeList = this.handleTree(
           response.data.records,
-          'materialsTypeId',
-          'parentId',
-          'children'
-        )
-        this.loading = false
-        console.log(this.machinerytypeList, 'machinerytypeList')
-      })
+          "materialsTypeId",
+          "parentId",
+          "children"
+        );
+        this.loading = false;
+        console.log(this.machinerytypeList, "machinerytypeList");
+      });
     },
     /** 转换数据结构 */
     normalizer(node) {
       if (node.children && !node.children.length) {
-        delete node.children
+        delete node.children;
       }
       return {
         id: node.materialsTypeId,
         label: node.materialsTypeName,
-        children: node.children
-      }
+        children: node.children,
+      };
     },
     /** 查询类型下拉树结构 */
     getTreeselect() {
       const data = {
         current: 1,
-        size: 99999
-      }
+        size: 99999,
+      };
       listType(data).then((response) => {
         this.machinerytypeOptions = this.handleTree(
           response.data.records,
-          'materialsTypeId',
-          'parentId',
-          'children'
-        )
-      })
+          "materialsTypeId",
+          "parentId",
+          "children"
+        );
+      });
       PropertyPage(data).then((response) => {
-        console.log(response, '获取物资属性名 ')
-        this.PropertyList = response.data.records
-      })
+        console.log(response, "获取物资属性名 ");
+        this.PropertyList = response.data.records;
+      });
     },
     // 取消按钮
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     // 表单重置
     reset() {
       this.form = {
-        status: '',
-        materialsTypeCode: '',
-        materialsTypeName: ''
-      }
-      this.resetForm('form')
+        status: "",
+        materialsTypeCode: "",
+        materialsTypeName: "",
+      };
+      this.resetForm("form");
       // 重置所有时间值
       const resetTimeValues = (timeObj) => {
-        timeObj.days = 0
-        timeObj.hours = 0
-        timeObj.minutes = 0
-        timeObj.seconds = 0
-      }
+        timeObj.days = 0;
+        timeObj.hours = 0;
+        timeObj.minutes = 0;
+        timeObj.seconds = 0;
+      };
 
-      resetTimeValues(this.timeValues.reminderTime)
-      resetTimeValues(this.timeValues.loanDuration)
-      resetTimeValues(this.timeValues.timeoutAlarm)
-      this.autoGenFlag = false
+      resetTimeValues(this.timeValues.reminderTime);
+      resetTimeValues(this.timeValues.loanDuration);
+      resetTimeValues(this.timeValues.timeoutAlarm);
+      this.autoGenFlag = false;
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.getList()
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.handleQuery()
+      this.resetForm("queryForm");
+      this.handleQuery();
     },
     // 层级计数器函数
     handleChange(value) {
-      console.log(value)
+      console.log(value);
     },
     /** 新增按钮操作 */
     handleAdd(row) {
-      this.reset()
-      this.getTreeselect()
+      this.reset();
+      this.getTreeselect();
       if (row != null && row.materialsTypeId) {
-        this.form.parentId = row.materialsTypeId
-        this.form.ancestors = row.ancestors + ',' + row.materialsTypeId
+        this.form.parentId = row.materialsTypeId;
+        this.form.ancestors = row.ancestors + "," + row.materialsTypeId;
       } else {
-        this.form.parentId = null
-        this.form.ancestors = 0
+        this.form.parentId = null;
+        this.form.ancestors = 0;
       }
       // this.form.restitutionRequired = 2
       // this.form.status = 'y'
-      this.open = true
-      this.title = '新增物资类型'
+      this.open = true;
+      this.title = "新增物资类型";
     },
     changeLabel() {
-      this.$forceUpdate()
+      this.$forceUpdate();
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      console.log(row, row.materialsTypeId, 'row')
-      this.reset()
-      this.getTreeselect()
+      console.log(row, row.materialsTypeId, "row");
+      this.reset();
+      this.getTreeselect();
       if (row != null) {
-        this.form.parentId = row.materialsTypeId
+        this.form.parentId = row.materialsTypeId;
       }
 
       selectMaterialsTypeById(row.materialsTypeId).then((response) => {
-        this.form = response.data
+        this.form = response.data;
         if (this.form.parentId == 0) {
-          this.form.parentId = null
+          this.form.parentId = null;
         }
-        console.log(response.data.reminderTime, '修改')
+        console.log(response.data.reminderTime, "修改");
 
         const convertTime = (time) => ({
           days: Math.floor(time / (24 * 60 * 60)),
           hours: Math.floor((time % (24 * 60 * 60)) / (60 * 60)),
           minutes: Math.floor((time % (60 * 60)) / 60),
-          seconds: time % 60
-        })
+          seconds: time % 60,
+        });
 
-        this.timeValues.reminderTime = convertTime(response.data.reminderTime)
-        this.timeValues.loanDuration = convertTime(response.data.loanDuration)
-        this.timeValues.timeoutAlarm = convertTime(response.data.timeoutAlarm)
-        this.open = true
-        this.title = '编辑物资类型'
-      })
+        this.timeValues.reminderTime = convertTime(response.data.reminderTime);
+        this.timeValues.loanDuration = convertTime(response.data.loanDuration);
+        this.timeValues.timeoutAlarm = convertTime(response.data.timeoutAlarm);
+        this.open = true;
+        this.title = "编辑物资类型";
+      });
     },
     // 时间转换
     formattedTime(totalSeconds) {
-      const days = Math.floor(totalSeconds / (24 * 60 * 60))
-      const hours = Math.floor((totalSeconds % (24 * 60 * 60)) / (60 * 60))
-      const minutes = Math.floor((totalSeconds % (60 * 60)) / 60)
-      const seconds = totalSeconds % 60
+      const days = Math.floor(totalSeconds / (24 * 60 * 60));
+      const hours = Math.floor((totalSeconds % (24 * 60 * 60)) / (60 * 60));
+      const minutes = Math.floor((totalSeconds % (60 * 60)) / 60);
+      const seconds = totalSeconds % 60;
 
-      const parts = []
-      if (days > 0) parts.push(`${days}天`)
-      if (hours > 0) parts.push(`${hours}小时`)
-      if (minutes > 0) parts.push(`${minutes}分钟`)
-      if (seconds > 0) parts.push(`${seconds}秒`)
+      const parts = [];
+      if (days > 0) parts.push(`${days}天`);
+      if (hours > 0) parts.push(`${hours}小时`);
+      if (minutes > 0) parts.push(`${minutes}分钟`);
+      if (seconds > 0) parts.push(`${seconds}秒`);
 
-      return parts.join(' ')
+      return parts.join(" ");
     },
     /** 提交按钮 */
     submitForm() {
       const calculateTotalSeconds = ({ days, hours, minutes, seconds }) =>
-        ((days * 24 + hours) * 60 + minutes) * 60 + seconds
+        ((days * 24 + hours) * 60 + minutes) * 60 + seconds;
 
       this.form.reminderTime = calculateTotalSeconds(
         this.timeValues.reminderTime
-      )
+      );
       this.form.loanDuration = calculateTotalSeconds(
         this.timeValues.loanDuration
-      )
+      );
       this.form.timeoutAlarm = calculateTotalSeconds(
         this.timeValues.timeoutAlarm
-      )
+      );
 
-      this.$refs['form'].validate((valid) => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.materialsTypeId != null) {
             updateMaterialsType(this.form).then((response) => {
-              this.$modal.msgSuccess('修改成功')
-              this.open = false
-              this.getList()
-            })
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
           } else {
             if (this.form.parentId == null) {
-              this.form.parentId = 0
+              this.form.parentId = 0;
             }
             addMaterialsType(this.form).then((response) => {
-              this.$modal.msgSuccess('新增成功')
-              this.open = false
-              this.getList()
-            })
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
         }
-      })
+      });
     },
     //自动生成编码
     handleAutoGenChange(autoGenFlag) {
       if (autoGenFlag) {
-        genCode('MATERIALS_TYPE_CODE').then((response) => {
-          this.form.materialsTypeCode = response
-        })
+        genCode("MATERIALS_TYPE_CODE").then((response) => {
+          this.form.materialsTypeCode = response;
+        });
       } else {
-        this.form.materialsTypeCode = null
+        this.form.materialsTypeCode = null;
       }
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const materialsTypeIds = row.materialsTypeId
-      const materialsTypeCodes = row.materialsTypeCode
+      const materialsTypeIds = row.materialsTypeId;
+      const materialsTypeCodes = row.materialsTypeCode;
       this.$modal
         .confirm('是否删除编码为"' + materialsTypeCodes + '"的数据项?')
-        .then(function() {
-          return deleteMaterialsType(materialsTypeIds)
+        .then(function () {
+          return deleteMaterialsType(materialsTypeIds);
         })
         .then(() => {
-          this.getList()
-          this.$modal.msgSuccess('删除成功')
-        })
-        .catch(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
         })
+        .catch(() => {});
     },
     //图片上传成功
     handleImgUplaoded(imgUrl) {
-      this.form.materialsTypePicture = imgUrl[0].url
+      this.form.materialsTypePicture = imgUrl[0].url;
     },
     //图片移除
     handleImgRemoved(imgUrl) {
-      this.form.materialsTypePicture = null
+      this.form.materialsTypePicture = null;
     },
     //图标上传成功
     handleIconUplaoded(imgUrl) {
-      this.form.materialsTypeIcon = imgUrl[0].url
+      this.form.materialsTypeIcon = imgUrl[0].url;
     },
     // 图标移除
     handleIconRemoved(imgUrl) {
-      this.form.materialsTypeIcon = null
-    }
-  }
-}
+      this.form.materialsTypeIcon = null;
+    },
+  },
+};
 </script>
 
 <style scoped lang="scss">
@@ -758,7 +747,7 @@ export default {
     left: 30%;
     z-index: 100;
     color: white;
-    pointer-events: none
+    pointer-events: none;
   }
 }