spring
10 天以前 0c445ac6d2a20153e5eac390555ba88f950d76b0
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -96,16 +96,14 @@
          </el-col>
        </el-row>
      </el-form>
      <div style="margin-bottom: 10px;text-align: right">
        <el-button type="danger" plain @click="handleDelete">删除</el-button>
      </div>
<!--      <div style="margin-bottom: 10px;text-align: right">-->
<!--        <el-button type="danger" plain @click="handleDelete">删除</el-button>-->
<!--      </div>-->
      <PIMTable
          rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :tableLoading="tableLoading"
          :isSelection="true"
          @selection-change="handleSelectionChange"
          height="400"
      >
        <template #slot="{ row }">
@@ -200,6 +198,7 @@
  getOptions().then((res) => {
    supplierList.value = res.data;
  });
   form.value = {}
  getProductOptions();
  if (operationType.value === 'edit') {
    form.value = {...row}
@@ -254,6 +253,11 @@
  proxy.$refs.formRef.validate(valid => {
    if (valid) {
      form.value.inspectType = 0
         if (operationType.value === "add") {
            tableData.value.forEach((item) => {
               delete item.id
            })
         }
      const data = {...form.value, qualityInspectParams: tableData.value}
      if (operationType.value === "add") {
        qualityInspectAdd(data).then(res => {
@@ -269,34 +273,6 @@
    }
  })
}
const handleSelectionChange = (selection) => {
  selectedRows.value = selection;
};
const handleDelete = () => {
  let ids = [];
  if (selectedRows.value.length > 0) {
    ids = selectedRows.value.map((item) => item.id);
  } else {
    proxy.$modal.msgWarning("请选择数据");
    return;
  }
  ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
      .then(() => {
        qualityInspectParamDel(ids).then((res) => {
          proxy.$modal.msgSuccess("删除成功");
          getList();
        });
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
};
const getList = () => {
  qualityInspectDetailByProductId(currentProductId.value).then(res => {