lcl 7 ماه پیش
والد
کامیت
15aa1df3ef

+ 13 - 16
src/views/pri/priLog/hook.tsx

@@ -13,12 +13,12 @@ export function usePriLog() {
 
     UrlList = await getGroupUrl(["prizeSet"]);
     onSearch(ruleFormRef.value);
-  listIdQuery();
+    listIdQuery();
 
   });
   let form = reactive({
-  listId:null, //配置ID
-  batchNo:"", //批次号
+    listId: null, //配置ID
+    batchNo: "", //批次号
 
 
   });
@@ -53,9 +53,6 @@ export function usePriLog() {
       label: "配置ID",
       prop: "listId",
       minWidth: 200
-      formatter: ({ listId }) => {
-        return listIdOptionList.find(item => item.id == listId).label
-      },
     },
     {
       label: "发放对象",
@@ -134,11 +131,11 @@ export function usePriLog() {
       }
     })
   }
-    // 配置ID选项数据
-    const listIdOptionList = ref([]);
+  // 配置ID选项数据
+  const listIdOptionList = ref([]);
   //获取配置ID数据
   async function listIdQuery() {
-    const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriListDic.method, url: UrlList.prizeSet.prigetPriListDic.url, params: { } });
+    const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriListDic.method, url: UrlList.prizeSet.prigetPriListDic.url, params: {} });
     if (status === 1) {
       listIdOptionList.value = data.records;
     }
@@ -146,8 +143,8 @@ export function usePriLog() {
 
 
 
-  
-    // 删除
+
+  // 删除
   function handleDelete(row) {
     ElMessageBox.confirm(
       `是否删除该奖励发放日志? `,
@@ -167,20 +164,20 @@ export function usePriLog() {
         onSearch(ruleFormRef.value);
       } else {
         ElMessageBox.alert(msg, "提示", {
-        confirmButtonText: "关闭",
-        type: "warning"
-      });
+          confirmButtonText: "关闭",
+          type: "warning"
+        });
       };
     })
   }
 
-    // 新增
+  // 新增
   const addVisible = ref(false);
   function handleAdd() {
     addVisible.value = true;
   };
 
-    // 修改
+  // 修改
   const editUpdatePriLogVisible = ref(false);
   const editUpdatePriLogFormData = ref({});
   function handleUpdatePriLog(row) {

+ 91 - 28
src/views/pri/priLoopSet/components/add/index.vue

@@ -38,8 +38,7 @@ let UpdateForm = ref({
   tableEnName: "", //查询表
   parentField: "", //父ID字段
   sonField: "", //子ID字段
-
-
+  levelDiffFlag: "",//级差
 });
 // 表单实例
 const ruleFormRef = ref()
@@ -82,6 +81,7 @@ const submit = async (formEl) => {
           tableEnName: "", //查询表
           parentField: "", //父ID字段
           sonField: "", //子ID字段
+          levelDiffFlag: "",//级差
 
         };
         // 关闭新增弹窗;
@@ -100,40 +100,100 @@ const submit = async (formEl) => {
         type: "error"
       });
     }
-  })
-};
-
-//获取配置ID数据
-const listIdQuery = async () => {
-  const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriListDic.method, url: UrlList.prizeSet.prigetPriListDic.url, params: {} });
-  if (status === 1) {
-    listIdOptionList.value = data.records;
   }
-};
+  // 配置ID选项数据
+const listIdOptionList = ref([]);
+  // 执行模式选项数据
+  const loopModelOptionList = [
+    { id: 'field', label: '父子关联字段' },
+  ]
 
