shish 2 лет назад
Родитель
Сommit
c77227063a
1 измененных файлов с 23 добавлено и 11 удалено
  1. 23 11
      ghs/src/views/order/add.vue

+ 23 - 11
ghs/src/views/order/add.vue

@@ -38,6 +38,12 @@
           </template>
         </el-table-column>
 
+        <el-table-column prop="addTime" label="操作" align="center" width="150">
+          <template slot-scope="scope">
+            <el-button type="primary" size="mini" @click.stop="delItem(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+
       </el-table>
     </div>
     <div class="seek-list-box" v-if="!$util.isEmpty(getItemList) && showGetItemList == true">
@@ -339,17 +345,10 @@ export default {
         that.form.needPrint = 1
       }
       if(e && e.key=='Delete'){
-        that.$refs['itemSearchRef'].blur()
-        let current = that.selectList[that.selectIndex]
-        that.$confirm('确定删除 '+current.name+'?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
-          current.bigCount = 0
-          that.replaceItemFn(current,1,'sub')
-          that.selectIndex = 0
-          that.$refs.singleTable.setCurrentRow(that.selectList[0])
-          setTimeout(function(){
-            that.$refs['itemSearchRef'].focus()
-          },900)
-        })
+        if(that.selectList[that.selectIndex]){
+          let current = that.selectList[that.selectIndex]
+          that.delItem(current)
+        }
       }
       if(e && e.key=='PageDown'){
         that.removeFromSave()
@@ -402,6 +401,19 @@ export default {
 
   },
   methods: {
+    delItem(current){
+      let that = this
+        that.$refs['itemSearchRef'].blur()
+        that.$confirm('确定删除 '+current.name+'?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+          current.bigCount = 0
+          that.replaceItemFn(current,1,'sub')
+          that.selectIndex = 0
+          that.$refs.singleTable.setCurrentRow(that.selectList[0])
+          setTimeout(function(){
+            that.$refs['itemSearchRef'].focus()
+          },900)
+        })
+    },
     changeKdStaff(info){
       this.form.getStaffId = info.id
       this.form.getStaffName = info.name