lyh
2025-04-09 53c269711fcb59f48fd2acd7e825bebfd31d09e5
src/views/eam/maintenance/EamInspectionOrderList.vue
@@ -44,13 +44,10 @@
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!--      <a-button type="primary" icon="download" @click="handleExportXls('eam_inspection_order')">导出</a-button>-->
<!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!--        <a-button type="primary" icon="import">导入</a-button>-->
<!--      </a-upload>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
          <a-menu-item key="1" @click="batchZf(5)"><a-icon type="snippets"/>作废</a-menu-item>
          <a-menu-item key="2" @click="batchLq(2)"><a-icon type="form"/>领取</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
@@ -98,18 +95,25 @@
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a v-if="record.inspectionStatus === '1'" @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-divider v-if="record.inspectionStatus === '1'" type="vertical" />
          <a-popconfirm v-if="record.inspectionStatus === '1'" title="确定领取吗?" @confirm="() => handleInspection(record.id)">
                  <a>领取</a>
          </a-popconfirm>
          <a-divider v-if="record.inspectionStatus === '1'" type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
              <a-menu-item  v-if="record.inspectionStatus === '1'" >
                <a-popconfirm title="确定作废吗?" @confirm="() => handleDelete(record.id)">
                  <a>作废</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
@@ -120,6 +124,7 @@
    </div>
    <eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"></eam-inspection-order-modal>
    <EamInspectionOrderModalXq ref="modalFormXq" @ok="modalFormOk"></EamInspectionOrderModalXq>
  </a-card>
</template>
@@ -129,12 +134,15 @@
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import EamInspectionOrderModal from './modules/EamInspectionOrderModal'
  import EamInspectionOrderModalXq from './modules/EamInspectionOrderModalXq.vue'
  import { deleteAction, getAction } from '@api/manage'
  export default {
    name: 'EamInspectionOrderList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      EamInspectionOrderModal
      EamInspectionOrderModal,
      EamInspectionOrderModalXq
    },
    data () {
      return {
@@ -159,12 +167,12 @@
          {
            title:'设备编号',
            align:"center",
            dataIndex: 'equipmentId'
            dataIndex: 'equipmentId_dictText'
          },
          {
            title:'标准编码',
            align:"center",
            dataIndex: 'standardId'
            dataIndex: 'standardId_dictText'
          },
          {
            title:'点检日期',
@@ -173,19 +181,6 @@
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'点检时间',
            align:"center",
            dataIndex: 'operateTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'点检人',
            align:"center",
            dataIndex: 'operator'
          },
          {
            title:'点检过期时间',
@@ -198,12 +193,25 @@
          {
            title:'创建方式',
            align:"center",
            dataIndex: 'creationMethod'
            dataIndex: 'creationMethod_dictText'
          },
          {
            title:'点检状态',
            align:"center",
            dataIndex: 'inspectionStatus_dictText'
          },
          {
            title:'点检时间',
            align:"center",
            dataIndex: 'operateTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'点检人',
            align:"center",
            dataIndex: 'operator_dictText'
          },
          {
            title:'班组长确认',
@@ -219,11 +227,6 @@
            }
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
@@ -234,11 +237,12 @@
        ],
        url: {
          list: "/eam/eamInspectionOrder/list",
          delete: "/eam/eamInspectionOrder/delete",
          delete: "/eam/eamInspectionOrder/cancelInspectionOrder",
          deleteBatch: "/eam/eamInspectionOrder/deleteBatch",
          exportXlsUrl: "/eam/eamInspectionOrder/exportXls",
          importExcelUrl: "eam/eamInspectionOrder/importExcel",
          receiveInspectionOrder : "eam/eamInspectionOrder/receiveInspectionOrder",
          cancelOrReceive: "eam/eamInspectionOrder/cancelOrReceive"
        },
        dictOptions:{},
        superFieldList:[],
@@ -271,7 +275,113 @@
        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
        fieldList.push({type:'string',value:'imageFiles',text:'照片文件ids;id以逗号分隔',dictCode:''})
        this.superFieldList = fieldList
      }
      },
      //详情
      handleDetail: function(record) {
        this.$refs.modalFormXq.edit(record);
        this.$refs.modalFormXq.title = "详情";
        this.$refs.modalFormXq.disableSubmit = true;
      },
      handleInspection(id) {
        if (!this.url.receiveInspectionOrder) {
          this.$message.error("请设置url.receiveInspectionOrder!")
          return
        }
        var that = this;
        getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => {
          if (res.success) {
            that.$notification.success({
              message: '消息',
              description: res.message
            });
            that.loadData();
          } else {
            // that.$message.warning(res.message);
            that.$notification.warning({
              message: '消息',
              description: res.message
            });
          }
        });
      },
      batchZf(type){
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
            message:'消息',
            description:"请选择一条记录"
          });
        } else {
          var ids = "";
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ",";
          }
          var that = this;
          this.$confirm({
            title: "确认作废",
            content: "是否作废选中数据,只有待点检状态的数据才可作废成功?",
            onOk: function () {
              that.loading = true;
              getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message:'消息',
                    description:res.message
                  });
                  that.loadData();
                  that.onClearSelected();
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                }
              }).finally(() => {
                that.loading = false;
              });
            }
          });
        }
      },
      batchLq(type){
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
            message:'消息',
            description:"请选择一条记录"
          });
        } else {
          var ids = "";
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ",";
          }
          var that = this;
          this.$confirm({
            title: "确认领取",
            content: "是否领取选中数据,只有待点检状态的数据才可领取成功?",
            onOk: function () {
              that.loading = true;
              getAction(that.url.cancelOrReceive, {ids: ids,type:type}).then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message:'消息',
                    description:res.message
                  });
                  that.loadData();
                  that.onClearSelected();
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                }
              }).finally(() => {
                that.loading = false;
              });
            }
          });
        }
      },
    }
  }
</script>