+  // 选项卡参数(默认值为列表某项的id)
+  const activeId = ref('1')
+  // 提交函数
+  const submit = async (formEl) => {
+    // 表单校验拦截
+    if (!formEl) return
+    await formEl.validate(async (valid, fields) => {
+      if (valid) {
+        //表单校验成功回调
+        console.log('submit!')
 
 
-// 表单校验规则
-const rules = reactive({
+        // 需动态生成接口
+        const { status, msg }: any = await http.Request({
+          method: UrlList.prizeSet.priaddPriLoopSet.method,
+          url: UrlList.prizeSet.priaddPriLoopSet.url,
+          params: UpdateForm.value
+        });
+        if (status === 1) {
+          //业务成功回调
+          ElMessage({
+            message: "新增成功",
+            type: "success"
+          });
+          UpdateForm.value = {
+            listId: props.listId, //配置ID
+            loopModel: "", //执行模式
+            parentField: "", //父ID字段
+            sonField: "", //子ID字段
+            tableEnName: "", //查询表
+            levelDiffFlag: "", //级差
 
-})
-// 关闭弹窗回调函数
-const closeFn: any = inject("closeAddVisible");
-const closeVisible = () => {
-  // 清空表单项;
-  UpdateForm.value = {
-    listId: props.listId, //配置ID
-    loopModel: "", //执行模式
-    tableEnName: "", //查询表
-    parentField: "", //父ID字段
-    sonField: "", //子ID字段
+          };
+          // 关闭新增弹窗;
+          closeVisible()
+        } else {
+          //业务失败回调
+          ElMessageBox.alert(msg, "提示", {
+            confirmButtonText: "关闭",
+            type: "warning"
+          });
+        }
+      } else {
+        //表单校验失败回调
+        ElMessage({
+          message: "请输入完整信息",
+          type: "error"
+        });
+      }
+    })
+  };
 
+  //获取配置ID数据
+  const listIdQuery = async () => {
+    const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriListDic.method, url: UrlList.prizeSet.prigetPriListDic.url, params: {} });
+    if (status === 1) {
+      listIdOptionList.value = data.records;
+    }
   };
-  closeFn();
-};
 
-// 弹窗是否全屏
-const isFullscreen = ref(false)
+
+
+  // 表单校验规则
+  const rules = reactive({
+
+
+
+  })
+  // 关闭弹窗回调函数
+  const closeFn: any = inject("closeAddVisible");
+  const closeVisible = () => {
+    // 清空表单项;
+    UpdateForm.value = {
+      listId: props.listId, //配置ID
+      loopModel: "", //执行模式
+      tableEnName: "", //查询表
+      parentField: "", //父ID字段
+      sonField: "", //子ID字段
+      levelDiffFlag: "",//级差
+
+    };
+    closeFn();
+  };
+
+  // 弹窗是否全屏
+  const isFullscreen = ref(false)
 </script>
 
 <template lang="pug">
@@ -160,6 +220,9 @@ const isFullscreen = ref(false)
       el-form-item(label='父ID字段' prop="parentField")
         el-input(v-model='UpdateForm.parentField' autocomplete='off'
           placeholder="请输入父ID字段")
+
+      el-form-item(label='级差' prop="levelDiffFlag")
+        el-switch(v-model="UpdateForm.levelDiffFlag")
       el-form-item(label='子ID字段' prop="sonField")
         el-input(v-model='UpdateForm.sonField' autocomplete='off'
           placeholder="请输入子ID字段")

+ 15 - 1
src/views/pri/priLoopSet/components/updatePriLoopSet/index.vue

@@ -35,6 +35,9 @@ const UpdateForm: any = ref({
   tableEnName: "", //查询表
   parentField: "", //父ID字段
   sonField: "", //子ID字段
+  levelDiffFlag: "",//级差
+
+
 
 });
 // 执行模式选项数据
@@ -74,6 +77,7 @@ const submit = async (formEl) => {
           tableEnName: "", //查询表
           parentField: "", //父ID字段
           sonField: "", //子ID字段
+          levelDiffFlag: "",//级差
 
         };
         // 关闭修改弹窗;
