guarantee-lsq преди 1 година
родител
ревизия
7e08a9d181
променени са 1 файла, в които са добавени 6 реда и са изтрити 14 реда
  1. 6 14
      src/views/preparation/preparation/Preparation.vue

+ 6 - 14
src/views/preparation/preparation/Preparation.vue

@@ -75,6 +75,10 @@
             <!--            <a-divider v-if="record.status === 1" type="vertical" />-->
             <a-divider type="vertical" />
             <a @click="handlePrint(record)">打印</a>
+            <a-divider type="vertical" />
+            <a-popconfirm title="是否要删除该工单?" @confirm="batchDelete(record.id)">
+              <a>删除</a>
+            </a-popconfirm>
           </template>
         </span>
         <span slot="status" slot-scope="text">
@@ -92,7 +96,7 @@
 import { STable, Ellipsis } from '@/components'
 import BaseForm from './modules/BaseForm'
 import Detail from './modules/Detail'
-import { getPreparationPage, deletePreparations, fetchPreparation, exportPreparation } from '@/api/preparation/preparation'
+import { getPreparationPage, deletePreparation, fetchPreparation, exportPreparation } from '@/api/preparation/preparation'
 import TicketForm from './modules/TicketForm'
 import { queryBuilding } from '@/api/preparation/building'
 
@@ -263,21 +267,9 @@ export default {
       }
     },
     batchDelete (id) {
-      let ids = []
-      if (this.BaseTool.String.isBlank(id)) {
-        const length = this.selectedRows.length
-        if (length === 0) {
-          this.$message.info('请选择要删除的记录')
-          return
-        }
-        ids = this.selectedRows.map(item => item.id)
-      } else {
-        ids = [id]
-      }
-      deletePreparations(ids).then(res => {
+      deletePreparation({ id: id }).then(res => {
         this.$message.info('删除成功')
         this.handleOk()
-        this.$refs.table.clearSelected()
       })
     },
     handleAdd () {