Browse Source

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 1 year ago
parent
commit
4817c08eea

+ 13 - 5
src/components/PopDialog/index.vue

@@ -21,7 +21,7 @@
           </el-header>
           </el-header>
           <el-main>
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable" @row-click="rowSelect"
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable" @row-click="rowSelect"
-              @select="handleSelectionChange" height="calc(100% - 40px)" style="width: 100%">
+              @select="handleSelectionChange" :selection="selectedRows" @selection-change="watchSel"  height="calc(100% - 40px)" style="width: 100%">
               <el-table-column type="selection" header-align="center" align="center" width="50">
               <el-table-column type="selection" header-align="center" align="center" width="50">
               </el-table-column>
               </el-table-column>
               <el-table-column prop="code" header-align="center" align="center" sortable="custom" min-width="90"
               <el-table-column prop="code" header-align="center" align="center" sortable="custom" min-width="90"
@@ -67,6 +67,7 @@ export default {
       orders: [],
       orders: [],
       loading: false,
       loading: false,
       visible: false,
       visible: false,
+      selectedRows:[]
     };
     };
   },
   },
   props: {
   props: {
@@ -79,7 +80,7 @@ export default {
     // 是否启用单选
     // 是否启用单选
     single: {
     single: {
       type: Boolean,
       type: Boolean,
-      default: false
+      default: true
     }
     }
   },
   },
   methods: {
   methods: {
@@ -136,14 +137,21 @@ export default {
       this.searchForm.pageNo = 1;
       this.searchForm.pageNo = 1;
       this.refreshList();
       this.refreshList();
     },
     },
+    watchSel(rows) {
+      console.log('监听得到选中吗', rows)
+      this.dataListAllSelections = rows
+    },
     // 表格选中数据
     // 表格选中数据
-    rowSelect(row, column, event) {
-      this.$refs.contractTable.clearSelection();
+    rowSelect(row) {
+      // this.$refs.contractTable.clearSelection();
+      // this.$refs.contractTable.toggleRowSelection(row);
+      // this.dataListAllSelections = this.single ? [row] : selection
       this.$refs.contractTable.toggleRowSelection(row);
       this.$refs.contractTable.toggleRowSelection(row);
-      this.dataListAllSelections = this.single ? [row] : selection
     },
     },
     // 选中数据
     // 选中数据
     handleSelectionChange(selection, row) {
     handleSelectionChange(selection, row) {
+      console.log('selection',selection)
+      console.log('row',[row])
       if (this.single && selection.length > 1) {
       if (this.single && selection.length > 1) {
         this.$refs.contractTable.clearSelection();
         this.$refs.contractTable.clearSelection();
         this.$refs.contractTable.toggleRowSelection(row);
         this.$refs.contractTable.toggleRowSelection(row);

+ 84 - 85
src/components/super-search/index.vue

@@ -102,92 +102,91 @@ export default {
     @submit.native.prevent
     @submit.native.prevent
   >
   >
     <el-row
     <el-row
-      :gutter="20"
+      :gutter="24"
       :style="{ height }"
       :style="{ height }"
-      style="overflow: hidden; transition: 250ms"
+      style="overflow: hidden; transition: 250ms; display: flex"
+      class="px-3"
     >
     >
-      <el-col :span="20">
-        <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
-          <el-col
-            v-for="({ item, attr }, index) in showColumns"
-            :key="index"
-            :span="item.span"
-          >
-            <el-form-item :prop="item.key" :label="item.title">
-              <component
-                v-if="attr.is === 'el-input'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @keyup.enter.native="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-                <template>
-                  <el-option
-                    v-for="item in dict.type[attr.dictName]"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </template>
-              </component>
-              <component
-                v-if="attr.is === 'el-date-picker'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-select-v2'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-multiple-select-v2'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-tree-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-multiple-tree-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-col>
-      <el-col :span="4" style="text-align: right">
+      <el-row :gutter="20" style="flex: 1; display: flex; flex-wrap: wrap">
+        <el-col
+          v-for="({ item, attr }, index) in showColumns"
+          :key="index"
+          :span="item.span"
+        >
+          <el-form-item :prop="item.key" :label="item.title">
+            <component
+              v-if="attr.is === 'el-input'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @keyup.enter.native="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+              <template>
+                <el-option
+                  v-for="item in dict.type[attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </template>
+            </component>
+            <component
+              v-if="attr.is === 'el-date-picker'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-select-v2'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-multiple-select-v2'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-tree-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-multiple-tree-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row style="width: fit-content; text-align: right" class="ml-5">
         <el-button :size="$attrs.size" type="primary" @click="$emit('submit')">
         <el-button :size="$attrs.size" type="primary" @click="$emit('submit')">
           搜索
           搜索
         </el-button>
         </el-button>
@@ -197,7 +196,7 @@ export default {
         <el-button :size="$attrs.size" @click="visible = !visible">
         <el-button :size="$attrs.size" @click="visible = !visible">
           {{ visible ? "展开" : "收起" }}
           {{ visible ? "展开" : "收起" }}
         </el-button>
         </el-button>
-      </el-col>
+      </el-row>
     </el-row>
     </el-row>
     <el-divider class="m-0"> </el-divider>
     <el-divider class="m-0"> </el-divider>
   </el-form>
   </el-form>

+ 0 - 475
src/components/super-table/index copy.vue

@@ -1,475 +0,0 @@
-<script>
-export default {
-  name: "SuperTable",
-  props: {
-    // 数据
-    value: {
-      type: [Array],
-      require: true,
-    },
-    // 字典
-    dict: {
-      type: [Object],
-      require: true,
-    },
-    // 分页
-    page: {
-      type: [Object],
-      require: false,
-    },
-    // 模板
-    columns: {
-      type: [Array],
-      require: true,
-    },
-    // 是否显示序号
-    index: {
-      type: Boolean,
-      default: false,
-    },
-    // 是否显示单选
-    radio: {
-      type: Boolean,
-      default: false,
-    },
-    // 是否显示多选
-    checkbox: {
-      type: Boolean,
-      default: false,
-    },
-    // 是否显示分页
-    pagination: {
-      type: Boolean,
-      default: false,
-    },
-    // 是否列显示
-    hiddenColumns: {
-      type: Boolean,
-      default: false,
-    },
-    // 是否禁止选择
-    selectable: {
-      type: Function,
-      default: () => {},
-    },
-
-    // stroage: {
-    //   type: Boolean,
-    //   default: false,
-    // },
-    // hideOperationColumns: {
-    //   type: Boolean,
-    //   default: false,
-    // },
-  },
-  components: {
-    ElDictTag: () => import("@/components/DictTag/index.vue"),
-    ElDraggable: () => import("@/components/draggable/index.vue"),
-    ElFilePreview: () => import("@/components/file-preview/index.vue"),
-    ElComputedInput: () => import("@/components/computed-input/index.vue"),
-    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
-    ElComputedInputV2: () => import("@/components/computed-input-v2/index.vue"),
-    ButtonHide: () => import("./hide.vue"),
-    ButtonFreeze: () => import("./freeze.vue"),
-    IconHide: () => import("./once/hide.vue"),
-    IconSort: () => import("./once/sort.vue"),
-    IconFilter: () => import("./once/filter.vue"),
-    IconFreeze: () => import("./once/freeze.vue"),
-  },
-  data() {
-    const { columns } = this.$props;
-    const innerColumns = columns;
-    return {
-      innerColumns: innerColumns,
-      rowKey: "id",
-      // 选择
-      selectData: [],
-      selectState: false,
-      // 过滤
-      filterData: [],
-      filterState: false,
-    };
-  },
-  computed: {
-    innerValue: {
-      get() {
-        if (this.filterState) {
-          return this.filterData;
-        } else if (this.selectState) {
-          return this.selectData;
-        } else {
-          return this.$props.value;
-        }
-      },
-      set(value) {
-        this.$emit("input", value);
-      },
-    },
-    showColumns: {
-      get() {
-        return this.innerColumns.filter(({ item }) => item.hidden);
-      },
-      set() {},
-    },
-    filterRules: {
-      get() {
-        return Object.fromEntries(
-          this.innerColumns
-            .filter(({ item }) => item.filter && !!item.filter.length)
-            .map(({ item }) => [item.key, item.filter])
-        );
-      },
-      set() {},
-    },
-  },
-  watch: {
-    filterRules: {
-      handler: function (newValue) {
-        function multiFilter(array, filters) {
-          const filterKeys = Object.keys(filters);
-          // filters all elements passing the criteria
-          return array.filter((item) => {
-            // dynamically validate all filter criteria
-            return filterKeys.every((key) => {
-              //ignore when the filter is empty Anne
-              if (!filters[key].length) return true;
-              return !!~filters[key].indexOf(item[key]);
-            });
-          });
-        }
-        this.filterState = JSON.stringify(newValue) !== "{}";
-        this.filterData = multiFilter(this.$props.value, newValue);
-      },
-    },
-  },
-  methods: {
-    //
-    onSelectionChange(value) {
-      this.selectData = value;
-    },
-    //
-    onCellStyle({ row, column }) {
-      const { selectable } = this.$props;
-      // 禁止状态
-      if (!selectable(row)) {
-        return {
-          cursor: "no-drop",
-        };
-      }
-      // 选中状态
-      // if (
-      //   column.label === "#" &&
-      //   this.selectData.find((item) => item.id === row.id)
-      // ) {
-      //   return {
-      //     color: "#fff",
-      //     backgroundColor: "#409EFF",
-      //   };
-      // }
-    },
-    //
-    onRowClick(row, column, event) {
-      const { radio, checkbox, selectable } = this.$props;
-      // 单选
-      if (radio && selectable(row)) {
-        this.selectData = [row];
-        this.innerValue = this.innerValue.map((item) => ({
-          ...item,
-          isChecked: item.id === row.id ? true : false,
-        }));
-        this.$emit("row-select", this.selectData);
-      }
-      // 多选
-      if (checkbox && selectable(row)) {
-        this.$refs.superTable.toggleRowSelection(
-          this.innerValue.find((item) => item.id === row.id)
-        );
-        this.$emit("row-select", this.selectData);
-      }
-    },
-    // 冻结
-    onHide() {
-      this.$nextTick(() => {
-        this.$refs.superTable.doLayout();
-      });
-    },
-    // 排序
-    onSort(prop) {
-      const { key, sort } = prop;
-      this.$nextTick(() => {
-        this.$refs.superTable.sort(key, sort);
-        this.$refs.superTable.doLayout();
-      });
-    },
-    // 冻结
-    onFreeze() {
-      this.$nextTick(() => {
-        this.$refs.superTable.doLayout();
-      });
-    },
-    // 过滤
-    onFilter() {
-      this.$nextTick(() => {
-        this.$refs.superTable.doLayout();
-      });
-    },
-    onFilters(value) {
-      const {
-        item: { key },
-        attr: { dictName },
-      } = value;
-      let dataList = [];
-      const dict = this.dict.type[dictName];
-      dataList = Array.from(
-        new Set(this.innerValue.map((item) => item[key]).filter((item) => item))
-      ).map((item) => ({
-        text: dictName
-          ? (dict.find((dictItem) => dictItem.value == item) || {}).label
-          : item,
-        value: item,
-      }));
-      return dataList;
-    },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-
-<template>
-  <div class="el-super-table">
-    <el-table
-      v-bind="$attrs"
-      v-on="$listeners"
-      ref="superTable"
-      border
-      :row-key="rowKey"
-      :data="innerValue"
-      :cell-style="onCellStyle"
-      :row-style="{ height: '50px' }"
-      @row-click="onRowClick"
-      @selection-change="onSelectionChange"
-    >
-      <!-- 序号 -->
-      <el-table-column
-        v-if="index"
-        :resizable="false"
-        fixed
-        width="50"
-        label="序号"
-        align="center"
-        class="is-index"
-      >
-        <template slot-scope="scope">
-          {{ scope.$index + 1 }}
-        </template>
-      </el-table-column>
-      <!-- 多选 -->
-      <el-table-column
-        v-if="checkbox"
-        :column-key="rowKey"
-        :selectable="selectable"
-        fixed
-        width="50"
-        align="center"
-        type="selection"
-        reserve-selection
-      >
-      </el-table-column>
-      <el-table-column
-        v-for="({ item, attr }, index) in showColumns"
-        :key="index"
-        :prop="item.key"
-        :label="item.title"
-        :fixed="item.fixed"
-        :width="item.width"
-        show-overflow-tooltip
-      >
-        <template slot="header" slot-scope="scope">
-          <template>
-            <span
-              :style="{
-                color:
-                  item.sort ||
-                  item.fixed ||
-                  (item.filter && !!item.filter.length)
-                    ? '#1890ff'
-                    : '',
-              }"
-            >
-              {{ 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-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>
-          <!-- <template v-else>{{ item.title }}</template> -->
-        </template>
-        <template slot-scope="scope">
-          <slot :name="item.key" v-bind="scope" :item="item" :attr="attr">
-            <template v-if="attr.is">
-              <component
-                v-if="attr.is === 'el-dict-tag'"
-                v-bind="attr"
-                :size="$attrs.size"
-                :value="scope.row[item.key]"
-                :options="dict.type[attr.dictName]"
-              ></component>
-              <component
-                v-else-if="attr.is === 'el-popover-select-v2'"
-                v-bind="attr"
-                v-model="scope.row[item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-              >
-              </component>
-              <component
-                v-else-if="attr.is === 'el-select'"
-                v-bind="attr"
-                v-model="scope.row[item.key]"
-                :size="$attrs.size"
-              >
-                <template>
-                  <el-option
-                    v-for="item in dict.type[attr.dictName]"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </template>
-              </component>
-              <component
-                v-else
-                v-bind="attr"
-                v-model="scope.row[item.key]"
-                :size="$attrs.size"
-              >
-              </component
-            ></template>
-            <template v-else>
-              <component v-if="attr.formatter" is="span">{{
-                attr.formatter(scope.row)
-              }}</component>
-              <component v-else is="span">{{
-                scope.row[item.key] || "--"
-              }}</component>
-            </template>
-          </slot>
-        </template>
-      </el-table-column>
-      <slot></slot>
-    </el-table>
-    <div
-      style="
-        height: auto;
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-      "
-    >
-      <div>
-        <template v-if="checkbox">
-          <el-button
-            v-if="selectState"
-            size="mini"
-            @click="selectState = !selectState"
-          >
-            所有列
-          </el-button>
-          <el-button
-            v-else
-            :disabled="!selectData.length"
-            size="mini"
-            @click="selectState = !selectState"
-          >
-            选择列
-            {{ selectData.length ? ` :${selectData.length}` : "" }}
-          </el-button>
-        </template>
-        <template v-if="hiddenColumns">
-          <button-hide v-model="innerColumns" @hide="onHide"></button-hide>
-          <button-freeze
-            v-model="showColumns"
-            @freeze="onFreeze"
-          ></button-freeze>
-        </template>
-      </div>
-      <pagination
-        v-if="pagination"
-        v-show="!selectState"
-        :total="page.total"
-        :page.sync="page.pageNum"
-        :limit.sync="page.pageSize"
-        @pagination="$emit('pagination', { ...$event })"
-        style="height: 32px; padding: 0 !important"
-      />
-    </div>
-  </div>
-</template>
-
-<style lang="scss" scoped>
-.el-super-table {
-  position: relative;
-}
-.el-super-table .el-table__header .cell {
-  display: flex;
-  .icon-sort {
-    display: none;
-  }
-  &:hover .icon-sort {
-    display: inline-block;
-  }
-  .icon-freeze {
-    display: none;
-  }
-  &:hover .icon-freeze {
-    display: inline-block;
-  }
-  .icon-filter {
-    display: none;
-  }
-  &:hover .icon-filter {
-    display: inline-block;
-  }
-  .icon-hide {
-    display: none;
-  }
-  &:hover .icon-hide {
-    display: inline-block;
-  }
-}
-</style>

+ 16 - 14
src/components/super-table/once/filter.vue

@@ -8,21 +8,23 @@
     popper-class="p-0"
     popper-class="p-0"
   >
   >
     <template>
     <template>
-      <el-checkbox-group
-        v-model="selectData"
-        class="pt-3 px-3"
-        @change="onCheck"
-      >
-        <el-checkbox
-          v-for="item in filterData"
-          :key="item.value"
-          :label="item.value"
-          class="mr-0 mb-3"
-          style="display: block"
+      <el-scrollbar :height="300">
+        <el-checkbox-group
+          v-model="selectData"
+          class="pt-3 px-3"
+          @change="onCheck"
         >
         >
-          {{ item.text }}
-        </el-checkbox>
-      </el-checkbox-group>
+          <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>
       <el-divider class="m-0"></el-divider>
       <el-divider class="m-0"></el-divider>
       <div
       <div
         class="p-3"
         class="p-3"

+ 2 - 2
src/views/purchase/DemandSummary/add.vue

@@ -21,8 +21,8 @@
           style="font-size: 12px;"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           @selection-change="handleSelectionChange"
         >
         >
-        <el-table-column show-overflow-tooltip type="selection"/>
-        <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55"/>
+        <el-table-column show-overflow-tooltip type="selection" fixed="left"/>
+        <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55" fixed="left"/>
         <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
         <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
           <template slot-scope="scope">
           <template slot-scope="scope">
             {{ scope.$index + 1 + '0' }}
             {{ scope.$index + 1 + '0' }}

+ 2 - 1
src/views/purchase/DemandSummary/index.vue

@@ -233,7 +233,8 @@
           @selection-change="handleSelectionChange"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
           :key="isUpdate"
         >
         >
-          <el-table-column type="selection" width="60" />
+          <el-table-column type="selection" width="60" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <!-- <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/> -->
           <!-- <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/> -->
           <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
           <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
           <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="100px"/>
           <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="100px"/>

+ 158 - 4
src/views/purchase/PurchaseDemandList/add.vue

@@ -170,8 +170,8 @@
           @selection-change="handleSelectionChange"
           @selection-change="handleSelectionChange"
           :cell-class-name="cellClassName"
           :cell-class-name="cellClassName"
         >
         >
-          <el-table-column show-overflow-tooltip type="selection"/>
-          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px"/>
+          <el-table-column show-overflow-tooltip type="selection" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
             <template slot-scope="scope">
             <template slot-scope="scope">
               {{ scope.$index + 1 + '0' }}
               {{ scope.$index + 1 + '0' }}
@@ -427,7 +427,7 @@
 
 
       <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
       <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
 
 
-      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
 
 
 
 
     <!-- 批量调整参数 -->
     <!-- 批量调整参数 -->
@@ -1318,6 +1318,7 @@ export default {
     },
     },
     selectMaterial(selection) {
     selectMaterial(selection) {
       console.log('选中的物料', selection)
       console.log('选中的物料', selection)
+      if (selection.length <= 1) {
       // 选择新物料时先清空行内其他信息
       // 选择新物料时先清空行内其他信息
       this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
       this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
       this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
       this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
@@ -1388,7 +1389,160 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
       this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
       this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
       this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
       // 选中骨科耗材时候的物料,需求客户不必填
       // 选中骨科耗材时候的物料,需求客户不必填
-
+      } else {
+        console.log('xxxxx', selection)
+        for (let i = 0;i<selection.length;i++) {
+          let line = {
+            contacts: null,
+            id: null,
+            demandId: null,
+            status: null,
+            businessDept: null,
+            businessDeptName: null,
+            materialCategory: null,
+            buyer: null,
+            buyerName: null,
+            mateiralClassifyOne: null,
+            materialClassifyOneName: null,
+            materialClassifyTwo: null,
+            materialClassifyTwoName: null,
+            materialClassifyThree: null,
+            materialClassifyThreeName: null,
+            materialClassifyFour: null,
+            materialClassifyFourName: null,
+            materialCode: null,
+            material: null,
+            materialName: null,
+            classifyId: null,
+            specification: null,
+            unit: null,
+            unitName: null,
+            manufacturerName: null,
+            registrant: null,
+            puPeriod: null,
+            expiryUnit: null,
+            expiry: null,
+            minPackage: null,
+            minOrderQty: null,
+            minBatch: null,
+            safeStock: null,
+            averageQtyMonth: null,
+            qty: null,
+            adjustmentPersonal: null,
+            adjustmentTime: null,
+            manualRegulation: null,
+            updateCause: null,
+            reservedProportion: null,
+            reservedPeriod: null,
+            reservedQty: null,
+            demandPeriod: null,
+            forecastClassify: null,
+            onemonthAvgVolume: null,
+            threemonthAvgVolume: null,
+            puFreight: null,
+            deliveryDate: null,
+            isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+            isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
+            isBatchLock: 'N',
+            isCustomerSpecified: '',
+            remark: null,
+            puRemark: null,
+            lastWarehouseQty: null,
+            resDemandQty: null,
+            lastWarehouse: null,
+            lastWarehouseName: null,
+            deliveryWarehouse: null,
+            deliveryWarehouseName: null,
+            lastAllocation: null,
+            lastAllocationName: null,
+            deliveryAllocation: null,
+            deliveryAllocationName: null,
+            passageOn: null,
+            puOrg: null,
+            purOrgName: null,
+            lastStockQty: null,
+            superiorCenterQty: null,
+            superiorAllotQty: null,
+            availableQty: null,
+            statusAllot: 'N',
+            additionalSupplier: null,
+            additionalSupplierName: null,
+            periodUnit: null,
+            demandCustomer: this.basicForm.customer,
+            demandCustomerName: this.basicForm.customerName,
+            businessDept: this.basicForm.demandDept,
+            businessDeptName: null,
+            lastStockOrg: null,
+            lastStockOrgName: null,
+            superiorStockOrg: null,
+            superiorStockOrgName: null,
+            allotCode: null,
+            deliveryAddress: null,
+            deliveryAddressName: null,
+            contacts: null,
+            contactsPhone: null,
+            address: null,
+            source: null,
+            priceType: 'order',
+            puManagerApprover: null,
+            puManagerApproverName: null,
+            processTime: null,
+            affirmer: null,
+            tenantId: null,
+            revision: null,
+            createBy: null,
+            createByName: null,
+            createTime: null,
+            updateBy: null,
+            updateByName: null,
+            updateTime: null,
+            delFlag: 0,
+            // 新增字段
+            model: null,
+            storageCondition: null,
+            transportationCondition: null,
+          }
+                // 通过选择物料查询采购员
+          queryMan(selection[i].id).then(res => {
+            if (res.code === 200 && res.rows.length !== 0) {
+              line.buyer = res.rows[0].buyer
+              line.buyerName = res.rows[0].buyerName
+            }
+          })
+          line.businessDept = selection[i].businessDepartment
+          line.businessDeptName = selection[i].businessDepartmentName
+          line.materialCode = selection[i].code
+          line.material = selection[i].id
+          line.materialName = selection[i].name
+          line.classifyId = selection[i].classifyId
+          line.materialClassifyOneName = selection[i].oneClass
+          line.materialClassifyTwoName = selection[i].twoClass
+          line.materialClassifyThreeName = selection[i].threeClass
+          line.materialClassifyFourName = selection[i].fourClass
+          line.specification = selection[i].specification
+          line.model = selection[i].model
+          line.unit = selection[i].unitId
+          line.unitName = selection[i].unitIdName
+          line.registrant = selection[i].registrant
+          line.manufacturerName = selection[i].manufacturerIdName
+          line.puPeriod = selection[i].deliveryPeriod
+          line.expiry = selection[i].usefulLife
+          line.expiryUnit = selection[i].expiryUnitIdName
+          // line.minPackage = selection[i].usefulLife
+          line.minPackage = selection[i].minPackQty
+          line.minOrderQty = selection[i].minOrderQty
+          line.minBatch = selection[i].minBatchQty
+          line.safeStock = selection[i].safeStock
+          line.purOrgName = selection[i].purchasingOrganizationName
+          line.puOrg = selection[i].purchasingOrganization
+          // 物料存储条件和运输条件
+          line.transportationCondition = selection[i].transportationCondition
+          line.storageCondition = selection[i].storageCondition
+          this.basicForm.puDemandItemList.push(line)
+        }
+        // 删除指定下标
+        this.basicForm.puDemandItemList.splice(this.tableIndex,1)
+      }
     },
     },
     // 明细行选择业务部门参照带出业务部门数据
     // 明细行选择业务部门参照带出业务部门数据
     chooseDept(index, type, isPage, title) {
     chooseDept(index, type, isPage, title) {

+ 2 - 1
src/views/purchase/PurchaseDemandList/index.vue

@@ -171,7 +171,8 @@
           style="font-size: 12px;"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           @selection-change="handleSelectionChange"
         >
         >
-          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <el-table-column show-overflow-tooltip label="编码" align="center" width="170" prop="code"/>
           <el-table-column show-overflow-tooltip label="编码" align="center" width="170" prop="code"/>
           <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
           <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
           <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="120" prop="approverFinishTime"/>
           <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="120" prop="approverFinishTime"/>

+ 3 - 4
src/views/purchase/task/index.vue

@@ -17,17 +17,17 @@ export default {
   },
   },
   data() {
   data() {
     const { TableColumns, SearchColumns } = useColumns();
     const { TableColumns, SearchColumns } = useColumns();
+    const page = this.$init.page();
     const params = this.$init.params(SearchColumns);
     const params = this.$init.params(SearchColumns);
     return {
     return {
-      key: 0,
       size: "mini",
       size: "mini",
       loading: false,
       loading: false,
+      page: page,
       params: params,
       params: params,
       tableData: [],
       tableData: [],
       selectData: [],
       selectData: [],
       TableColumns: TableColumns,
       TableColumns: TableColumns,
       SearchColumns: SearchColumns,
       SearchColumns: SearchColumns,
-      page: { pageNum: 1, pageSize: 20, total: 0 },
     };
     };
   },
   },
   computed: {},
   computed: {},
@@ -91,8 +91,7 @@ export default {
     },
     },
     // 重 置
     // 重 置
     useReset() {
     useReset() {
-      this.page.pageNum = 1;
-      this.page.pageSize = 20;
+      this.page = this.$init.page();
       this.params = this.$init.params(this.SearchColumns);
       this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
       this.useQuery(this.params, this.page);
     },
     },