Ver Fonte

批量复制

002390 há 1 ano atrás
pai
commit
539bdcba89

+ 42 - 0
src/components/popover-select-v2/index.vue

@@ -48,6 +48,13 @@ export default {
         return "TITEL";
       },
     },
+    // 赋值
+    copy:{
+      type:Boolean,
+      default:() =>{
+        return false
+      }
+    },
   },
   components: {
     ElSuperTable: () => import("@/components/super-table/index.vue"),
@@ -212,6 +219,28 @@ export default {
         this.$emit("change", prop[0], this.$props);
       }
     },
+    async handleChange(){
+      // 物料赋值'MATERIAL_PARAM'
+      const { referName} = this.$props;
+
+      let materialCodeList = this.innerValue.split(/,|,|\s+/);
+      
+      try {
+        let { code, rows } = await REFER( {
+            materialCodeList,
+            type:referName,
+          })
+        if(code == 200){
+          this.$emit("change", rows, this.$props);
+        }
+      } catch (error) {
+        
+      }
+      
+    },
+    handleClear(){
+      this.innerValue = '';
+    },
   },
   created() {},
   mounted() {},
@@ -221,7 +250,20 @@ export default {
 
 <template>
   <div class="popover-select-v2">
+    <el-input
+      v-if="copy"
+      clearable
+      v-bind="$attrs"
+      v-model="innerValue"
+      :size="size"
+      @clear="handleClear"
+      @change="handleChange"
+      @keyup.enter.native="handleChange"
+    >
+      <i :size="size" class="el-icon-search" slot="suffix" @click="open"> </i>
+    </el-input>
     <el-autocomplete
+      v-else
       clearable
       v-bind="$attrs"
       v-model="innerValue"

+ 11 - 8
src/components/popover-select/index.vue

@@ -281,19 +281,22 @@ export default {
         cb([]);
       }
     },
-    handleChange(){
+    async handleChange(){
       // 物料赋值'MATERIAL_PARAM'
-
-      let { type } = this;
-      // "1024501505   "1024201255" "1824702405""1024301505"  "1024802405"
-      let materialCodelist = this.innerValue.split(',')
-      console.log(this.innerValue,'innerValue');
+      const { type, source } = this.$props;
       if(type === 'MATERIAL_PARAM'){
+
+        let materialCodeList = this.innerValue.split(/,|,|\s+/);
+        
         try {
-          let { code, data } = REFER( {
-              materialCodelist,
+          let { code, rows } = await REFER( {
+            materialCodeList,
               type,
             })
+
+          if(code == 200){
+            // this.$emit("change",rows, type, source);
+          }
         } catch (error) {
           
         }

+ 3 - 2
src/components/super-ux-table/index.vue

@@ -181,6 +181,7 @@ export default {
     },
     //
     onRowClick(row, column, event) {
+      
       const { radio, checkbox } = this.$props;
       // 单选
       if (radio) {
@@ -189,7 +190,7 @@ export default {
       // 多选
       if (checkbox) {
         this.$refs.superUxTable.toggleRowSelection(
-          this.innerValue.find((item) => item.id === row.id)
+          [this.innerValue.find((item) => item.id === row.id)]
         );
       }
     },
@@ -351,7 +352,7 @@ export default {
       :data="innerValue"
       :show-summary="showSummary"
       :summary-method="getSummaries"
-      :highlight-current-row="radio"
+      highlight-current-row
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
       :header-row-style="{

+ 16 - 2
src/views/material/changeApply/add/index.vue

@@ -298,7 +298,11 @@ export default {
 
         row.usefulLife = '';
       }
-    }
+    },
+    // 物料编码
+    materialCodeChange( rows, props){
+      console.log(rows, props,'rows, props');
+    },
 
   },
   created() {
@@ -380,6 +384,17 @@ export default {
                 :columns="columns"
                 :size="$attrs.size"
               >
+                <!-- <template slot="materialCode" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    copy
+                    @change="materialCodeChange"
+                  >
+                  </component>
+                </template> -->
                 <template slot="materialName" slot-scope="scope">
                   <component
                     v-bind="scope.attr"
@@ -530,7 +545,6 @@ export default {
                   </component>
                 </template>
   
-  
                 <el-table-column fixed="right" label="操作" width="120" align="center">
                   <template slot="header" slot-scope="scope">
                     <el-button

+ 19 - 8
src/views/material/changeApply/index.vue

@@ -45,18 +45,19 @@
         </el-col>
       </el-row>
 
-      <div style="height: 600px; display:flex;">
-        <el-super-table
+      <!-- <div style="height: 600px; display:flex;"> -->
+        <el-super-ux-table
           v-model="tableList"
           :dict="dict"
-          :columns="TableColumns"
           :size="size"
           pagination
           :page="page"
+          :height="tableHeight"
+          :columns="TableColumns"
           @pagination="useQuery(params, page)"
           @row-dblclick="useSee"
         >
-          <el-table-column fixed="right" label="操作" width="150" align="center">
+          <ux-table-column fixed="right" title="操作" width="180" align="center">
             <template slot-scope="scope">
               <el-button type="text" size="small" @click.stop="useSee(scope.row)">查看</el-button>
               <el-button 
@@ -64,7 +65,7 @@
                 type="text" 
                 size="mini"
                 @click.stop="handleBack(scope.row)"
-              >流程收回</el-button>
+              >收回</el-button>
               <el-button  
                 v-if="scope.row.oaId && scope.row.oaId !=''" 
                 @click.stop="jumpFlow(scope.row)" 
@@ -74,9 +75,9 @@
               <el-button @click.stop="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
               <el-button type="text" size="small" @click.stop="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
             </template>
-          </el-table-column>
-        </el-super-table>
-      </div>
+          </ux-table-column>
+        </el-super-ux-table>
+      <!-- </div> -->
     </div>
 </el-card>
 
@@ -97,6 +98,7 @@ export default {
     BatchImport:() => import('./batchImport/index.vue'),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
   },
 
   data(){
@@ -231,6 +233,15 @@ export default {
     },
  
   },
+  computed: {
+      tableHeight:{
+        get(){
+          console.log(window,'window');
+          return window.innerHeight - 220;
+        },
+        set(){},
+      }
+    },
   created(){
     this.params.code = this.$route.query.billCode
     this.useQuery(this.params, this.page);

+ 2 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -557,6 +557,7 @@ export default {
     // 子表参照改变之后
     async handleTabReferChange(val,  type, source) {
 
+      // console.log(val,'val');
       // 触发物料参照询价 
       if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
 
@@ -1068,7 +1069,7 @@ export default {
                         style="width: 100%"
                       ></el-input>
   
-                      <!--  -->
+                      <!-- copy -->
                       <dr-popover-select
                         v-if="cColumn.inputType === 'PopoverSelect'"
                         v-model="scope.row[cColumn.key]"

+ 0 - 1
vue.config.js

@@ -44,7 +44,6 @@ module.exports = {
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //这是一个美女的本地
-        // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.21:8000/drp-admin`, //CKF本地
         // target: `http://172.16.61.99:8000/drp-admin`, //lz's localhost
         //  target: `http://127.0.0.1:8000/drp-admin`,