Răsfoiți Sursa

搜索提示修改

duy 4 luni în urmă
părinte
comite
388f4fe1b2

+ 2 - 2
src/views/tentative/material/modules/testSample/dispose.vue

@@ -9,8 +9,8 @@
             <div class="ml-2 w-250px">
                 <hc-date-picker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
             </div>
-            <div class="ml-2 w-250px">
-                <hc-search-input v-model="searchForm.queryValue" @search="searchClick" />
+            <div class="ml-2 w-350px">
+                <hc-search-input v-model="searchForm.queryValue" placeholder="请输入“样品名称”、“规格型号”进行搜索" @search="searchClick" />
             </div>
         </template>
         <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }">

+ 2 - 2
src/views/tentative/material/modules/testSample/inventory.vue

@@ -9,8 +9,8 @@
             <div class="ml-2 w-250px">
                 <hc-date-picker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
             </div>
-            <div class="ml-2 w-250px">
-                <hc-search-input v-model="searchForm.materialName" @search="searchClick" />
+            <div class="ml-2 w-350px">
+                <hc-search-input v-model="searchForm.materialName" placeholder="请输入“样品名称”、“规格型号”进行搜索" @search="searchClick" />
             </div>
         </template>
         <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }">

+ 2 - 2
src/views/tentative/material/modules/testSample/leave.vue

@@ -9,8 +9,8 @@
             <div class="ml-2 w-250px">
                 <hc-date-picker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
             </div>
-            <div class="ml-2 w-250px">
-                <hc-search-input v-model="searchForm.materialName" @search="searchClick" />
+            <div class="ml-2 w-350px">
+                <hc-search-input v-model="searchForm.materialName" placeholder="请输入“样品名称”、“规格型号”进行搜索" @search="searchClick" />
             </div>
         </template>
         <template #extra>

+ 162 - 151
src/views/tentative/material/modules/testSample/testUnder.vue

@@ -23,9 +23,10 @@
                     @change="betweenTimeUpdate"
                 />
             </div>
-            <div class="ml-2 w-250px">
+            <div class="ml-2 w-350px">
                 <hc-search-input
                     v-model="searchForm.materialName"
+                    placeholder="请输入“样品名称”、“规格型号”进行搜索"
                     @search="searchClick"
                 />
             </div>
@@ -35,8 +36,9 @@
                 type="danger"
                 :disabled="tableCheckedKeys.length <= 0"
                 @click="batchDel"
-                >删除</el-button
             >
+                删除
+            </el-button>
         </template>
         <hc-table
             :column="tableColumn"
@@ -53,44 +55,50 @@
                     v-if="row.entrustStatus === 1"
                     type="info"
                     size="small"
-                    >{{ row.entrustStatusName || "-" }}</el-button
                 >
+                    {{ row.entrustStatusName || "-" }}
+                </el-button>
                 <!-- 待审批 -->
                 <el-button
                     v-if="row.entrustStatus === 2"
                     type="warning"
                     size="small"
-                    >{{ row.entrustStatusName || "-" }}</el-button
                 >
+                    {{ row.entrustStatusName || "-" }}
+                </el-button>
                 <!-- 待试验 -->
                 <el-button
                     v-if="row.entrustStatus === 3"
                     type="primary"
                     size="small"
-                    >{{ row.entrustStatusName || "-" }}</el-button
                 >
+                    {{ row.entrustStatusName || "-" }}
+                </el-button>
                 <!-- 已通过 -->
                 <el-button
                     v-if="row.entrustStatus === 4"
                     type="success"
                     size="small"
-                    >{{ row.entrustStatusName || "-" }}</el-button
                 >
+                    {{ row.entrustStatusName || "-" }}
+                </el-button>
                 <!-- 已废除 -->
                 <el-button
                     v-if="row.entrustStatus === 5"
                     type="danger"
                     size="small"
-                    >{{ row.entrustStatusName || "-" }}</el-button
                 >
+                    {{ row.entrustStatusName || "-" }}
+                </el-button>
             </template>
             <template #action="{ row }">
                 <el-link
                     v-if="row.entrustStatus === 4"
                     type="primary"
                     @click="rowDispose(row)"
-                    >样品处理</el-link
                 >
+                    样品处理
+                </el-link>
                 <el-link
                     v-else
                     type="primary"
