| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <!-- ç´§æ¥è系人 --> |
| | | <el-card class="form-card" shadow="never"> |
| | | <template #header> |
| | | <span class="card-title"> |
| | | <span class="card-title-line">|</span> |
| | | ç´§æ¥è系人 |
| | | </span> |
| | | </template> |
| | | <el-table :data="form.staffEmergencyContactList" border> |
| | | <el-table-column label="ç´§æ¥è系人å§å" prop="contactName" min-width="160"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.contactName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="50" |
| | | show-word-limit |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç´§æ¥è系人å
³ç³»" prop="contactRelation" min-width="140"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.contactRelation" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="20" |
| | | show-word-limit |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç´§æ¥èç³»äººææº" prop="contactPhone" width="160"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.contactPhone" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="11" |
| | | show-word-limit |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç´§æ¥è系人ä½å" prop="contactAddress" min-width="220"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.contactAddress" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="50" |
| | | show-word-limit |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="80" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | v-if="form.staffEmergencyContactList.length > 1" |
| | | type="primary" |
| | | link |
| | | @click="removeEmergencyRow(scope.$index)" |
| | | > |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="table-add-row" @click="addEmergencyRow">æ°å»ºä¸è¡</div> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { toRefs } from "vue"; |
| | | |
| | | const props = defineProps({ |
| | | form: { type: Object, required: true } |
| | | }); |
| | | |
| | | const { form } = toRefs(props); |
| | | |
| | | const addEmergencyRow = () => { |
| | | form.value.staffEmergencyContactList.push({ |
| | | contactName: "", |
| | | contactRelation: "", |
| | | contactPhone: "", |
| | | contactAddress: "", |
| | | }); |
| | | }; |
| | | |
| | | const removeEmergencyRow = (index) => { |
| | | if (form.value.staffEmergencyContactList.length <= 1) return; |
| | | form.value.staffEmergencyContactList.splice(index, 1); |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .form-card { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .card-title-line { |
| | | color: #f56c6c; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .table-add-row { |
| | | margin-top: 8px; |
| | | color: #409eff; |
| | | cursor: pointer; |
| | | font-size: 14px; |
| | | } |
| | | </style> |
| | | |