|
|
@@ -99,6 +99,7 @@ function handleRowValidate(key: string) {
|
|
|
}
|
|
|
|
|
|
const rules: FormRules = {
|
|
|
+ deptId: [{ required: true, message: '请选择施工队伍', trigger: ['blur', 'change'] }],
|
|
|
timeRange: [
|
|
|
{ required: true, message: '请选择时间节点', trigger: ['blur', 'change'], type: 'array' }
|
|
|
],
|
|
|
@@ -120,13 +121,17 @@ interface UserOptions {
|
|
|
|
|
|
const userOptions = ref<UserOptions[]>([])
|
|
|
|
|
|
-const deptName = ref('')
|
|
|
+const deptOptions = ref<UserOptions[]>([])
|
|
|
|
|
|
const submitterNames = ref('')
|
|
|
|
|
|
async function loadDept() {
|
|
|
- const res = await DeptApi.getDept(deptId)
|
|
|
- deptName.value = res.name
|
|
|
+ const res = await DeptApi.specifiedSimpleDepts(deptId)
|
|
|
+ deptOptions.value = res.map((item: any) => ({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ raw: item
|
|
|
+ }))
|
|
|
}
|
|
|
|
|
|
async function loadUserOptions() {
|
|
|
@@ -144,12 +149,12 @@ async function load() {
|
|
|
loading.value = true
|
|
|
|
|
|
await loadUserOptions()
|
|
|
+ await loadDept()
|
|
|
|
|
|
submitterNames.value = user.nickname
|
|
|
|
|
|
if (props.isview && props.id) {
|
|
|
const res = await IotRdDailyReportApi.getIotRdDailyReport(props.id)
|
|
|
- deptName.value = res.deptName
|
|
|
submitterNames.value = res.submitterNames
|
|
|
form.value = {
|
|
|
deptId: res.deptId,
|
|
|
@@ -165,8 +170,6 @@ async function load() {
|
|
|
otherNptReason: res.otherNptReason,
|
|
|
...NON_PROD_FIELDS.reduce((acc, field) => ({ ...acc, [field.key]: res[field.key] }), {})
|
|
|
}
|
|
|
- } else {
|
|
|
- await loadDept()
|
|
|
}
|
|
|
|
|
|
loading.value = false
|
|
|
@@ -245,7 +248,15 @@ async function submitForm() {
|
|
|
:disabled="props.isview !== 'create'"
|
|
|
>
|
|
|
<div class="grid grid-cols-2 gap-x-8">
|
|
|
- <el-form-item label="施工队伍">{{ deptName }}</el-form-item>
|
|
|
+ <el-form-item label="施工队伍" prop="deptId">
|
|
|
+ <el-select
|
|
|
+ v-model="form.deptId"
|
|
|
+ :options="deptOptions"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择施工队伍"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="施工地点" prop="location">
|
|
|
<el-input v-model="form.location" clearable placeholder="请输入施工地点" />
|
|
|
</el-form-item>
|