@@ -98,14 +106,16 @@
                         !(row.entrustStatus === 1 || row.entrustStatus === 5)
                     "
                     @click="fillReportClick(row)"
-                    >填写报告</el-link
                 >
+                    填写报告
+                </el-link>
                 <el-link
                     type="danger"
                     :disabled="row.entrustStatus === 2"
                     @click="rowDel(row)"
-                    >删除</el-link
                 >
+                    删除
+                </el-link>
             </template>
         </hc-table>
         <template #action>
@@ -164,28 +174,29 @@
                     type="primary"
                     :loading="saveLoading"
                     @click="disposeSave"
-                    >确定</el-button
                 >
+                    确定
+                </el-button>
             </template>
         </hc-new-dialog>
     </hc-card-item>
 </template>
 
 <script setup>
-import { onMounted, ref, watch } from "vue";
-import { HcDelMsg } from "hc-vue3-ui";
-import router from "~src/router/index";
-import { useAppStore } from "~src/store";
-import { getErtractInfo } from "~api/other";
-import { delStoreValue, setStoreValue } from "~uti/storage";
+import { onMounted, ref, watch } from 'vue'
+import { HcDelMsg } from 'hc-vue3-ui'
+import router from '~src/router/index'
+import { useAppStore } from '~src/store'
+import { getErtractInfo } from '~api/other'
+import { delStoreValue, setStoreValue } from '~uti/storage'
 import {
     arrToId,
     formValidate,
     getArrValue,
     getObjValue,
     isNullES,
-} from "js-fast-way";
-import mainApi from "~api/tentative/material/testSample";
+} from 'js-fast-way'
+import mainApi from '~api/tentative/material/testSample'
 
 //参数
 const props = defineProps({
@@ -193,31 +204,31 @@ const props = defineProps({
         type: Object,
         default: () => ({}),
     },
-});
+})
 
 //变量
-const store = useAppStore();
-const projectId = ref(store.getProjectId);
-const contractId = ref(store.getContractId);
-const contractInfo = ref(store.getContractInfo);
+const store = useAppStore()
+const projectId = ref(store.getProjectId)
+const contractId = ref(store.getContractId)
+const contractInfo = ref(store.getContractInfo)
 
 //渲染完成
 onMounted(() => {
-    delStoreValue("test-form");
-    delStoreValue("testTreeItem");
-    delStoreValue("prenodeDataInfo");
-    getContractData();
-});
+    delStoreValue('test-form')
+    delStoreValue('testTreeItem')
+    delStoreValue('prenodeDataInfo')
+    getContractData()
+})
 
 //监听数据
-const treeInfo = ref(props.tree);
+const treeInfo = ref(props.tree)
 watch(
     () => props.tree,
     (obj) => {
-        treeInfo.value = getObjValue(obj);
-        searchClick();
-    }
-);
+        treeInfo.value = getObjValue(obj)
+        searchClick()
+    },
+)
 
 //搜索表单
 const searchForm = ref({
@@ -228,216 +239,216 @@ const searchForm = ref({
     current: 1,
     size: 20,
     total: 0,
-});
+})
 
 //获取合同段信息
-const contractData = ref([]);
+const contractData = ref([])
 const getContractData = async () => {
     const { data } = await getErtractInfo({
         projectId: projectId.value,
         contractId: contractId.value,
-    });
-    const res = getArrValue(data);
-    contractData.value = res;
-    if (res.length <= 0) return;
-    let cid;
+    })
+    const res = getArrValue(data)
+    contractData.value = res
+    if (res.length <= 0) return
+    let cid
     for (let i = 0; i < res.length; i++) {
         if (contractId.value == res[i].id) {
-            cid = res[i].id;
+            cid = res[i].id
         }
     }
-    searchForm.value.contractId = isNullES(cid) ? res[0].id : cid;
-    searchClick();
-};
+    searchForm.value.contractId = isNullES(cid) ? res[0].id : cid
+    searchClick()
+}
 
 //日期时间被选择
