浏览代码

选择物品没数据bug

cz 1 年之前
父节点
当前提交
4f4ea17289
共有 2 个文件被更改,包括 7 次插入25 次删除
  1. 2 3
      src/components/byTable/index.vue
  2. 5 22
      src/components/product/SelectGoods.vue

+ 2 - 3
src/components/byTable/index.vue

@@ -429,9 +429,9 @@ export default defineComponent({
     };
     //下拉搜索相关
 
-    const searchItemSelct = (item, i, index) => {
+    const searchItemSelct = (item, i, index = 0) => {
       if (item == "all") {
-        // i.label = { ...props.selectConfig[index] }.labelCopy;
+        i.label = { ...props.selectConfig[index] }.labelCopy;
         i.label = props.selectConfig[index].labelCopy;
         proxy.$emit(
           "getList",
@@ -449,7 +449,6 @@ export default defineComponent({
     };
 
     const searchItemSelctOne = (item, prop, propOne) => {
-      console.log(prop, propOne, "sssss");
       if (prop && propOne) {
         proxy.$emit(
           "getList",

+ 5 - 22
src/components/product/SelectGoods.vue

@@ -1,33 +1,16 @@
 <template>
   <div>
-    <byTable
-      ref="table"
-      :source="sourceList.data"
-      :pagination="sourceList.pagination"
-      :config="config"
-      :loading="loading"
-      highlight-current-row
-      :selectConfig="selectConfig"
-      :table-events="{
+    <byTable ref="table" :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+             :selectConfig="selectConfig" :table-events="{
         //element talbe事件都能传
         select: select,
-      }"
-      :action-list="[]"
-      @get-list="getList"
-    >
+      }" :action-list="[]" @get-list="getList">
     </byTable>
     <div>
       <div>已选择货品</div>
       <div style="margin: 10px 0px">
-        <el-tag
-          style="margin-right: 10px"
-          type="info"
-          closable
-          v-for="(good, index) in goodList"
-          :key="good.id"
-          @close="handleRemove(index)"
-          >{{ good.name }}</el-tag
-        >
+        <el-tag style="margin-right: 10px" type="info" closable v-for="(good, index) in goodList" :key="good.id"
+                @close="handleRemove(index)">{{ good.name }}</el-tag>
       </div>
       <div style="text-align: center">
         <el-button @click="handleCancel" size="large">取消</el-button>