002201 1 سال پیش
والد
کامیت
87098d3f53

+ 25 - 47
src/components/super-table/index.vue

@@ -145,25 +145,20 @@ export default {
     //
     onSelectionChange(value) {
       this.selectData = value;
+      this.$emit("row-select", this.selectData);
     },
     //
     onRowClick(row, column, event) {
       const { radio, checkbox } = this.$props;
       // 单选
       if (radio) {
-        this.selectData = [row];
-        this.innerValue = this.innerValue.map((item) => ({
-          ...item,
-          isChecked: item.id === row.id ? true : false,
-        }));
-        this.$emit("row-select", this.selectData);
+        this.$emit("row-select", [row]);
       }
       // 多选
       if (checkbox) {
         this.$refs.superTable.toggleRowSelection(
           this.innerValue.find((item) => item.id === row.id)
         );
-        this.$emit("row-select", this.selectData);
       }
     },
     // 冻结
@@ -223,6 +218,7 @@ export default {
       border
       :row-key="rowKey"
       :data="innerValue"
+      :highlight-current-row="radio"
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
       v-bind="$attrs"
@@ -235,7 +231,6 @@ export default {
         fixed
         width="50"
         label="序号"
-        align="center"
         class="is-index"
       >
         <template slot-scope="scope">
@@ -277,42 +272,24 @@ export default {
             >
               {{ item.title }}
             </span>
-            <icon-sort
-              v-model="item.sort"
-              class="icon-sort"
-              @sort="onSort(item)"
-              :style="{
-                color: item.sort ? '#1890ff' : '',
-                display: item.sort ? 'inline-block' : '',
-              }"
-            ></icon-sort>
-            <icon-freeze
-              v-model="item.fixed"
-              class="icon-freeze"
-              @freeze="onFreeze"
-              :style="{
-                color: item.fixed ? '#1890ff' : '',
-                display: item.fixed ? 'inline-block' : '',
-              }"
-            ></icon-freeze>
-            <icon-filter
-              v-if="filterColumns"
-              v-model="item.filter"
-              class="icon-filter"
-              :filters="onFilters({ item, attr })"
-              @filter="onFilter"
-              :style="{
-                color: item.filter && item.filter.length ? '#1890ff' : '',
-                display:
-                  item.filter && item.filter.length ? 'inline-block' : '',
-              }"
-            ></icon-filter>
-            <icon-hide
-              v-if="hiddenColumns"
-              v-model="item.hidden"
-              class="icon-hide"
-              @hide="onHide"
-            ></icon-hide>
+            <template>
+              <icon-sort v-model="item.sort" @sort="onSort(item)"></icon-sort>
+              <icon-freeze
+                v-model="item.fixed"
+                @freeze="onFreeze"
+              ></icon-freeze>
+              <icon-filter
+                v-model="item.filter"
+                :filters="onFilters({ item, attr })"
+                @filter="onFilter"
+              ></icon-filter>
+              <icon-hide
+                v-if="hiddenColumns"
+                v-model="item.hidden"
+                class="icon-hide"
+                @hide="onHide"
+              ></icon-hide>
+            </template>
           </template>
         </template>
         <template slot-scope="scope">
@@ -373,7 +350,7 @@ export default {
     </el-table>
     <div
       style="
-        height: auto;
+        height: 50px;
         display: flex;
         justify-content: space-between;
         align-items: center;
@@ -423,8 +400,9 @@ export default {
 .el-super-table {
   position: relative;
 }
-.el-super-table .el-table__header .cell {
-  display: flex;
+::v-deep.el-super-table .el-table__header .cell {
+  word-break: keep-all;
+  white-space: nowrap;
   .icon-sort {
     display: none;
   }

+ 21 - 32
src/components/super-table/once/filter.vue

@@ -1,30 +1,34 @@
 <template>
   <el-popover
-    v-if="filterData.length"
+    v-if="innerValue !== false || filterData.length"
     :visible-arrow="false"
     width="auto"
     trigger="hover"
     placement="bottom"
     popper-class="p-0"
+    class="icon-filter"
+    :style="{
+      color: innerValue && innerValue.length ? '#1890ff' : '',
+      display: innerValue && innerValue.length ? 'inline-block' : '',
+    }"
   >
     <template>
-      <el-scrollbar :height="300">
-        <el-checkbox-group
-          v-model="selectData"
-          class="pt-3 px-3"
-          @change="onCheck"
+      <el-checkbox-group
+        v-model="selectData"
+        class="pt-3 px-3"
+        @change="onCheck"
+        style="max-height: 300px; overflow-y: auto"
+      >
+        <el-checkbox
+          v-for="item in filterData"
+          :key="item.value"
+          :label="item.value"
+          class="mr-0 mb-3"
+          style="display: block"
         >
-          <el-checkbox
-            v-for="item in filterData"
-            :key="item.value"
-            :label="item.value"
-            class="mr-0 mb-3"
-            style="display: block"
-          >
-            {{ item.text }}
-          </el-checkbox>
-        </el-checkbox-group>
-      </el-scrollbar>
+          {{ item.text }}
+        </el-checkbox>
+      </el-checkbox-group>
       <el-divider class="m-0"></el-divider>
       <div
         class="p-3"
@@ -43,21 +47,12 @@
         </div>
       </div>
     </template>
-    <!-- <el-tooltip
-      slot="reference"
-      :disabled="disabled"
-      effect="dark"
-      content="筛选"
-      placement="top"
-    > -->
     <i
       slot="reference"
       class="el-icon-search pl-1"
       style="cursor: pointer; font-weight: 600; transition: 500ms"
-      :style="{ color: color }"
       @click="onOpen"
     ></i>
-    <!-- </el-tooltip> -->
   </el-popover>
 </template>
 
@@ -112,12 +107,6 @@ export default {
       },
       set() {},
     },
-    color: {
-      get() {
-        return this.$props.value && this.$props.value.length ? "#1890ff" : "";
-      },
-      set() {},
-    },
   },
   watch: {},
   methods: {

+ 25 - 14
src/components/super-table/once/freeze.vue

@@ -1,18 +1,29 @@
 <template>
-  <!-- <el-tooltip effect="dark" content="冻结" placement="top"> -->
-  <i
-    v-if="innerValue"
-    class="el-icon-lock pl-1"
-    style="color: #1890ff; cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onFreeze"
-  ></i>
-  <i
-    v-else
-    class="el-icon-unlock pl-1"
-    style="cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onFreeze"
-  ></i>
-  <!-- </el-tooltip> -->
+  <span
+    class="icon-freeze"
+    :style="{
+      color: innerValue ? '#1890ff' : '',
+      display: innerValue ? 'inline-block' : '',
+    }"
+  >
+    <i
+      v-if="innerValue"
+      class="el-icon-lock pl-1"
+      style="
+        color: #1890ff;
+        cursor: pointer;
+        font-weight: 600;
+        transition: 500ms;
+      "
+      @click="onFreeze"
+    ></i>
+    <i
+      v-else
+      class="el-icon-unlock pl-1"
+      style="cursor: pointer; font-weight: 600; transition: 500ms"
+      @click="onFreeze"
+    ></i>
+  </span>
 </template>
 
 <script>

+ 25 - 14
src/components/super-table/once/sort.vue

@@ -1,18 +1,29 @@
 <template>
-  <!-- <el-tooltip effect="dark" content="排序" placement="top"> -->
-  <i
-    v-if="innerValue === 'descending'"
-    class="el-icon-bottom pl-1"
-    style="color: #1890ff; cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onSort(null)"
-  ></i>
-  <i
-    v-else
-    class="el-icon-top pl-1"
-    style="cursor: pointer; font-weight: 600; transition: 500ms"
-    @click="onSort('descending')"
-  ></i>
-  <!-- </el-tooltip> -->
+  <span
+    class="icon-sort"
+    :style="{
+      color: innerValue ? '#1890ff' : '',
+      display: innerValue ? 'inline-block' : '',
+    }"
+  >
+    <i
+      v-if="innerValue === 'descending'"
+      class="el-icon-bottom pl-1"
+      style="
+        color: #1890ff;
+        cursor: pointer;
+        font-weight: 600;
+        transition: 500ms;
+      "
+      @click="onSort(null)"
+    ></i>
+    <i
+      v-else
+      class="el-icon-top pl-1"
+      style="cursor: pointer; font-weight: 600; transition: 500ms"
+      @click="onSort('descending')"
+    ></i>
+  </span>
 </template>
 
 <script>

+ 0 - 1
src/views/purchase/apply/add/columns.js

@@ -234,7 +234,6 @@ export default function useColumns() {
                 return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
               },
             },