-const betweenTime = ref(null);
+const betweenTime = ref(null)
 const betweenTimeUpdate = ({ arr }) => {
-    betweenTime.value = arr;
+    betweenTime.value = arr
     if (arr.length > 0) {
-        searchForm.value.startTime = arr[0];
-        searchForm.value.endTime = arr[1];
+        searchForm.value.startTime = arr[0]
+        searchForm.value.endTime = arr[1]
     } else {
-        searchForm.value.startTime = null;
-        searchForm.value.endTime = null;
+        searchForm.value.startTime = null
+        searchForm.value.endTime = null
     }
-};
+}
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
-    getTableData();
-};
+    searchForm.value.current = 1
+    getTableData()
+}
 
 //分页被点击
 const pageChange = ({ current, size }) => {
-    searchForm.value.current = current;
-    searchForm.value.size = size;
-    getTableData();
-};
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
 
 //表格数据
 const tableColumn = ref([
-    { key: "materialName", name: "样品名称" },
-    { key: "specificationModel", name: "规格型号", align: "center" },
-    { key: "materialCount", name: "试样数量", align: "center" },
-    { key: "expCount", name: "试验数量", align: "center" },
-    { key: "sxCount", name: "剩余数量", align: "center" },
-    { key: "calculationUnit", name: "试样单位", align: "center" },
-    { key: "proposedPosition", name: "拟用部位" },
-    { key: "representativeCount", name: "代表数量", align: "center" },
-    { key: "representativeUnit", name: "代表单位" },
-    { key: "userName", name: "取样人", align: "center" },
-    { key: "userName", name: "取样人", align: "center" },
-    { key: "createTime", name: "创建试验时间", align: "center" },
-    { key: "entrustStatus", name: "报告状态", align: "center" },
+    { key: 'materialName', name: '样品名称' },
+    { key: 'specificationModel', name: '规格型号', align: 'center' },
+    { key: 'materialCount', name: '试样数量', align: 'center' },
+    { key: 'expCount', name: '试验数量', align: 'center' },
+    { key: 'sxCount', name: '剩余数量', align: 'center' },
+    { key: 'calculationUnit', name: '试样单位', align: 'center' },
+    { key: 'proposedPosition', name: '拟用部位' },
+    { key: 'representativeCount', name: '代表数量', align: 'center' },
+    { key: 'representativeUnit', name: '代表单位' },
+    { key: 'userName', name: '取样人', align: 'center' },
+    { key: 'userName', name: '取样人', align: 'center' },
+    { key: 'createTime', name: '创建试验时间', align: 'center' },
+    { key: 'entrustStatus', name: '报告状态', align: 'center' },
     {
-        key: "action",
-        name: "操作",
+        key: 'action',
+        name: '操作',
         width: 120,
-        align: "center",
-        fixed: "right",
+        align: 'center',
+        fixed: 'right',
     },
-]);
-const tableData = ref([]);
+])
+const tableData = ref([])
 
 //获取表格数据
-const tableLoading = ref(false);
+const tableLoading = ref(false)
 const getTableData = async () => {
-    const { primaryKeyId } = treeInfo.value;
-    if (isNullES(primaryKeyId)) return;
-    tableLoading.value = true;
+    const { primaryKeyId } = treeInfo.value
+    if (isNullES(primaryKeyId)) return
+    tableLoading.value = true
     const { error, code, data } = await mainApi.queryPage({
         ...searchForm.value,
         projectId: projectId.value,
-        nodeId: primaryKeyId || "",
-    });
+        nodeId: primaryKeyId || '',
+    })
     //处理数据
-    tableLoading.value = false;
+    tableLoading.value = false
     if (!error && code === 200) {
-        tableData.value = getArrValue(data?.records);
-        searchForm.value.total = data.total || 0;
+        tableData.value = getArrValue(data?.records)
+        searchForm.value.total = data.total || 0
     } else {
-        tableData.value = [];
-        searchForm.value.total = 0;
+        tableData.value = []
+        searchForm.value.total = 0
     }
-};
+}
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
-    tableCheckedKeys.value = rows;
-};
+    tableCheckedKeys.value = rows
+}
 
 //表单数据
-const formRef = ref(null);
-const formModel = ref({});
+const formRef = ref(null)
+const formModel = ref({})
 const formRules = {
     repealType: {
         required: true,
-        trigger: "blur",
-        message: "请选择处理方式",
+        trigger: 'blur',
+        message: '请选择处理方式',
     },
     repealReason: {
         required: true,
-        trigger: "blur",
-        message: "请填写处理原因",
+        trigger: 'blur',
+        message: '请填写处理原因',
     },
     resamStartTime: {
         required: true,
-        trigger: "blur",
-        message: "请选择留样时间",
+        trigger: 'blur',
+        message: '请选择留样时间',
     },
-};
+}
 
 //样品处理