@@ -98,9 +102,12 @@ const submit = async (formEl) => {
 
 
 
+
 // 表单校验规则
 const rules = reactive({
 
+
+
 })
 // 关闭弹窗回调函数
 const closeFn: any = inject('closeEditUpdatePriLoopSetVisible');
@@ -120,6 +127,7 @@ const closeUpdatePriLoopSetVisible = () => {
     tableEnName: "", //查询表
     parentField: "", //父ID字段
     sonField: "", //子ID字段
+    levelDiffFlag: "",//级差
 
   };
   closeFn();
@@ -149,7 +157,13 @@ const isFullscreen = ref(false)
       el-form-item(label='父ID字段' prop="parentField")
         el-input(v-model='UpdateForm.parentField' autocomplete='off'
           placeholder="请输入父ID字段")
-      el-form-item(label='子ID字段' prop="sonField")
+
+      el-form-item(label='ID' prop="id")
+        el-input-number(v-model='UpdateForm.id' :min="0" :max="100000"
+          placeholder="请输入ID")
+      el-form-item(label='级差' prop="levelDiffFlag")
+        el-switch(v-model="UpdateForm.levelDiffFlag")
+          el-form-item(label='子ID字段' prop="sonField")
         el-input(v-model='UpdateForm.sonField' autocomplete='off'
           placeholder="请输入子ID字段")
 

+ 12 - 17
src/views/pri/priLoopSet/hook.tsx

@@ -13,13 +13,11 @@ export function usePriLoopSet() {
 
     UrlList = await getGroupUrl(["prizeSet"]);
     onSearch(ruleFormRef.value);
-  listIdQuery();
+    listIdQuery();
 
   });
   let form = reactive({
-  listId:null, //配置ID
-
-
+    listId: null, //配置ID
   });
   const dataList = ref([]);
   const loading = ref(false);
@@ -52,9 +50,6 @@ export function usePriLoopSet() {
       label: "配置ID",
       prop: "listId",
       minWidth: 200
-      formatter: ({ listId }) => {
-        return listIdOptionList.find(item => item.id == listId).label
-      },
     },
     {
       label: "执行模式",
@@ -133,11 +128,11 @@ export function usePriLoopSet() {
       }
     })
   }
-    // 配置ID选项数据
-    const listIdOptionList = ref([]);
+  // 配置ID选项数据
+  const listIdOptionList = ref([]);
   //获取配置ID数据
   async function listIdQuery() {
-    const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriListDic.method, url: UrlList.prizeSet.prigetPriListDic.url, params: { } });
+    const { status, data }: any = await http.Request({ method: UrlList.prizeSet.prigetPriListDic.method, url: UrlList.prizeSet.prigetPriListDic.url, params: {} });
     if (status === 1) {
       listIdOptionList.value = data.records;
     }
@@ -145,8 +140,8 @@ export function usePriLoopSet() {
 
 
 
-  
-    // 删除
+
+  // 删除
   function handleDelete(row) {
     ElMessageBox.confirm(
       `是否删除该递归配置? `,
@@ -166,20 +161,20 @@ export function usePriLoopSet() {
         onSearch(ruleFormRef.value);
       } else {
         ElMessageBox.alert(msg, "提示", {
-        confirmButtonText: "关闭",
-        type: "warning"
-      });
+          confirmButtonText: "关闭",
+          type: "warning"
+        });
       };
     })
   }
 
-    // 新增
+  // 新增
   const addVisible = ref(false);
   function handleAdd() {
     addVisible.value = true;
   };
 
-    // 修改
+  // 修改
   const editUpdatePriLoopSetVisible = ref(false);
   const editUpdatePriLoopSetFormData = ref({});
   function handleUpdatePriLoopSet(row) {

+ 2 - 0
src/views/pri/priLoopSet/index.vue

@@ -36,6 +36,8 @@ const {
   editUpdatePriLoopSetFormData,
   handleDelete,
 
+
+
 } = usePriLoopSet();
 // 关闭添加
 const closeAddVisible = () => {