<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="操作方式" prop="operationMethod">
        <el-input
          v-model="queryParams.operationMethod"
          placeholder="请输入操作方式"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="业务单据ID" prop="businessId">
        <el-input
          v-model="queryParams.businessId"
          placeholder="请输入业务单据ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="业务单号" prop="businessNo">
        <el-input
          v-model="queryParams.businessNo"
          placeholder="请输入业务单号"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物资ID" prop="materialId">
        <el-input
          v-model="queryParams.materialId"
          placeholder="请输入物资ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仓库ID" prop="warehouseId">
        <el-input
          v-model="queryParams.warehouseId"
          placeholder="请输入仓库ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货架ID" prop="locationId">
        <el-input
          v-model="queryParams.locationId"
          placeholder="请输入货架ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="批次号" prop="batchNo">
        <el-input
          v-model="queryParams.batchNo"
          placeholder="请输入批次号"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="操作数量" prop="operationQuantity">
        <el-input
          v-model="queryParams.operationQuantity"
          placeholder="请输入操作数量"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="操作时间" prop="operationTime">
        <el-date-picker clearable
          v-model="queryParams.operationTime"
          type="date"
          value-format="YYYY-MM-DD"
          placeholder="请选择操作时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="操作人ID" prop="operatorId">
        <el-input
          v-model="queryParams.operatorId"
          placeholder="请输入操作人ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="扫描的条形码" prop="barcode">
        <el-input
          v-model="queryParams.barcode"
          placeholder="请输入扫描的条形码"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="扫描设备ID" prop="scanDeviceId">
        <el-input
          v-model="queryParams.scanDeviceId"
          placeholder="请输入扫描设备ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="扫描次数" prop="scanCount">
        <el-input
          v-model="queryParams.scanCount"
          placeholder="请输入扫描次数"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="RFID标签" prop="rfidTag">
        <el-input
          v-model="queryParams.rfidTag"
          placeholder="请输入RFID标签"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="EPC编码" prop="epcCode">
        <el-input
          v-model="queryParams.epcCode"
          placeholder="请输入EPC编码"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="天线ID" prop="antennaId">
        <el-input
          v-model="queryParams.antennaId"
          placeholder="请输入天线ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="读写器ID" prop="readerId">
        <el-input
          v-model="queryParams.readerId"
          placeholder="请输入读写器ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="信号强度" prop="rssiValue">
        <el-input
          v-model="queryParams.rssiValue"
          placeholder="请输入信号强度"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="操作前系统数量" prop="systemQuantityBefore">
        <el-input
          v-model="queryParams.systemQuantityBefore"
          placeholder="请输入操作前系统数量"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="操作后系统数量" prop="systemQuantityAfter">
        <el-input
          v-model="queryParams.systemQuantityAfter"
          placeholder="请输入操作后系统数量"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="移动设备ID" prop="mobileDeviceId">
        <el-input
          v-model="queryParams.mobileDeviceId"
          placeholder="请输入移动设备ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="GPS位置" prop="gpsLocation">
        <el-input
          v-model="queryParams.gpsLocation"
          placeholder="请输入GPS位置"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否异常" prop="isException">
        <el-input
          v-model="queryParams.isException"
          placeholder="请输入是否异常"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否已处理" prop="exceptionHandled">
        <el-input
          v-model="queryParams.exceptionHandled"
          placeholder="请输入是否已处理"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="异常处理人" prop="exceptionHandlerId">
        <el-input
          v-model="queryParams.exceptionHandlerId"
          placeholder="请输入异常处理人"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="异常处理时间" prop="exceptionHandleTime">
        <el-date-picker clearable
          v-model="queryParams.exceptionHandleTime"
          type="date"
          value-format="YYYY-MM-DD"
          placeholder="请选择异常处理时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="操作耗时" prop="operationDuration">
        <el-input
          v-model="queryParams.operationDuration"
          placeholder="请输入操作耗时"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否批量操作" prop="isBatchOperation">
        <el-input
          v-model="queryParams.isBatchOperation"
          placeholder="请输入是否批量操作"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="批量操作数量" prop="batchSize">
        <el-input
          v-model="queryParams.batchSize"
          placeholder="请输入批量操作数量"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="RFID卡ID" prop="rfidCardId">
        <el-input
          v-model="queryParams.rfidCardId"
          placeholder="请输入RFID卡ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="RFID绑定ID" prop="rfidBindingId">
        <el-input
          v-model="queryParams.rfidBindingId"
          placeholder="请输入RFID绑定ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="RFID批量操作ID" prop="rfidBatchOperationId">
        <el-input
          v-model="queryParams.rfidBatchOperationId"
          placeholder="请输入RFID批量操作ID"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="Plus"
          @click="handleAdd"
          v-hasPermi="['ware:wmsOperationRecord:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['ware:wmsOperationRecord:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="Delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['ware:wmsOperationRecord:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="Download"
          @click="handleExport"
          v-hasPermi="['ware:wmsOperationRecord:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="wmsOperationRecordList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="记录ID" align="center" prop="recordId" />
      <el-table-column label="操作类型" align="center" prop="operationType" />
      <el-table-column label="操作方式" align="center" prop="operationMethod" />
      <el-table-column label="业务单据ID" align="center" prop="businessId" />
      <el-table-column label="业务类型" align="center" prop="businessType" />
      <el-table-column label="业务单号" align="center" prop="businessNo" />
      <el-table-column label="物资ID" align="center" prop="materialId" />
      <el-table-column label="仓库ID" align="center" prop="warehouseId" />
      <el-table-column label="货架ID" align="center" prop="locationId" />
      <el-table-column label="批次号" align="center" prop="batchNo" />
      <el-table-column label="操作数量" align="center" prop="operationQuantity" />
      <el-table-column label="操作时间" align="center" prop="operationTime" width="180">
        <template #default="scope">
          <span>{{ parseTime(scope.row.operationTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作人ID" align="center" prop="operatorId" />
      <el-table-column label="扫描的条形码" align="center" prop="barcode" />
      <el-table-column label="条码类型" align="center" prop="barcodeType" />
      <el-table-column label="扫描设备ID" align="center" prop="scanDeviceId" />
      <el-table-column label="扫描次数" align="center" prop="scanCount" />
      <el-table-column label="RFID标签" align="center" prop="rfidTag" />
      <el-table-column label="EPC编码" align="center" prop="epcCode" />
      <el-table-column label="天线ID" align="center" prop="antennaId" />
      <el-table-column label="读写器ID" align="center" prop="readerId" />
      <el-table-column label="信号强度" align="center" prop="rssiValue" />
      <el-table-column label="验证状态" align="center" prop="validationStatus" />
      <el-table-column label="验证消息" align="center" prop="validationMessage" />
      <el-table-column label="操作前系统数量" align="center" prop="systemQuantityBefore" />
      <el-table-column label="操作后系统数量" align="center" prop="systemQuantityAfter" />
      <el-table-column label="移动设备ID" align="center" prop="mobileDeviceId" />
      <el-table-column label="GPS位置" align="center" prop="gpsLocation" />
      <el-table-column label="网络类型" align="center" prop="networkType" />
      <el-table-column label="是否异常" align="center" prop="isException" />
      <el-table-column label="异常类型" align="center" prop="exceptionType" />
      <el-table-column label="是否已处理" align="center" prop="exceptionHandled" />
      <el-table-column label="异常处理人" align="center" prop="exceptionHandlerId" />
      <el-table-column label="异常处理时间" align="center" prop="exceptionHandleTime" width="180">
        <template #default="scope">
          <span>{{ parseTime(scope.row.exceptionHandleTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作耗时" align="center" prop="operationDuration" />
      <el-table-column label="是否批量操作" align="center" prop="isBatchOperation" />
      <el-table-column label="批量操作数量" align="center" prop="batchSize" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="RFID卡ID" align="center" prop="rfidCardId" />
      <el-table-column label="RFID绑定ID" align="center" prop="rfidBindingId" />
      <el-table-column label="RFID操作类型" align="center" prop="rfidOperationType" />
      <el-table-column label="RFID批量操作ID" align="center" prop="rfidBatchOperationId" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ware:wmsOperationRecord:edit']">修改</el-button>
          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['ware:wmsOperationRecord:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改出入库操作记录对话框 -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form ref="wmsOperationRecordRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="操作方式" prop="operationMethod">
          <el-input v-model="form.operationMethod" placeholder="请输入操作方式" />
        </el-form-item>
        <el-form-item label="业务单据ID" prop="businessId">
          <el-input v-model="form.businessId" placeholder="请输入业务单据ID" />
        </el-form-item>
        <el-form-item label="业务单号" prop="businessNo">
          <el-input v-model="form.businessNo" placeholder="请输入业务单号" />
        </el-form-item>
        <el-form-item label="物资ID" prop="materialId">
          <el-input v-model="form.materialId" placeholder="请输入物资ID" />
        </el-form-item>
        <el-form-item label="仓库ID" prop="warehouseId">
          <el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />
        </el-form-item>
        <el-form-item label="货架ID" prop="locationId">
          <el-input v-model="form.locationId" placeholder="请输入货架ID" />
        </el-form-item>
        <el-form-item label="批次号" prop="batchNo">
          <el-input v-model="form.batchNo" placeholder="请输入批次号" />
        </el-form-item>
        <el-form-item label="操作数量" prop="operationQuantity">
          <el-input v-model="form.operationQuantity" placeholder="请输入操作数量" />
        </el-form-item>
        <el-form-item label="操作时间" prop="operationTime">
          <el-date-picker clearable
            v-model="form.operationTime"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择操作时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="操作人ID" prop="operatorId">
          <el-input v-model="form.operatorId" placeholder="请输入操作人ID" />
        </el-form-item>
        <el-form-item label="扫描的条形码" prop="barcode">
          <el-input v-model="form.barcode" placeholder="请输入扫描的条形码" />
        </el-form-item>
        <el-form-item label="扫描设备ID" prop="scanDeviceId">
          <el-input v-model="form.scanDeviceId" placeholder="请输入扫描设备ID" />
        </el-form-item>
        <el-form-item label="扫描次数" prop="scanCount">
          <el-input v-model="form.scanCount" placeholder="请输入扫描次数" />
        </el-form-item>
        <el-form-item label="RFID标签" prop="rfidTag">
          <el-input v-model="form.rfidTag" placeholder="请输入RFID标签" />
        </el-form-item>
        <el-form-item label="EPC编码" prop="epcCode">
          <el-input v-model="form.epcCode" placeholder="请输入EPC编码" />
        </el-form-item>
        <el-form-item label="天线ID" prop="antennaId">
          <el-input v-model="form.antennaId" placeholder="请输入天线ID" />
        </el-form-item>
        <el-form-item label="读写器ID" prop="readerId">
          <el-input v-model="form.readerId" placeholder="请输入读写器ID" />
        </el-form-item>
        <el-form-item label="信号强度" prop="rssiValue">
          <el-input v-model="form.rssiValue" placeholder="请输入信号强度" />
        </el-form-item>
        <el-form-item label="验证消息" prop="validationMessage">
          <el-input v-model="form.validationMessage" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="操作前系统数量" prop="systemQuantityBefore">
          <el-input v-model="form.systemQuantityBefore" placeholder="请输入操作前系统数量" />
        </el-form-item>
        <el-form-item label="操作后系统数量" prop="systemQuantityAfter">
          <el-input v-model="form.systemQuantityAfter" placeholder="请输入操作后系统数量" />
        </el-form-item>
        <el-form-item label="移动设备ID" prop="mobileDeviceId">
          <el-input v-model="form.mobileDeviceId" placeholder="请输入移动设备ID" />
        </el-form-item>
        <el-form-item label="GPS位置" prop="gpsLocation">
          <el-input v-model="form.gpsLocation" placeholder="请输入GPS位置" />
        </el-form-item>
        <el-form-item label="是否异常" prop="isException">
          <el-input v-model="form.isException" placeholder="请输入是否异常" />
        </el-form-item>
        <el-form-item label="是否已处理" prop="exceptionHandled">
          <el-input v-model="form.exceptionHandled" placeholder="请输入是否已处理" />
        </el-form-item>
        <el-form-item label="异常处理人" prop="exceptionHandlerId">
          <el-input v-model="form.exceptionHandlerId" placeholder="请输入异常处理人" />
        </el-form-item>
        <el-form-item label="异常处理时间" prop="exceptionHandleTime">
          <el-date-picker clearable
            v-model="form.exceptionHandleTime"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择异常处理时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="操作耗时" prop="operationDuration">
          <el-input v-model="form.operationDuration" placeholder="请输入操作耗时" />
        </el-form-item>
        <el-form-item label="是否批量操作" prop="isBatchOperation">
          <el-input v-model="form.isBatchOperation" placeholder="请输入是否批量操作" />
        </el-form-item>
        <el-form-item label="批量操作数量" prop="batchSize">
          <el-input v-model="form.batchSize" placeholder="请输入批量操作数量" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="RFID卡ID" prop="rfidCardId">
          <el-input v-model="form.rfidCardId" placeholder="请输入RFID卡ID" />
        </el-form-item>
        <el-form-item label="RFID绑定ID" prop="rfidBindingId">
          <el-input v-model="form.rfidBindingId" placeholder="请输入RFID绑定ID" />
        </el-form-item>
        <el-form-item label="RFID批量操作ID" prop="rfidBatchOperationId">
          <el-input v-model="form.rfidBatchOperationId" placeholder="请输入RFID批量操作ID" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="WmsOperationRecord">
import { listWmsOperationRecord, getWmsOperationRecord, delWmsOperationRecord, addWmsOperationRecord, updateWmsOperationRecord } from "@/api/ware/wmsOperationRecord"

const { proxy } = getCurrentInstance()

const wmsOperationRecordList = ref([])
const open = ref(false)
const loading = ref(true)
const showSearch = ref(true)
const ids = ref([])
const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const title = ref("")

const data = reactive({
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    operationType: null,
    operationMethod: null,
    businessId: null,
    businessType: null,
    businessNo: null,
    materialId: null,
    warehouseId: null,
    locationId: null,
    batchNo: null,
    operationQuantity: null,
    operationTime: null,
    operatorId: null,
    barcode: null,
    barcodeType: null,
    scanDeviceId: null,
    scanCount: null,
    rfidTag: null,
    epcCode: null,
    antennaId: null,
    readerId: null,
    rssiValue: null,
    validationStatus: null,
    validationMessage: null,
    systemQuantityBefore: null,
    systemQuantityAfter: null,
    mobileDeviceId: null,
    gpsLocation: null,
    networkType: null,
    isException: null,
    exceptionType: null,
    exceptionHandled: null,
    exceptionHandlerId: null,
    exceptionHandleTime: null,
    operationDuration: null,
    isBatchOperation: null,
    batchSize: null,
    rfidCardId: null,
    rfidBindingId: null,
    rfidOperationType: null,
    rfidBatchOperationId: null
  },
  rules: {
    operationType: [
      { required: true, message: "操作类型不能为空", trigger: "change" }
    ],
    operationMethod: [
      { required: true, message: "操作方式不能为空", trigger: "blur" }
    ],
    businessId: [
      { required: true, message: "业务单据ID不能为空", trigger: "blur" }
    ],
    businessType: [
      { required: true, message: "业务类型不能为空", trigger: "change" }
    ],
    businessNo: [
      { required: true, message: "业务单号不能为空", trigger: "blur" }
    ],
    materialId: [
      { required: true, message: "物资ID不能为空", trigger: "blur" }
    ],
    warehouseId: [
      { required: true, message: "仓库ID不能为空", trigger: "blur" }
    ],
    operationQuantity: [
      { required: true, message: "操作数量不能为空", trigger: "blur" }
    ],
    operatorId: [
      { required: true, message: "操作人ID不能为空", trigger: "blur" }
    ],
  }
})

const { queryParams, form, rules } = toRefs(data)

/** 查询出入库操作记录列表 */
function getList() {
  loading.value = true
  listWmsOperationRecord(queryParams.value).then(response => {
    wmsOperationRecordList.value = response.rows
    total.value = response.total
    loading.value = false
  })
}

// 取消按钮
function cancel() {
  open.value = false
  reset()
}

// 表单重置
function reset() {
  form.value = {
    recordId: null,
    operationType: null,
    operationMethod: null,
    businessId: null,
    businessType: null,
    businessNo: null,
    materialId: null,
    warehouseId: null,
    locationId: null,
    batchNo: null,
    operationQuantity: null,
    operationTime: null,
    operatorId: null,
    barcode: null,
    barcodeType: null,
    scanDeviceId: null,
    scanCount: null,
    rfidTag: null,
    epcCode: null,
    antennaId: null,
    readerId: null,
    rssiValue: null,
    validationStatus: null,
    validationMessage: null,
    systemQuantityBefore: null,
    systemQuantityAfter: null,
    mobileDeviceId: null,
    gpsLocation: null,
    networkType: null,
    isException: null,
    exceptionType: null,
    exceptionHandled: null,
    exceptionHandlerId: null,
    exceptionHandleTime: null,
    operationDuration: null,
    isBatchOperation: null,
    batchSize: null,
    remark: null,
    createBy: null,
    createTime: null,
    updateBy: null,
    updateTime: null,
    rfidCardId: null,
    rfidBindingId: null,
    rfidOperationType: null,
    rfidBatchOperationId: null
  }
  proxy.resetForm("wmsOperationRecordRef")
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1
  getList()
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm("queryRef")
  handleQuery()
}

// 多选框选中数据
function handleSelectionChange(selection) {
  ids.value = selection.map(item => item.recordId)
  single.value = selection.length != 1
  multiple.value = !selection.length
}

/** 新增按钮操作 */
function handleAdd() {
  reset()
  open.value = true
  title.value = "添加出入库操作记录"
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset()
  const _recordId = row.recordId || ids.value
  getWmsOperationRecord(_recordId).then(response => {
    form.value = response.data
    open.value = true
    title.value = "修改出入库操作记录"
  })
}

/** 提交按钮 */
function submitForm() {
  proxy.$refs["wmsOperationRecordRef"].validate(valid => {
    if (valid) {
      if (form.value.recordId != null) {
        updateWmsOperationRecord(form.value).then(response => {
          proxy.$modal.msgSuccess("修改成功")
          open.value = false
          getList()
        })
      } else {
        addWmsOperationRecord(form.value).then(response => {
          proxy.$modal.msgSuccess("新增成功")
          open.value = false
          getList()
        })
      }
    }
  })
}

/** 删除按钮操作 */
function handleDelete(row) {
  const _recordIds = row.recordId || ids.value
  proxy.$modal.confirm('是否确认删除出入库操作记录编号为"' + _recordIds + '"的数据项？').then(function() {
    return delWmsOperationRecord(_recordIds)
  }).then(() => {
    getList()
    proxy.$modal.msgSuccess("删除成功")
  }).catch(() => {})
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download('ware/wmsOperationRecord/export', {
    ...queryParams.value
  }, `wmsOperationRecord_${new Date().getTime()}.xlsx`)
}

getList()
</script>