-const disposeModal = ref(false);
+const disposeModal = ref(false)
 const rowDispose = (row) => {
     formModel.value = {
         id: row.id,
         repealType: 1,
-    };
-    disposeModal.value = true;
-};
+    }
+    disposeModal.value = true
+}
 
 //日期时间被选择
-const formTime = ref(null);
+const formTime = ref(null)
 const formTimeUpdate = ({ arr }) => {
-    formTime.value = arr;
+    formTime.value = arr
     if (arr.length > 0) {
-        formModel.value.resamStartTime = arr[0];
-        formModel.value.resamEndTime = arr[1];
+        formModel.value.resamStartTime = arr[0]
+        formModel.value.resamEndTime = arr[1]
     } else {
-        formModel.value.resamStartTime = "";
-        formModel.value.resamEndTime = "";
+        formModel.value.resamStartTime = ''
+        formModel.value.resamEndTime = ''
     }
-};
+}
 
 //确定提交
-const saveLoading = ref(false);
+const saveLoading = ref(false)
 const disposeSave = async () => {
-    const isForm = await formValidate(formRef.value);
-    if (!isForm) return;
-    const { error, code, msg } = await mainApi.update(formModel.value);
-    saveLoading.value = false;
+    const isForm = await formValidate(formRef.value)
+    if (!isForm) return
+    const { error, code, msg } = await mainApi.update(formModel.value)
+    saveLoading.value = false
     if (!error && code === 200) {
-        window.$message.success("提交成功");
-        disposeClose();
-        getTableData().then();
+        window.$message.success('提交成功')
+        disposeClose()
+        getTableData().then()
     } else {
-        window.$message.error(msg || "操作失败");
+        window.$message.error(msg || '操作失败')
     }
-};
+}
 
 //关闭弹窗
 const disposeClose = () => {
-    disposeModal.value = false;
-    formModel.value = {};
-};
+    disposeModal.value = false
+    formModel.value = {}
+}
 
 //删除
 const rowDel = (row) => {
     HcDelMsg(async (resolve) => {
-        await sampleRemoveApi(row.id);
-        resolve();
-    });
-};
+        await sampleRemoveApi(row.id)
+        resolve()
+    })
+}
 
 //批量删除
 const batchDel = () => {
-    const rows = tableCheckedKeys.value;
+    const rows = tableCheckedKeys.value
     if (rows.length <= 0) {
-        window.$message.warning("请先勾选要删除的数据");
-        return;
+        window.$message.warning('请先勾选要删除的数据')
+        return
     }
     HcDelMsg(async (resolve) => {
-        await sampleRemoveApi(arrToId(rows));
-        resolve();
-    });
-};
+        await sampleRemoveApi(arrToId(rows))
+        resolve()
+    })
+}
 
 //删除
 const sampleRemoveApi = async (ids) => {
-    const { error, code, msg } = await mainApi.sampleRemove(ids);
+    const { error, code, msg } = await mainApi.sampleRemove(ids)
     if (!error && code === 200) {
-        window.$message.success("删除成功");
-        getTableData().then();
+        window.$message.success('删除成功')
+        getTableData().then()
     } else {
-        window.$message.error(msg ?? "删除失败");
+        window.$message.error(msg ?? '删除失败')
     }
-};
+}
 
 //填写报告
 const fillReportClick = async ({ id, testId }) => {
-    const { error, code, data, msg } = await mainApi.detail(testId);
+    const { error, code, data, msg } = await mainApi.detail(testId)
     if (!error && code === 200) {
-        const res = getObjValue(data);
-        setStoreValue("test-form", res);
-        setStoreValue("testTreeItem", treeInfo.value);
-        setStoreValue("prenodeDataInfo", treeInfo.value);
+        const res = getObjValue(data)
+        setStoreValue('test-form', res)
+        setStoreValue('testTreeItem', treeInfo.value)
+        setStoreValue('prenodeDataInfo', treeInfo.value)
         router
             .push({
-                path: "/tentative/detect/test-form",
+                path: '/tentative/detect/test-form',
                 query: {
                     id: testId,
                     nodeId: res.nodeId,
@@ -447,9 +458,9 @@ const fillReportClick = async ({ id, testId }) => {
                     cid: searchForm.value?.contractId,
                 },
             })
-            .then();
+            .then()
     } else {
-        window.$message.error(msg || "操作失败");
+        window.$message.error(msg || '操作失败')
     }
-};
+}
 </script>

