|
@@ -25,14 +25,67 @@
|
|
<template #action>
|
|
<template #action>
|
|
<hc-pages :pages="searchForm" @change="pageChange" />
|
|
<hc-pages :pages="searchForm" @change="pageChange" />
|
|
</template>
|
|
</template>
|
|
|
|
+
|
|
|
|
+ <!-- 创建报告 -->
|
|
|
|
+ <hc-new-dialog v-model="rowActionModal" is-footer-center title="创建报告" widths="40rem" @close="rowActionModalClose">
|
|
|
|
+ <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top" label-width="auto">
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="委托单位:">
|
|
|
|
+ <el-input v-model="formModel.entrustInfo" placeholder="委托单位" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="委托单位名称:">
|
|
|
|
+ <el-input v-model="formModel.entrustName" placeholder="委托单位名称" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="取样名称:">
|
|
|
|
+ <el-input v-model="formModel.materialName" placeholder="取样名称" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="取样数量:">
|
|
|
|
+ <el-input v-model="formModel.materialCount" placeholder="取样数量" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="样品编号:">
|
|
|
|
+ <el-input v-model="formModel.entrustNo" placeholder="样品编号" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="试验数量:" prop="expCount">
|
|
|
|
+ <el-input v-model="formModel.expCount" placeholder="试验数量" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="规格型号:">
|
|
|
|
+ <el-input v-model="formModel.specificationModel" placeholder="规格型号" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="计算单位:">
|
|
|
|
+ <el-input v-model="formModel.calculationUnit" placeholder="计算单位" disabled />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <el-button @click="rowActionModalClose">取消</el-button>
|
|
|
|
+ <el-button hc-btn type="primary" :loading="saveLoading" @click="rowActionSave">创建</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </hc-new-dialog>
|
|
</hc-card-item>
|
|
</hc-card-item>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { onMounted, ref, watch } from 'vue'
|
|
import { onMounted, ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
|
|
+import router from '~src/router/index'
|
|
import { getErtractInfo } from '~api/other'
|
|
import { getErtractInfo } from '~api/other'
|
|
-import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
|
|
|
+import { formValidate, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
import mainApi from '~api/tentative/material/testSample'
|
|
import mainApi from '~api/tentative/material/testSample'
|
|
|
|
|
|
//参数
|
|
//参数
|
|
@@ -47,6 +100,7 @@ const props = defineProps({
|
|
const store = useAppStore()
|
|
const store = useAppStore()
|
|
const projectId = ref(store.getProjectId)
|
|
const projectId = ref(store.getProjectId)
|
|
const contractId = ref(store.getContractId)
|
|
const contractId = ref(store.getContractId)
|
|
|
|
+const contractInfo = ref(store.getContractInfo)
|
|
|
|
|
|
//渲染完成
|
|
//渲染完成
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -134,9 +188,60 @@ const tableSelection = (rows) => {
|
|
tableCheckedKeys.value = rows
|
|
tableCheckedKeys.value = rows
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//表单数据
|
|
|
|
+const formRef = ref(null)
|
|
|
|
+const formModel = ref({})
|
|
|
|
+const formRules = {
|
|
|
|
+ expCount: {
|
|
|
|
+ required: true,
|
|
|
|
+ trigger: 'blur',
|
|
|
|
+ message: '请填写试验数量',
|
|
|
|
+ },
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//弹窗
|
|
|
|
+const rowActionModal = ref(false)
|
|
|
|
+
|
|
//创建报告
|
|
//创建报告
|
|
const rowReports = (row) => {
|
|
const rowReports = (row) => {
|
|
|
|
+ formModel.value = row
|
|
|
|
+ rowActionModal.value = true
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//提交保存
|
|
|
|
+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, sampleStatus: 4 }
|
|
|
|
+ const { error, code, msg } = await mainApi.update(form)
|
|
|
|
+ saveLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.$message.success('创建成功')
|
|
|
|
+ rowActionModalClose()
|
|
|
|
+ //跳转到试验填报的新增
|
|
|
|
+ const { contractType } = contractInfo.value
|
|
|
|
+ const { primaryKeyId } = treeInfo.value
|
|
|
|
+ router.push({
|
|
|
|
+ path: '/tentative/detect/test-form',
|
|
|
|
+ query: {
|
|
|
|
+ nodeId: primaryKeyId || '',
|
|
|
|
+ dataType: contractType > 0 ? contractType + '' : '1',
|
|
|
|
+ commissionId: id,
|
|
|
|
+ isaddType: true,
|
|
|
|
+ },
|
|
|
|
+ }).then()
|
|
|
|
+ } else {
|
|
|
|
+ window.$message.error(msg || '创建失败')
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
+//关闭弹窗
|
|
|
|
+const rowActionModalClose = () => {
|
|
|
|
+ rowActionModal.value = false
|
|
|
|
+ formModel.value = {}
|
|
}
|
|
}
|
|
|
|
|
|
//取消待测
|
|
//取消待测
|