Ver Fonte

检定完善

xiongchao há 3 anos atrás
pai
commit
5872185dc8

+ 13 - 2
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -28,11 +28,16 @@
         <a-icon type="upload"/>
         新增导入
       </a-button>
+      <a-button style="margin-left:8px;" type="primary" v-if="selectedRowKeys.length > 0" @click="batchDelete">
+        <a-icon type="delete"/>
+        删除
+      </a-button>
       <!--      <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>-->
     </div>
     <a-table
       :data-source="data"
       :columns="columns"
+      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
       tableLayout="auto"
       rowKey="id">
       <span slot="action" slot-scope="record">
@@ -113,6 +118,7 @@ export default {
       modalTitle: null,
       visible: false,
       typeMap: {},
+      selectedRowKeys: [], // Check here to configure the default column
       checkUserTypeMap: {},
       actionTypeMap: {},
       // 表头
@@ -171,6 +177,9 @@ export default {
     this.checkUserTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_USER_TYPE)
   },
   methods: {
+    onSelectChange (selectedRowKeys) {
+      this.selectedRowKeys = selectedRowKeys
+    },
     base (record) {
       this.visible = true
       this.model = record
@@ -215,16 +224,18 @@ export default {
     handleCancel () {
       this.visible = false
       this.confirmLoading = false
+      this.selectedRowKeys = []
       this.$emit('ok')
     },
     batchDelete (id) {
       let ids = []
       if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRowKeys.length
         if (length === 0) {
-          this.$message.info('请选择要删除的记录')
+          this.$message.info('请选择记录')
           return
         }
-        ids = this.selectedRows.map(item => item.id)
+        ids = this.selectedRowKeys
       } else {
         ids = [id]
       }

+ 1 - 1
src/views/repair/application-form/modules/DetailRepair.vue

@@ -8,7 +8,7 @@
             <a-button v-if="showSbFlag" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
             <a-button v-if="$auth('repair-application-forms-assign') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status" type="primary" @click="handleAssign">派工</a-button>
             <a-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要接收?" @confirm="receive">
-              <a-button style="margin-left: 16px">接收</a-button>
+              <a-button style="margin-left: 8px" style="margin-left: 16px">接收</a-button>
             </a-popconfirm>
             <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="primary" @click="handleOut">委外</a-button>
             <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 8px" type="primary" @click="handleDispatch">转派</a-button>