+ 134 - 131
src/views/tentative/material/modules/testSample/tested.vue

@@ -16,9 +16,10 @@
                     />
                 </el-select>
             </div>
-            <div class="ml-2 w-250px">
+            <div class="ml-2 w-350px">
                 <hc-search-input
                     v-model="searchForm.materialName"
+                    placeholder="请输入“样品名称”、“规格型号”进行搜索"
                     @search="searchClick"
                 />
             </div>
@@ -28,8 +29,9 @@
                 type="danger"
                 :disabled="tableCheckedKeys.length <= 0"
                 @click="batchCancel"
-                >取消待测</el-button
             >
+                取消待测
+            </el-button>
         </template>
         <hc-table
             :column="tableColumn"
@@ -41,12 +43,12 @@
             @selection-change="tableSelection"
         >
             <template #action="{ row }">
-                <el-link type="primary" @click="rowReports(row)"
-                    >创建报告</el-link
-                >
-                <el-link type="danger" @click="rowCancel(row)"
-                    >取消待测</el-link
-                >
+                <el-link type="primary" @click="rowReports(row)">
+                    创建报告
+                </el-link>
+                <el-link type="danger" @click="rowCancel(row)">
+                    取消待测
+                </el-link>
             </template>
         </hc-table>
         <template #action>
@@ -149,28 +151,29 @@
                     type="primary"
                     :loading="saveLoading"
                     @click="rowActionSave"
-                    >创建</el-button
                 >
+                    创建
+                </el-button>
             </template>
         </hc-new-dialog>
     </hc-card-item>
 </template>
 
 <script setup>
-import { onMounted, ref, watch } from "vue";
-import { useAppStore } from "~src/store";
-import router from "~src/router/index";
-import { getErtractInfo } from "~api/other";
-import { HcDelMsg } from "hc-vue3-ui";
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
+import router from '~src/router/index'
+import { getErtractInfo } from '~api/other'
+import { HcDelMsg } from 'hc-vue3-ui'
 import {
     arrToId,
     formValidate,
     getArrValue,
     getObjValue,
     isNullES,
-} from "js-fast-way";
-import mainApi from "~api/tentative/material/testSample";
-import { setStoreValue } from "~uti/storage";
+} from 'js-fast-way'
+import mainApi from '~api/tentative/material/testSample'
+import { setStoreValue } from '~uti/storage'
 
 //参数
 const props = defineProps({
@@ -178,28 +181,28 @@ const props = defineProps({
         type: Object,
         default: () => ({}),
     },
-});
+})
 
 //变量
-const store = useAppStore();
-const projectId = ref(store.getProjectId);
-const contractId = ref(store.getContractId);
-const contractInfo = ref(store.getContractInfo);
+const store = useAppStore()
+const projectId = ref(store.getProjectId)
+const contractId = ref(store.getContractId)
+const contractInfo = ref(store.getContractInfo)
 
 //渲染完成
 onMounted(() => {
-    getContractData();
-});
+    getContractData()
+})
 
 //监听数据
-const treeInfo = ref(props.tree);
+const treeInfo = ref(props.tree)
 watch(
     () => props.tree,
     (obj) => {
-        treeInfo.value = getObjValue(obj);
-        searchClick();
-    }
-);
+        treeInfo.value = getObjValue(obj)
+        searchClick()
+    },
+)
 
 //搜索表单
 const searchForm = ref({
@@ -208,189 +211,189 @@ const searchForm = ref({
     current: 1,
     size: 20,
     total: 0,
-});
+})
 
 //获取合同段信息
