Jelajahi Sumber

采购定单位维护-将表头货位改至表体

002390 1 tahun lalu
induk
melakukan
e5347065ee

+ 37 - 45
src/components/popover-select/index.vue

@@ -75,11 +75,11 @@ export default {
         return false;
       },
     },
-    copy:{
-      type:Boolean,
-      default:() =>{
-        return false
-      }
+    copy: {
+      type: Boolean,
+      default: () => {
+        return false;
+      },
     },
     // 需映射源数据
     source: Object,
@@ -134,7 +134,7 @@ export default {
     },
     // open dialog
     async open() {
-      if(!this.disabled){
+      if (!this.disabled) {
         this.visible = true;
         await this.useReset();
       }
@@ -157,19 +157,15 @@ export default {
           // 处理新增字段无法映射
           let that = this;
 
-          this.TableColumnTemp.forEach(({item,attr}) =>{
-
-            that.data = that.data.map(d =>{
-
-              if(!attr.is && attr.formatter){
+          this.TableColumnTemp.forEach(({ item, attr }) => {
+            that.data = that.data.map((d) => {
+              if (!attr.is && attr.formatter) {
                 d[item.key] = attr.formatter(d);
               }
 
               return d;
-
-            })
-
-          })
+            });
+          });
           this.page.total = total;
         }
       } catch (err) {
@@ -188,6 +184,7 @@ export default {
         search: "",
         ...queryParams(source),
       };
+      console.log(source, "source");
       await this.fetchList(this.model, this.page);
     },
     // query
@@ -204,18 +201,16 @@ export default {
     },
     // confirm
     useConfirm(prop) {
-      
       const { multiple } = this.$props;
 
       this.selectData = [...prop];
-      console.log(this.selectData,'this.selectData');
-   
+      console.log(this.selectData, "this.selectData");
+
       this.useUpdate(multiple ? prop : prop[0]);
 
       this.emitChange(this.selectData);
       this.lastSelectData = deepCopy(this.selectData);
       this.hide();
-      
     },
     // delete
     useDelete(prop) {
@@ -270,43 +265,37 @@ export default {
 
         this.model = {
           ...this.model,
-          search:prop,
-          type:type,
+          search: prop,
+          type: type,
           ...queryParams(source),
-        }
-        // 
+        };
+        //
         await this.fetchList(this.model, this.page);
         await cb(this.data);
       } else {
         cb([]);
       }
     },
-    async handleChange(){
+    async handleChange() {
       // 物料赋值'MATERIAL_PARAM'
       const { type, source } = this.$props;
-      if(type === 'MATERIAL_PARAM'){
-
+      if (type === "MATERIAL_PARAM") {
         let materialCodeList = this.innerValue.split(/,|,|\s+/);
-        
+
         try {
-          let { code, rows } = await REFER( {
+          let { code, rows } = await REFER({
             materialCodeList,
-              type,
-            })
+            type,
+          });
 
-          if(code == 200){
+          if (code == 200) {
             // this.$emit("change",rows, type, source);
           }
-        } catch (error) {
-          
-        }
+        } catch (error) {}
       }
-    }
-    
-  },
-  created() {
-
+    },
   },
+  created() {},
   mounted() {},
   destroyed() {},
 };
@@ -325,7 +314,7 @@ export default {
       @change="handleChange"
       @keyup.enter.native="handleChange"
     >
-    <!-- suffix -->
+      <!-- suffix -->
       <!-- <el-button
         :disabled="disabled"
         slot="append"
@@ -370,7 +359,7 @@ export default {
         </p>
       </template>
     </el-autocomplete>
-    
+
     <el-dialog
       :title="`${title}(${multiple ? '多选' : '单选'})`"
       :width="width"
@@ -396,8 +385,12 @@ export default {
           </el-input>
         </el-form-item>
         <el-form-item>
-          <el-button @click="useQuery" size="mini" >搜 索</el-button>
-          <el-button icon="el-icon-refresh" @click="useReset" size="mini"></el-button>
+          <el-button @click="useQuery" size="mini">搜 索</el-button>
+          <el-button
+            icon="el-icon-refresh"
+            @click="useReset"
+            size="mini"
+          ></el-button>
         </el-form-item>
         <el-table
           ref="multipleTable"
@@ -418,7 +411,7 @@ export default {
           >
           </el-table-column>
           <el-table-column
-            v-for="({item,attr}, index) in TableColumnTemp"
+            v-for="({ item, attr }, index) in TableColumnTemp"
             :key="index"
             :prop="item.key"
             :label="item.title"
@@ -452,7 +445,6 @@ export default {
         <el-button :size="size" @click="useCancel(lastSelectData)">
           取 消
         </el-button>
-        
       </div>
     </el-dialog>
     <div

+ 39 - 36
src/views/purchase/purchase-order/add/column.js

@@ -109,24 +109,7 @@ const PurColumns =[
 
     // require: true,
   },
-  {
-    key: "goodsAllocationName",
-    title: "货位",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "ALLOCATION_PARAM",
-    dataMapping: {
-      goodsAllocation: 'id',
-      goodsAllocationName: 'name',
-
-    },
-     isShow:true,
-    queryParams: (params) => ({
-      stordocId: params.warehouse,
-      pkOrg: params.puOrg,
-    }),
-    width: 200,
-  },
+ 
   {
     key: "originalQty",
     title: "原始总数量",
@@ -614,6 +597,25 @@ const PurchaseTabColumns =[
         width: 180,
         isSummary:true,
       },
+      {
+        key: "goodsAllocationName",
+        title: "货位",
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "ALLOCATION_PARAM",
+        dataMapping: {
+          goodsAllocation: 'id',
+          goodsAllocationName: 'name',
+    
+        },
+         isShow:true,
+        queryParams: (params) => ({
+          stordocId: params.warehouse,
+          pkOrg: params.puOrg,
+        }),
+        width: 180,
+      },
+    
     ]
   },
   // {
@@ -947,24 +949,7 @@ const CauseColumns =[
 
     // require: true,
   },
-  {
-    key: "goodsAllocationName",
-    title: "货位",
-    inputType: "PopoverSelect",
-    valueKey: "id",
-    referName: "ALLOCATION_PARAM",
-    dataMapping: {
-      goodsAllocation: 'id',
-      goodsAllocationName: 'name',
-
-    },
-     isShow:true,
-    queryParams: (params) => ({
-      stordocId: params.warehouse,
-      pkOrg: params.puOrg,
-    }),
-    width: 200,
-  },
+  
   {
     key: "customerDeptName",
     title: "客户部门",
@@ -1404,6 +1389,24 @@ const CauseTabColumns =[
       { key: "discountRule", title: "折扣规则编码", inputType: "Input", width: 180 },
       { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
       { key: "remark", title: "备注", inputType: "Input", width: 200 },
+      {
+        key: "goodsAllocationName",
+        title: "货位",
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "ALLOCATION_PARAM",
+        dataMapping: {
+          goodsAllocation: 'id',
+          goodsAllocationName: 'name',
+
+        },
+        isShow:true,
+        queryParams: (params) => ({
+          stordocId: params.warehouse,
+          pkOrg: params.puOrg,
+        }),
+        width: 180,
+      },
 
     ]
   },

+ 20 - 5
src/views/purchase/purchase-order/add/index.vue

@@ -526,10 +526,18 @@ export default {
 
       // WMS仓库
       if (type === "WAREHOUSE_PARAM") {
-        this.judgeGoodsAllocation(val.csFlag);
-        source.goodsAllocation = "";
-        source.goodsAllocationName = "";
-        // this.count++
+        // 货位在表头
+        // this.judgeGoodsAllocation(val.csFlag);
+        // source.goodsAllocation = "";
+        // source.goodsAllocationName = "";
+        // 货位在表体
+        this.params.puOrderItemList = this.params.puOrderItemList.map(
+          (item) => ({
+            ...item,
+            goodsAllocation: "",
+            goodsAllocationName: "",
+          })
+        );
       }
     },
 
@@ -1034,7 +1042,14 @@ export default {
                       :multiple="cColumn.multiple"
                       :placeholder="cColumn.placeholder"
                       :data-mapping="cColumn.dataMapping"
-                      :query-params="cColumn.queryParams"
+                      :query-params="
+                        cColumn.key !== 'goodsAllocationName'
+                          ? cColumn.queryParams
+                          : () => ({
+                              stordocId: params.warehouse,
+                              pkOrg: params.puOrg,
+                            })
+                      "
                       @change="handleTabReferChange"
                     >
                     </dr-popover-select>

+ 15 - 7
src/views/purchase/purchase-order/column.js

@@ -506,13 +506,7 @@ const CauseColumns = [
     },
     width:100,
   }, //WMS入库仓库名称
-  { 
-    item:{ key: "goodsAllocationName", title: "货位",},
-    attr:{
-      isHidden:true,
-    },
-    width:100,
-  },
+  
   { 
     item:{key: "customerDeptName", title: "客户部门" ,},
     attr:{
@@ -1068,6 +1062,13 @@ const PurTabColumns = [
           isSummary:true,
         },
       },
+      { 
+        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        attr:{
+          isHidden:true,
+        },
+        
+      },
       
     ].map(({ item, attr }) => ({
       attr,
@@ -1636,6 +1637,13 @@ const CommonTabColumns = [
           isHidden:true,
         },
       },
+      { 
+        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        attr:{
+          isHidden:true,
+        },
+        
+      },
       // { item:{key: "createByName", title: "创建人",width:100, },
       // { item:{key: "updateByName", title: "更新人" ,width:100,},
       

+ 23 - 32
src/views/purchase/purchase-order/edit/index.vue

@@ -453,9 +453,16 @@ export default {
 
       // WMS仓库
       if (type === "WAREHOUSE_PARAM") {
-        this.judgeGoodsAllocation(val.csFlag);
-        source.goodsAllocation = "";
-        source.goodsAllocationName = "";
+        // this.judgeGoodsAllocation(val.csFlag);
+        // source.goodsAllocation = "";
+        // source.goodsAllocationName = "";
+        this.params.puOrderItemList = this.params.puOrderItemList.map(
+          (item) => ({
+            ...item,
+            goodsAllocation: "",
+            goodsAllocationName: "",
+          })
+        );
         // this.count++
       }
     },
@@ -939,24 +946,6 @@ export default {
             :label="column.title"
             :name="column.key"
           >
-            <!-- <virtual-scroll 
-              :data="params[column.key].filter(item => item.delFlag === '0')" 
-              :item-size="53" 
-              :key-prop="column.key === 'puOrderItemList' ? 'rowNo' :'rowno'" 
-              @change="(virtualList) => tableData = virtualList" 
-              :virtualized="true"
-            >
-              <template slot-scope="{ headerCellFixedStyle, cellFixedStyle }"> -->
-            <!-- row-key绑定列唯一值,height一定要设置否则会滚动条滚动位置不对且数据滚动全部加载完后会出现白板-->
-            <!-- <el-table 
-                  border
-                  :ref="column.key"
-                  :data="tableData" 
-                  style="width: 100%"
-                  :headerCellStyle="headerCellFixedStyle"
-                  :cellStyle="cellFixedStyle"
-                  :height="tabHeight"
-                > -->
             <ux-grid
               border
               use-virtual
@@ -974,16 +963,11 @@ export default {
                 color: '#515a6e',
               }"
             >
-              <ux-table-column title="序号" type="index" width="60">
-                <!-- <template slot-scope="scope">
-                      {{ scope.row.$index + 1 }}
-                    </template> -->
-              </ux-table-column>
-              <!-- <el-table-column label="序号">
-                    <template slot-scope="scope">
-                      {{ scope.$index + 1 }}
-                    </template>
-                  </el-table-column> -->
+              <ux-table-column
+                title="序号"
+                type="index"
+                width="60"
+              ></ux-table-column>
               <ux-table-column
                 v-for="(cColumn, cIndex) in column.tableColumns"
                 :key="cIndex"
@@ -1025,7 +1009,14 @@ export default {
                       :multiple="cColumn.multiple"
                       :placeholder="cColumn.placeholder"
                       :data-mapping="cColumn.dataMapping"
-                      :query-params="cColumn.queryParams"
+                      :query-params="
+                        cColumn.key !== 'goodsAllocationName'
+                          ? cColumn.queryParams
+                          : () => ({
+                              stordocId: params.warehouse,
+                              pkOrg: params.puOrg,
+                            })
+                      "
                       size="mini"
                       @change="handleTabReferChange"
                     ></dr-popover-select>