| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <el-select v-model="checklistId" value-key="checklistId" style="width: 100%" filterable placeholder="请选择检查表">
- <el-option-group>
- <el-option
- v-for="item in dataList"
- :key="item.checklistId"
- :label="item.checklistTitle"
- :value="item.checklistId"
- />
- </el-option-group>
- </el-select>
- </template>
- <script>
- import { getOcChecklist } from '@/api/system/checklistApi'
- export default {
- name: 'OcChecklistSelector',
- components: { },
- props: {
- ocId: {
- type: Number,
- default: undefined
- },
- value: {
- type: Number,
- default: undefined
- }
- },
- data() {
- return {
- checklistId: undefined,
- dataList: [],
- conditions: {
- status: 1
- }
- }
- },
- watch: {
- value(val) {
- this.checklistId = val
- },
- checklistId(val) {
- this.$emit('input', val)
- }
- },
- created() {
- this.initData()
- },
- mounted() {},
- methods: {
- // 检查表清单
- initData() {
- getOcChecklist(this.ocId).then((resp) => {
- const { data } = resp
- this.dataList = data
- }).catch((error) => {
- console.log(error)
- })
- }
- }
- }
- </script>
|