-const contractData = ref([]);
+const contractData = ref([])
 const getContractData = async () => {
     const { data } = await getErtractInfo({
         projectId: projectId.value,
         contractId: contractId.value,
-    });
-    const res = getArrValue(data);
-    contractData.value = res;
-    if (res.length <= 0) return;
-    let cid;
+    })
+    const res = getArrValue(data)
+    contractData.value = res
+    if (res.length <= 0) return
+    let cid
     for (let i = 0; i < res.length; i++) {
         if (contractId.value == res[i].id) {
-            cid = res[i].id;
+            cid = res[i].id
         }
     }
-    searchForm.value.contractId = isNullES(cid) ? res[0].id : cid;
-    searchClick();
-};
+    searchForm.value.contractId = isNullES(cid) ? res[0].id : cid
+    searchClick()
+}
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1;
-    getTableData();
-};
+    searchForm.value.current = 1
+    getTableData()
+}
 
 //分页被点击
 const pageChange = ({ current, size }) => {
-    searchForm.value.current = current;
-    searchForm.value.size = size;
-    getTableData();
-};
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
 
 //表格数据
 const tableColumn = ref([
-    { key: "materialName", name: "样品名称" },
-    { key: "specificationModel", name: "规格型号", align: "center" },
-    { key: "materialCount", name: "试样数量", align: "center" },
-    { key: "calculationUnit", name: "试样单位", align: "center" },
-    { key: "proposedPosition", name: "拟用部位" },
-    { key: "representativeCount", name: "代表数量", align: "center" },
-    { key: "representativeUnit", name: "代表单位" },
-    { key: "userName", name: "取样人", align: "center" },
-    { key: "ctestTime", name: "待测时间", align: "center" },
-    { key: "action", name: "操作", width: 150, align: "center" },
-]);
-const tableData = ref([]);
+    { key: 'materialName', name: '样品名称' },
+    { key: 'specificationModel', name: '规格型号', align: 'center' },
+    { key: 'materialCount', name: '试样数量', align: 'center' },
+    { key: 'calculationUnit', name: '试样单位', align: 'center' },
+    { key: 'proposedPosition', name: '拟用部位' },
+    { key: 'representativeCount', name: '代表数量', align: 'center' },
+    { key: 'representativeUnit', name: '代表单位' },
+    { key: 'userName', name: '取样人', align: 'center' },
+    { key: 'ctestTime', name: '待测时间', align: 'center' },
+    { key: 'action', name: '操作', width: 150, align: 'center' },
+])
+const tableData = ref([])
 
 //获取表格数据
-const tableLoading = ref(false);
+const tableLoading = ref(false)
 const getTableData = async () => {
-    const { primaryKeyId } = treeInfo.value;
-    if (isNullES(primaryKeyId)) return;
-    tableLoading.value = true;
+    const { primaryKeyId } = treeInfo.value
+    if (isNullES(primaryKeyId)) return
+    tableLoading.value = true
     const { error, code, data } = await mainApi.queryPage({
         ...searchForm.value,
         projectId: projectId.value,
-        nodeId: primaryKeyId || "",
-    });
+        nodeId: primaryKeyId || '',
+    })
     //处理数据
-    tableLoading.value = false;
+    tableLoading.value = false
     if (!error && code === 200) {
-        tableData.value = getArrValue(data?.records);
-        searchForm.value.total = data.total || 0;
+        tableData.value = getArrValue(data?.records)
+        searchForm.value.total = data.total || 0
     } else {
-        tableData.value = [];
-        searchForm.value.total = 0;
+        tableData.value = []
+        searchForm.value.total = 0
     }
-};
+}
 
 //多选
-const tableCheckedKeys = ref([]);
+const tableCheckedKeys = ref([])
 const tableSelection = (rows) => {
-    tableCheckedKeys.value = rows;
-};
+    tableCheckedKeys.value = rows
+}
 
 //表单数据
-const formRef = ref(null);
-const formModel = ref({});
+const formRef = ref(null)
+const formModel = ref({})
 const formRules = {
     expCount: {
         required: true,
-        trigger: "blur",
-        message: "请填写试验数量",
+        trigger: 'blur',
+        message: '请填写试验数量',
     },
-};
+}
 
 //弹窗
-const rowActionModal = ref(false);
+const rowActionModal = ref(false)
 
 //创建报告
 const rowReports = (row) => {
-    formModel.value = row;
-    rowActionModal.value = true;
-};
+    formModel.value = row
+    rowActionModal.value = true
+}
 
 //提交保存