-
             value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
           },
         },

+ 3 - 0
src/views/purchase/apply/add/index.vue

@@ -288,6 +288,9 @@ export default {
         if (valid) {
           try {
             this.loading = true;
+            if (this.addType === "copy") {
+              this.params.priceApplyOrgs = [];
+            }
             if (this.addType === "edit") {
               this.params.priceApplyItems = this.params.priceApplyItems.filter(
                 (item) => item.materialName

+ 2 - 2
src/views/purchase/apply/columns.js

@@ -16,7 +16,7 @@ export default function useColumns() {
     { item: { key: "buyerName", title: "采购员" }, attr: {} },
     { item: { key: "puDeptName", title: "采购部门" }, attr: {} },
     {
-      item: { key: "file", title: "附件" },
+      item: { key: "file", title: "附件", filter: false },
       attr: { is: "el-file-preview" },
     },
     { item: { key: "createByName", title: "创建人" }, attr: {} },
@@ -35,7 +35,7 @@ export default function useColumns() {
     },
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: { ...item, fixed: false },
   }));
   const SearchColumns = [
     {

+ 2 - 5
src/views/purchase/catalogue/columns.js

@@ -107,6 +107,7 @@ export default function useColumns() {
       attr: {
         is: "el-popover-select-v2",
         referName: "MATERIAL_PARAM",
+        valueKey: "code",
         dataMapping: {
           material: "id",
           materialCode: "code",
@@ -121,10 +122,6 @@ export default function useColumns() {
       item: { key: "enableStatus", title: "启用状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
-  ].map(({ item, attr }) => ({
-    attr,
-    item: { ...item, hidden: true, span: item.span || 6 },
-  }));
-
+  ];
   return { TableColumns, SearchColumns };
 }

+ 1 - 0
src/views/purchase/task/index.vue

@@ -137,6 +137,7 @@ export default {
         ></thxq-button>
         <xyzc-button
           :size="size"
+          :dict="dict"
           :select-data="selectData"
           @success="useQuery(params, page)"
         ></xyzc-button>

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

@@ -2,13 +2,17 @@ import CONFIG from "@/config";
 
 export const TableColumns = [
   {
+    item: { key: "puOrgName", title: "采购组织" },
+    attr: {},
+  },
+  {
+    item: { key: "demandDate", title: "需求时间" },
+    attr: {},
+  },
+  {
     item: { key: "supplierName", title: "供应商" },
     attr: {},
   },
-  // {
-  //   item: { key: "puOrgName", title: "采购组织" },
-  //   attr: {},
-  // },
   {
     item: { key: "customerName", title: "客户" },
     attr: {},
@@ -30,7 +34,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
@@ -38,8 +42,8 @@ export const TableColumns = [
     item: { key: "taxFreePrice", title: "无税单价" },
     attr: {
       is: "el-computed-input-v2",
-      formatter: (prop = 0) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+      formatter: (prop) => {
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
@@ -47,13 +51,13 @@ export const TableColumns = [
     item: { key: "taxPrice", title: "主含税单价" },
     attr: {
       is: "el-computed-input-v2",
-      formatter: (prop = 0) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+      formatter: (prop) => {
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
   {
-    item: { key: "purchaseQuantity", title: "本次采购数量" },
+    item: { key: "purchaseQuantity", title: "本次采购数量", fixed: "left" },
     attr: {
       is: "el-input-number",
       min: () => 0,
@@ -65,7 +69,7 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "arrivalDatePlan", title: "计划到货日期" },
+    item: { key: "arrivalDatePlan", title: "计划到货日期", fixed: "left" },
     attr: {
       is: "el-date-picker",
       valueFormat: "yyyy-MM-dd",
@@ -77,7 +81,7 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "note", title: "备注" },
+    item: { key: "note", title: "备注", fixed: "left" },
     attr: {
       is: "el-input",
       autosize: true,

+ 39 - 31
src/views/purchase/task/xie-yi-zhi-cai/index.vue

@@ -12,13 +12,14 @@ export default {
     },
   },
   components: {
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElDictTag: () => import("@/components/DictTag/index.vue"),
     ElComputedInputV2: () => import("@/components/computed-input-v2/index.vue"),
   },
   data() {
     return {
       title: "协议直采",
-      width: "50%",
+      width: "100%",
       column: 1,
       visible: false,
       loading: false,
@@ -110,33 +111,55 @@ export default {
   >
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
     >
-      <div v-for="(item, index) in data" :key="index" style="margin: 10px">
-        <el-descriptions :size="$attrs.size" :column="column" border>
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button
+          :size="$attrs.size"
+          :loading="loading"
+          @click="visible = false"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="submit(data)"
+          >确 认</el-button
+        >
+      </template>
+      <div v-for="(item, index) in data" :key="index" class="m-4">
+        <h3 class="mb-4">
+          <span style="margin-right: 10px">{{ item.materialName }}</span>
+          <span style="color: tomato">{{ item.puQty }}</span>
+          (<span style="color: tomato">{{
+            item.puQty - (item.executeQty || 0)
+          }}</span
+          >) <span> {{ item.puUnitName }}</span>
+        </h3>
+        <!-- <el-descriptions :size="$attrs.size" :column="column" border>
           <template #title>
-            <span style="margin-right: 10px">{{ item.materialName }}</span>
-            <span style="color: tomato">{{ item.puQty }}</span>
-            (<span style="color: tomato">{{
-              item.puQty - (item.executeQty || 0)
-            }}</span
-            >)
-            <span> {{ item.puUnitName }}</span>
           </template>
-          <el-descriptions-item label="需求组织">
-            {{ item.demandOrgName }}
-          </el-descriptions-item>
           <el-descriptions-item label="采购组织">
             {{ item.puOrgName }}
           </el-descriptions-item>
           <el-descriptions-item label="需求时间">
             {{ item.demandDate }}
           </el-descriptions-item>
-        </el-descriptions>
-        <el-table
+        </el-descriptions> -->
+        <el-super-table
+          v-model="item.orderPriceVos"
+          :columns="tableColumns"
+          :size="$attrs.size"
+          :dict="dict"
+        >
+        </el-super-table>
+        <!-- <el-table
           v-loading="loading"
           :size="$attrs.size"
           :data="item.orderPriceVos"
@@ -195,22 +218,7 @@ export default {
               <span v-else>{{ scope.row[cItem.item.key] }}</span>
             </template>
           </el-table-column>
-        </el-table>
-      </div>
-      <div style="text-align: right; margin: 20px 20px 0">
-        <el-button
-          :size="$attrs.size"
-          :loading="loading"
-          @click="visible = false"
-          >取 消</el-button
-        >
-        <el-button
-          type="primary"
-          :size="$attrs.size"
-          :loading="loading"
-          @click="submit(data)"
-          >确 认</el-button
-        >
+        </el-table> -->
       </div>
     </el-drawer>
   </el-button>