shish 5 лет назад
Родитель
Сommit
75ef653a84
1 измененных файлов с 27 добавлено и 11 удалено
  1. 27 11
      hd/src/components/module/item-list-layer.vue

+ 27 - 11
hd/src/components/module/item-list-layer.vue

@@ -1,13 +1,13 @@
 <template>
 <template>
   <el-dialog title="选择花材" :visible.sync="selDialog" :close-on-click-modal="false" :append-to-body="true" @close="$emit('update:show', false)" width="950px">
   <el-dialog title="选择花材" :visible.sync="selDialog" :close-on-click-modal="false" :append-to-body="true" @close="$emit('update:show', false)" width="950px">
     <div class="recharge-modal-content">
     <div class="recharge-modal-content">
-      <el-checkbox-group v-model="checkList" class="radio-wrap">
-        <x-crud class="liu-crud-wrap" @load="onLoad">
+      <el-checkbox-group v-model="checkList" class="radio-wrap" >
 
 
+        <x-crud class="liu-crud-wrap" @load="onLoad">
           <template #table-column-radio="{scope}">
           <template #table-column-radio="{scope}">
             <div>
             <div>
               <el-checkbox v-if="scope.row.select == 2" disabled :label="scope.row" >{{scope.row.id}}</el-checkbox>
               <el-checkbox v-if="scope.row.select == 2" disabled :label="scope.row" >{{scope.row.id}}</el-checkbox>
-              <el-checkbox v-else :label="scope.row">{{scope.row.id}}</el-checkbox>
+              <el-checkbox v-else :label="scope.row" @click.stop.native="stop" >{{scope.row.id}}</el-checkbox>
             </div>
             </div>
           </template>
           </template>
 
 
@@ -17,15 +17,15 @@
           </template>
           </template>
 
 
           <template #table-column-stockWarning="{scope}">
           <template #table-column-stockWarning="{scope}">
-            <el-input v-model="scope.row.stockWarning" placeholder="库存预警值" size="small"></el-input>
+            <el-input v-model="scope.row.stockWarning" @click.stop.native="stop" placeholder="库存预警值" size="small"></el-input>
           </template>
           </template>
 
 
           <template #table-column-cost="{scope}">
           <template #table-column-cost="{scope}">
-            <el-input v-model="scope.row.cost" placeholder="成本价" size="small" ></el-input>
+            <el-input v-model="scope.row.cost" placeholder="成本价" @click.stop.native="stop" size="small" ></el-input>
           </template>
           </template>
 
 
           <template #table-column-addPrice="{scope}">
           <template #table-column-addPrice="{scope}">
-            <el-input v-model="scope.row.addPrice" placeholder="加价" size="small"></el-input>
+            <el-input v-model="scope.row.addPrice" placeholder="加价" @click.stop.native="stop" size="small"></el-input>
           </template>
           </template>
 
 
           <template #table-column-cover="{scope}">
           <template #table-column-cover="{scope}">
@@ -33,8 +33,8 @@
               <cl-avatar shape="square" :size="40" :src="scope.row.cover | default_avatar" :style="{ margin: 'auto' }" ></cl-avatar>
               <cl-avatar shape="square" :size="40" :src="scope.row.cover | default_avatar" :style="{ margin: 'auto' }" ></cl-avatar>
             </div>
             </div>
           </template>
           </template>
-
         </x-crud>
         </x-crud>
+
       </el-checkbox-group>
       </el-checkbox-group>
 
 
       <div>
       <div>
@@ -96,6 +96,7 @@ export default {
   },
   },
   created () { },
   created () { },
   methods: {
   methods: {
+    stop(){},
     selClassFn(val){
     selClassFn(val){
 			let index = this.itemClassList.findIndex((e) => e.name == val)
 			let index = this.itemClassList.findIndex((e) => e.name == val)
 			this.sonClassId = this.itemClassList[index].id
 			this.sonClassId = this.itemClassList[index].id
@@ -122,6 +123,20 @@ export default {
     resetForm () {
     resetForm () {
       this.$emit('cancel');
       this.$emit('cancel');
     },
     },
+    selectItem(row){
+      console.log(1212121121)
+      console.log(row)
+                //已经选过
+                if(row.select == 2){
+                  return false
+                }
+               let index = this.checkList.findIndex(e => e.id == row.id)
+               if(index === -1){
+                this.checkList = [row,...this.checkList]
+               }else{
+          this.checkList.splice(index,1)
+               }
+    },
     onLoad ({ ctx, app }) {
     onLoad ({ ctx, app }) {
 
 
       this.sonClassId = this.classId
       this.sonClassId = this.classId
@@ -183,10 +198,11 @@ export default {
               align: 'center'
               align: 'center'
             }
             }
           ],
           ],
-          on: {
-            'row-click': (row, column) => {
-            }
-          },
+					on: {
+						'row-click': (row, column) => {
+              this.selectItem(row)
+						}
+					},
           // 操作列
           // 操作列
           op: {
           op: {
             visible: false // 是否显示
             visible: false // 是否显示