002201 1 ano atrás
pai
commit
bab7dc9ed1

+ 39 - 23
src/components/super-search/index.vue

@@ -53,6 +53,20 @@ export default {
       },
       set() {},
     },
+    height: {
+      get() {
+        const maxMultiples = Math.ceil(
+          this.innerColumns
+            .map(({ item }) => item.span)
+            .reduce((prev, curr) => {
+              return prev + curr;
+            }) / 24
+        );
+        const multiples = this.visible ? maxMultiples : 1;
+        return multiples * 47 + "px";
+      },
+      set() {},
+    },
   },
   watch: {},
   methods: {
@@ -60,7 +74,18 @@ export default {
       this.visible = !this.visible;
     },
   },
-  created() {},
+  created() {
+    console.log(
+      "span",
+      Math.ceil(
+        this.innerColumns
+          .map(({ item }) => item.span)
+          .reduce((prev, curr) => {
+            return prev + curr;
+          }) / 24
+      )
+    );
+  },
   mounted() {},
   destroyed() {},
 };
@@ -76,7 +101,11 @@ export default {
     label-position="right"
     @submit.native.prevent
   >
-    <el-row :gutter="20">
+    <el-row
+      :gutter="20"
+      :style="{ height }"
+      style="overflow: hidden; transition: 250ms"
+    >
       <el-col :span="20">
         <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
           <el-col
@@ -159,31 +188,18 @@ export default {
         </el-row>
       </el-col>
       <el-col :span="4" style="text-align: right">
-        <el-button
-          :size="$attrs.size"
-          type="primary"
-          icon="el-icon-search"
-          @click="$emit('submit')"
-        >
-          搜 索
+        <el-button :size="$attrs.size" type="primary" @click="$emit('submit')">
+          搜索
+        </el-button>
+        <el-button :size="$attrs.size" type="danger" @click="$emit('reset')">
+          重置
         </el-button>
-        <el-button
-          :size="$attrs.size"
-          icon="el-icon-refresh"
-          @click="$emit('reset')"
-        >
-          重 置
+        <el-button :size="$attrs.size" @click="visible = !visible">
+          {{ visible ? "展开" : "收起" }}
         </el-button>
       </el-col>
     </el-row>
-    <el-divider class="m-0">
-      <i
-        v-if="innerColumns.length > 4"
-        :class="visible ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
-        style="cursor: pointer"
-        @click="onVisible"
-      ></i>
-    </el-divider>
+    <el-divider class="m-0"> </el-divider>
   </el-form>
 </template>
 

+ 10 - 20
src/views/purchase/task/index.vue

@@ -1,6 +1,6 @@
 <script>
-import { dicts } from "./dicts";
 import useColumns from "./columns";
+import { dicts } from "./dicts";
 import { LIST } from "@/api/business/purchase/task";
 
 export default {
@@ -8,7 +8,7 @@ export default {
   dicts: dicts,
   components: {
     DcButton: () => import("./dao-chu/index.vue"),
-    MxButton: () => import("./ming-xi/index.vue"),
+    SeeButton: () => import("./see/index.vue"),
     ZpButton: () => import("./zhuan-pai/index.vue"),
     ThxqButton: () => import("./tui-hui-xu-qiu/index.vue"),
     XyzcButton: () => import("./xie-yi-zhi-cai/index.vue"),
@@ -100,16 +100,6 @@ export default {
     useSelect(prop, value) {
       this.selectData = prop;
     },
-    // 明 细
-    async useSee(prop) {
-      const { open } = this.$refs.mingxi;
-      await open(prop);
-    },
-    // 导 出
-    async useExport(prop, page) {
-      const { open } = this.$refs.daochu;
-      await open(prop, page);
-    },
   },
 };
 </script>
@@ -133,6 +123,14 @@ export default {
     ></el-super-search>
     <div class="my-4" style="text-align: right">
       <el-button-group>
+        <see-button
+          :size="size"
+          :dict="dict"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        ></see-button>
+      </el-button-group>
+      <el-button-group>
         <thxq-button
           :size="size"
           :select-data="selectData"
@@ -151,14 +149,6 @@ export default {
           @success="useQuery(params, page)"
         >
         </zp-button>
-        <mx-button
-          v-show="false"
-          :size="size"
-          :dict="dict"
-          :select-data="selectData"
-          ref="mingxi"
-          @success="useQuery(params, page)"
-        ></mx-button>
       </el-button-group>
       <el-button-group>
         <dc-button

+ 0 - 0
src/views/purchase/task/ming-xi/columns.js → src/views/purchase/task/see/columns.js


+ 13 - 2
src/views/purchase/task/ming-xi/index.vue → src/views/purchase/task/see/index.vue

@@ -21,8 +21,8 @@ export default {
     const { TableColumns } = useColumns();
     return {
       title: "明 细",
-      width: "25%",
-      column: 1,
+      width: "100%",
+      column: 3,
       visible: false,
       loading: false,
       TableColumns: TableColumns,
@@ -62,6 +62,10 @@ export default {
       const { id } = prop;
       this.visible = await this.fetchItem(id);
     },
+    //
+    async hide() {
+      this.visible = false;
+    },
   },
   created() {},
   mounted() {},
@@ -77,11 +81,18 @@ export default {
   >
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
     >
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button :size="$attrs.size" :loading="loading" @click="hide">
+          取 消
+        </el-button>
+      </template>
       <el-super-descriptions
         v-model="params"
         :dict="dict"

+ 4 - 4
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -5,10 +5,10 @@ export const TableColumns = [
     item: { key: "supplierName", title: "供应商" },
     attr: {},
   },
-  {
-    item: { key: "puOrgName", title: "采购组织" },
-    attr: {},
-  },
+  // {
+  //   item: { key: "puOrgName", title: "采购组织" },
+  //   attr: {},
+  // },
   {
     item: { key: "customerName", title: "客户" },
     attr: {},