-const saveLoading = ref(false);
+const saveLoading = ref(false)
 const rowActionSave = async () => {
-    const isForm = await formValidate(formRef.value);
-    if (!isForm) return;
-    saveLoading.value = true;
-    const { id, expCount } = formModel.value;
-    let form = { id, expCount };
-    form.sampleStatus = "";
-    const { error, code, msg } = await mainApi.update(form);
-    saveLoading.value = false;
+    const isForm = await formValidate(formRef.value)
+    if (!isForm) return
+    saveLoading.value = true
+    const { id, expCount } = formModel.value
+    let form = { id, expCount }
+    form.sampleStatus = ''
+    const { error, code, msg } = await mainApi.update(form)
+    saveLoading.value = false
     if (!error && code === 200) {
-        window.$message.success("创建成功");
-        rowActionModalClose();
-        getTableData().then();
+        window.$message.success('创建成功')
+        rowActionModalClose()
+        getTableData().then()
         //跳转到试验填报的新增
-        setStoreValue("testTreeItem", treeInfo.value);
-        setStoreValue("prenodeDataInfo", treeInfo.value);
-        const { contractType } = contractInfo.value;
-        const { primaryKeyId } = treeInfo.value;
+        setStoreValue('testTreeItem', treeInfo.value)
+        setStoreValue('prenodeDataInfo', treeInfo.value)
+        const { contractType } = contractInfo.value
+        const { primaryKeyId } = treeInfo.value
         router
             .push({
-                path: "/tentative/detect/test-form",
+                path: '/tentative/detect/test-form',
                 query: {
-                    nodeId: primaryKeyId || "",
-                    dataType: contractType > 0 ? contractType + "" : "1",
+                    nodeId: primaryKeyId || '',
+                    dataType: contractType > 0 ? contractType + '' : '1',
                     commissionId: id,
                     isaddType: true,
                     cid: searchForm.value?.contractId,
                 },
             })
-            .then();
+            .then()
     } else {
-        window.$message.error(msg || "创建失败");
+        window.$message.error(msg || '创建失败')
     }
-};
+}
 
 //关闭弹窗
 const rowActionModalClose = () => {
-    rowActionModal.value = false;
-    formModel.value = {};
-};
+    rowActionModal.value = false
+    formModel.value = {}
+}
 
 //取消待测
 const rowCancel = (row) => {
     HcDelMsg(
         {
-            title: "确认取消提醒",
-            text: "请谨慎考虑后,确认是否取消待测?",
+            title: '确认取消提醒',
+            text: '请谨慎考虑后,确认是否取消待测?',
         },
         async (resolve) => {
-            await tableDataCancel(row.id);
-            resolve(); //关闭弹窗的回调
-        }
-    );
-};
+            await tableDataCancel(row.id)
+            resolve() //关闭弹窗的回调
+        },
+    )
+}
 
 //批量取消待测
 const batchCancel = () => {
-    const rows = tableCheckedKeys.value;
+    const rows = tableCheckedKeys.value
     if (rows.length <= 0) {
-        window.$message.warning("请先勾选需要取消的数据");
-        return;
+        window.$message.warning('请先勾选需要取消的数据')
+        return
     }
     HcDelMsg(
         {
-            title: "确认取消提醒",
-            text: "请谨慎考虑后,确认是否取消待测?",
+            title: '确认取消提醒',
+            text: '请谨慎考虑后,确认是否取消待测?',
         },
         async (resolve) => {
-            await tableDataCancel(arrToId(rows));
-            resolve(); //关闭弹窗的回调
-        }
-    );
-};
+            await tableDataCancel(arrToId(rows))
+            resolve() //关闭弹窗的回调
+        },
+    )
+}
 
 //取消待测
 const tableDataCancel = async (ids) => {
-    let form = { id: ids, sampleStatus: 2 };
-    const { error, code, msg } = await mainApi.update(form);
+    let form = { id: ids, sampleStatus: 2 }
+    const { error, code, msg } = await mainApi.update(form)
     if (!error && code === 200) {
-        window.$message.success("取消成功");
-        getTableData().then();
+        window.$message.success('取消成功')
+        getTableData().then()
     } else {
-        window.$message.error(msg || "创建失败");
+        window.$message.error(msg || '创建失败')
     }
-};
+}
 </script>