feat(project): add team attribution and business statistics
Add tenant-scoped teams and projects, order attribution across four businesses, conversion inheritance, scoped statistics and audited reassignment. Reuse existing Web and mobile UI patterns; team regions and hospitals remain informational. Include incremental SQL and isolated regression coverage. Actual MySQL and browser/WebView integration validation remains pending; relates to issue #13.
This commit is contained in:
1 parent
e9df9d65e1
commit
bd62416263
79 files changed
+3390
-25
No files matched your search
@@ -41,6 +41,22 @@
|
||||
<div class="section-title-left"><h3>基本信息</h3></div>
|
||||
</div>
|
||||
<div class="form-grid form-grid--col4">
|
||||
<el-form-item
|
||||
label="所属项目"
|
||||
prop="projectId"
|
||||
:required="!isEdit && projectRequired"
|
||||
><ProjectSelect
|
||||
v-model="formData.projectId"
|
||||
biz-type="cell_storage"
|
||||
:disabled="isEdit"
|
||||
:project-name="formData.projectName"
|
||||
@required="projectRequired = $event"
|
||||
@ready="projectReady = $event"
|
||||
/>
|
||||
<div v-if="isEdit" class="form-tip">
|
||||
{{ formData.teamName || '未归属项目组' }} · 归属调整请使用项目归属维护
|
||||
</div></el-form-item
|
||||
>
|
||||
<el-form-item label="协议状态" prop="protocolStatus">
|
||||
<el-select
|
||||
v-model="formData.protocolStatus"
|
||||
@@ -1156,6 +1172,9 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import ProjectSelect from '@/components/business/ProjectSelect.vue'
|
||||
const projectRequired = ref(false)
|
||||
const projectReady = ref(false)
|
||||
import DialogFormBody from '@/components/business/dialog-form-body/index.vue'
|
||||
import SampleTransportFormSection from '@/components/business/sample-transport-form-section/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@@ -1489,6 +1508,9 @@
|
||||
const activeFormTab = ref('basic')
|
||||
|
||||
const formData = reactive({
|
||||
projectId: '',
|
||||
projectName: '',
|
||||
teamName: '',
|
||||
// Basic
|
||||
protocolNo: '',
|
||||
protocolNoId: '',
|
||||
@@ -1620,6 +1642,9 @@
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.projectId = ''
|
||||
formData.projectName = ''
|
||||
formData.teamName = ''
|
||||
managerSearchVersion++
|
||||
managerDefaultVersion++
|
||||
managerLoading.value = false
|
||||
@@ -2141,6 +2166,9 @@
|
||||
|
||||
function applyProtocolBundleToForm(bundle: Record<string, any>, row: CollectionProtocolRow) {
|
||||
const prot = bundle.protocol as Record<string, any> | null
|
||||
formData.projectId = String((bundle.basic || prot || {}).projectId || '')
|
||||
formData.projectName = String((bundle.basic || prot || {}).projectName || '')
|
||||
formData.teamName = String((bundle.basic || prot || {}).teamName || '')
|
||||
if (prot) {
|
||||
formData.collectorUserId = String(prot.collectorUserId || formData.collectorUserId || '')
|
||||
formData.protocolNo = String(prot.protocolNo || formData.protocolNo || '')
|
||||
@@ -2372,6 +2400,14 @@
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!isEdit.value && !projectReady.value) {
|
||||
ElMessage.warning('项目选项尚未加载成功,请稍候或重试')
|
||||
return
|
||||
}
|
||||
if (!isEdit.value && projectRequired.value && !formData.projectId) {
|
||||
ElMessage.warning('请选择所属项目')
|
||||
return
|
||||
}
|
||||
if (!formRef.value || submitLoading.value) return
|
||||
if (isEdit.value && !editDetailLoaded.value) {
|
||||
ElMessage.warning('协议详情尚未加载成功,请重新打开后重试')
|
||||
@@ -2476,6 +2512,7 @@
|
||||
.filter(Boolean)
|
||||
.join(',')
|
||||
const payload: Record<string, unknown> = {
|
||||
...(!isEdit.value ? { projectId: formData.projectId || undefined } : {}),
|
||||
protocolStatus: formData.protocolStatus,
|
||||
registerDate: formData.registerDate || '',
|
||||
collectorUserId: formData.collectorUserId || '',
|
||||
|
||||
Reference in new issue
Block a user