zs 1 năm trước cách đây
mục cha
commit
a286403742
2 tập tin đã thay đổi với 38 bổ sung38 xóa
  1. 19 19
      src/views/system/dict/index.vue
  2. 19 19
      src/views/system/dictData/index.vue

+ 19 - 19
src/views/system/dict/index.vue

@@ -121,25 +121,6 @@ const toSearch = (query: any) => {
 const getProps = (data: any, prop: any) => {
   return _.get(data, prop);
 };
-// 修改是否启用
-const handleChange = (row: any) => {
-  const text = row.is_use === '0' ? '启用' : '停用';
-  ElMessageBox.confirm('确认要"' + text + '""' + row.type + '"吗?', {
-    confirmButtonText: '确定',
-    cancelButtonText: '取消',
-    type: 'warning'
-  })
-    .then(async () => {
-      let res: IQueryResult;
-      if (row._id) res = await dictType.update(row);
-      if (res.errcode == 0) {
-        ElMessage({ type: `success`, message: `修改成功` });
-      }
-    })
-    .catch(() => {
-      row.is_use = row.is_use === '0' ? '1' : '0';
-    });
-};
 // 新增
 const toAdd = () => {
   dialog.value = { title: '信息管理', show: true, type: '1' };
@@ -186,6 +167,25 @@ const searchOther = async () => {
   let res: IQueryResult = await dictData.query({ type: 'is_use' });
   if (res.errcode == 0) is_useList.value = res.data;
 };
+// 修改是否启用
+const handleChange = (row: any) => {
+  const text = row.is_use === '0' ? '启用' : '停用';
+  ElMessageBox.confirm('确认要"' + text + '""' + row.type + '"吗?', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(async () => {
+      let res: IQueryResult;
+      if (row._id) res = await dictType.update(row);
+      if (res.errcode == 0) {
+        ElMessage({ type: `success`, message: `修改成功` });
+      }
+    })
+    .catch(() => {
+      row.is_use = row.is_use === '0' ? '1' : '0';
+    });
+};
 </script>
 <style lang="scss" scoped>
 .main {

+ 19 - 19
src/views/system/dictData/index.vue

@@ -130,25 +130,6 @@ const toEdit = async (data: any) => {
   form.value = data;
   dialog.value = { title: '信息管理', show: true, type: '1' };
 };
-// 修改是否启用
-const handleChange = (row: any) => {
-  const text = row.is_use === '0' ? '启用' : '停用';
-  ElMessageBox.confirm('确认要"' + text + '""' + row.type + '"吗?', {
-    confirmButtonText: '确定',
-    cancelButtonText: '取消',
-    type: 'warning'
-  })
-    .then(async () => {
-      let res: IQueryResult;
-      if (row._id) res = await dictData.update(row);
-      if (res.errcode == 0) {
-        ElMessage({ type: `success`, message: `修改成功` });
-      }
-    })
-    .catch(() => {
-      row.is_use = row.is_use === '0' ? '1' : '0';
-    });
-};
 // 提交保存
 const toSave = async (data: any) => {
   let res: IQueryResult;
@@ -184,6 +165,25 @@ const searchOther = async () => {
 const toBack = () => {
   router.push({ path: '/system/dict' });
 };
+// 修改是否启用
+const handleChange = (row: any) => {
+  const text = row.is_use === '0' ? '启用' : '停用';
+  ElMessageBox.confirm('确认要"' + text + '""' + row.label + '"吗?', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(async () => {
+      let res: IQueryResult;
+      if (row._id) res = await dictData.update(row);
+      if (res.errcode == 0) {
+        ElMessage({ type: `success`, message: `修改成功` });
+      }
+    })
+    .catch(() => {
+      row.is_use = row.is_use === '0' ? '1' : '0';
+    });
+};
 </script>
 <style scoped lang="scss">
 .main {