lxf 3 月之前
父節點
當前提交
2f4cbce6da
共有 2 個文件被更改,包括 171 次插入3 次删除
  1. 3 3
      src/components/process/SendFunds.vue
  2. 168 0
      src/views/finance/fundManage/depExpenses/index.vue

+ 3 - 3
src/components/process/SendFunds.vue

@@ -1087,9 +1087,9 @@ let rules = ref({
   corporationId: [
     { required: true, message: "请选择归属公司", trigger: "change" },
   ],
-  departmentId: [
-    { required: true, message: "请选择归属部门", trigger: "change" },
-  ],
+  // departmentId: [
+  //   { required: true, message: "请选择归属部门", trigger: "change" },
+  // ],
   type: [{ required: true, message: "请选择请款类型", trigger: "change" }],
   // paymentTime: [{ required: true, message: "请选择用款时间", trigger: "change" }],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],

+ 168 - 0
src/views/finance/fundManage/depExpenses/index.vue

@@ -13,6 +13,7 @@
           select: select,
         }"
         :action-list="[]"
+        @moreSearch="moreSearch"
         @get-list="getList">
         <template #amount="{ item }">
           <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
@@ -121,6 +122,65 @@
         <el-button type="primary" @click="submitDeptForm(departmentId)" size="large" :loading="submitLoading"> 确 定 </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
+      <byForm :formConfig="formSearchConfig" :formOption="formOption" v-model="sourceList.pagination">
+        <template #time>
+          <div style="width: 100%">
+            <el-row :gutter="10">
+              <el-col :span="11">
+                <el-date-picker
+                  v-model="sourceList.pagination.beginTime"
+                  type="datetime"
+                  placeholder="请选择"
+                  style="width: 100%"
+                  value-format="YYYY-MM-DD HH:mm:ss" />
+              </el-col>
+              <el-col :span="2" style="text-align: center">到</el-col>
+              <el-col :span="11">
+                <el-date-picker
+                  v-model="sourceList.pagination.endTime"
+                  type="datetime"
+                  placeholder="请选择"
+                  style="width: 100%"
+                  value-format="YYYY-MM-DD HH:mm:ss" />
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #money>
+          <div style="width: 100%">
+            <el-row :gutter="10">
+              <el-col :span="11">
+                <el-input-number
+                  onmousewheel="return false;"
+                  v-model="sourceList.pagination.beginAmount"
+                  placeholder="请输入"
+                  style="width: 100%"
+                  :precision="2"
+                  :controls="false"
+                  :min="0" />
+              </el-col>
+              <el-col :span="2" style="text-align: center">到</el-col>
+              <el-col :span="11">
+                <el-input-number
+                  onmousewheel="return false;"
+                  v-model="sourceList.pagination.endAmount"
+                  placeholder="请输入"
+                  style="width: 100%"
+                  :precision="2"
+                  :controls="false"
+                  :min="0" />
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="cancelSearch()" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -138,6 +198,15 @@ const sourceList = ref({
     total: 3,
     pageNum: 1,
     pageSize: 10,
+    status: "",
+    currency: "",
+    type: "",
+    corporationId: "",
+    remarks: "",
+    beginAmount: "",
+    endAmount: "",
+    beginTime: "",
+    endTime: "",
   },
 });
 let dialogVisible = ref(false);
@@ -157,6 +226,16 @@ const status = ref([
     value: "20",
   },
 ]);
+const type = ref([
+  {
+    label: "是",
+    value: 1,
+  },
+  {
+    label: "否",
+    value: 0,
+  },
+]);
 const accountCurrency = ref([]);
 import Cookies from "js-cookie";
 const { proxy } = getCurrentInstance();
@@ -457,6 +536,95 @@ const handleRemove = (index) => {
   });
 };
 getList();
+const companyData = ref([]);
+proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
+  if (res.rows && res.rows.length > 0) {
+    companyData.value = res.rows.map((item) => {
+      return {
+        label: item.name,
+        value: item.id,
+      };
+    });
+  }
+});
+const openSearch = ref(false);
+const formSearchConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "status",
+      label: "收支类型",
+      data: status.value,
+      clearable: true,
+    },
+    {
+      type: "select",
+      prop: "currency",
+      label: "币种",
+      data: accountCurrency.value,
+      clearable: true,
+    },
+    {
+      type: "select",
+      prop: "type",
+      label: "是否拆分",
+      data: type.value,
+      clearable: true,
+    },
+    {
+      type: "select",
+      prop: "corporationId",
+      label: "归属公司",
+      data: companyData.value,
+      clearable: true,
+    },
+    {
+      type: "slot",
+      slotName: "time",
+      label: "请款时间",
+    },
+    {
+      type: "slot",
+      slotName: "money",
+      label: "请款金额",
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "remarks",
+      label: "摘要",
+    },
+  ];
+});
+let copySearch = ref({});
+const moreSearch = () => {
+  copySearch.value = proxy.deepClone(sourceList.value.pagination);
+  openSearch.value = true;
+};
+const cancelSearch = () => {
+  sourceList.value.pagination = copySearch.value;
+  openSearch.value = false;
+};
+const submitSearch = () => {
+  if (
+    sourceList.value.pagination.beginAmount &&
+    sourceList.value.pagination.endAmount &&
+    Number(sourceList.value.pagination.beginAmount) > Number(sourceList.value.pagination.endAmount)
+  ) {
+    return ElMessage("交易金额输入错误");
+  }
+  if (
+    sourceList.value.pagination.beginTime &&
+    sourceList.value.pagination.endTime &&
+    sourceList.value.pagination.beginTime > sourceList.value.pagination.endTime
+  ) {
+    return ElMessage("开始时间不能大于结束时间");
+  }
+  openSearch.value = false;
+  sourceList.value.pagination.keyword = "";
+  sourceList.value.pagination.pageNum = 1;
+  getList();
+};
 </script>
 
 <style lang="scss" scoped>