| | |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="涉及相关部门" prop="workDetail.involvedDepIds"> |
| | | <el-select v-model="form.workDetail.involvedDepIds" multiple> |
| | | <el-option v-for="item in otherWorkList" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | <el-cascader v-model="form.workDetail.involvedDepIds" :options="departList" :props="casProps" :show-all-levels="false" @change="handleChange" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any> |
| | | casProps: {} |
| | | } |
| | | export default defineComponent({ |
| | | name: 'brokenForm', |
| | | components: {}, |
| | | props:['workerList','departList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | csDepList: [ |
| | | { |
| | | label: "单位一", |
| | |
| | | value: 6 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: '部门一', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '部门二', |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: '部门三', |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: '部门四', |
| | | value: 4 |
| | | } |
| | | ] |
| | | casProps: { |
| | | emitPath: false, |
| | | value: 'depId', |
| | | label: 'depName', |
| | | multiple: true |
| | | } |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | |
| | | "workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bcReason": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bcExplain": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.otherSpecialWork": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.involvedDepIds": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | "workDetail.otherSpecialWork": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |