|
@@ -35,9 +35,7 @@ const form = reactive({
|
|
]
|
|
]
|
|
});
|
|
});
|
|
const rules = reactive({
|
|
const rules = reactive({
|
|
- name: [
|
|
|
|
- { required: true, message: "Please input Activity name", trigger: "blur" }
|
|
|
|
- ]
|
|
|
|
|
|
+ name: [{ required: true, message: "请输入考核名称", trigger: "blur" }]
|
|
});
|
|
});
|
|
const formLeftRules = reactive({
|
|
const formLeftRules = reactive({
|
|
left: [{ required: true, message: "请选择考核指标", trigger: "blur" }],
|
|
left: [{ required: true, message: "请选择考核指标", trigger: "blur" }],
|
|
@@ -63,6 +61,7 @@ const saveDepartment = async () => {
|
|
form.cycleValue = dayjs(form.cycleValue).format(format.value);
|
|
form.cycleValue = dayjs(form.cycleValue).format(format.value);
|
|
//
|
|
//
|
|
console.log("form", dayjs(form.cycleValue).format(format.value));
|
|
console.log("form", dayjs(form.cycleValue).format(format.value));
|
|
|
|
+ console.log(form, "获取的数据");
|
|
const { code, msg } = await postAddAssessment(form);
|
|
const { code, msg } = await postAddAssessment(form);
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
ElMessage({
|
|
ElMessage({
|
|
@@ -231,18 +230,24 @@ const transformData = data => {
|
|
return transformedItem;
|
|
return transformedItem;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
-const handleRreeSelect = (node, index) => {
|
|
|
|
- console.log(node.deptName, index);
|
|
|
|
- form.assessmentObjectList.assessmentObjectName = node.deptName;
|
|
|
|
|
|
+const assessmentTypeRef = ref();
|
|
|
|
+const handleRreeSelect = index => {
|
|
|
|
+ const node = assessmentTypeRef.value[index].getCheckedNodes();
|
|
|
|
+ form.assessmentObjectList[index].assessmentObjectName =
|
|
|
|
+ node[node.length - 1].deptName;
|
|
};
|
|
};
|
|
-const handleSelect = (node, index) => {
|
|
|
|
- console.log(node, index);
|
|
|
|
- resTmp.value.map(item => {
|
|
|
|
- console.log(item);
|
|
|
|
- if (item.id == node) {
|
|
|
|
- form.assessmentObjectList.assessmentModelName = item.tpName;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+const handleSelect = index => {
|
|
|
|
+ // console.log(index,'form.assessmentObjectList',form.assessmentObjectList[index].am);
|
|
|
|
+ form.assessmentObjectList[index].assessmentModelName =
|
|
|
|
+ form.assessmentObjectList[index].am.tpName;
|
|
|
|
+ form.assessmentObjectList[index].assessmentModelId =
|
|
|
|
+ form.assessmentObjectList[index].am.id;
|
|
|
|
+ // resTmp.value.map(item => {
|
|
|
|
+ // console.log(item);
|
|
|
|
+ // if (item.id == node) {
|
|
|
|
+ // form.assessmentObjectList.assessmentModelName = item.tpName;
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
};
|
|
};
|
|
const aaaa = a => {
|
|
const aaaa = a => {
|
|
console.log(a);
|
|
console.log(a);
|
|
@@ -412,6 +417,7 @@ defineExpose({
|
|
>
|
|
>
|
|
<el-tree-select
|
|
<el-tree-select
|
|
v-if="form.assessmentType === 1"
|
|
v-if="form.assessmentType === 1"
|
|
|
|
+ ref="assessmentTypeRef"
|
|
v-model="item.assessmentObjectId"
|
|
v-model="item.assessmentObjectId"
|
|
:data="treeDept"
|
|
:data="treeDept"
|
|
:render-after-expand="false"
|
|
:render-after-expand="false"
|
|
@@ -422,11 +428,12 @@ defineExpose({
|
|
children: 'children'
|
|
children: 'children'
|
|
}"
|
|
}"
|
|
style="width: 180px"
|
|
style="width: 180px"
|
|
- @check-change="handleRreeSelect"
|
|
|
|
|
|
+ @check-change="handleRreeSelect(index)"
|
|
/>
|
|
/>
|
|
<el-select
|
|
<el-select
|
|
v-if="form.assessmentType != 1"
|
|
v-if="form.assessmentType != 1"
|
|
v-model="item.assessmentObjectId"
|
|
v-model="item.assessmentObjectId"
|
|
|
|
+ @change="handChange"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="(it, id) in treeDept"
|
|
v-for="(it, id) in treeDept"
|
|
@@ -452,17 +459,18 @@ defineExpose({
|
|
class="w-full flex mt-1"
|
|
class="w-full flex mt-1"
|
|
>
|
|
>
|
|
<el-select
|
|
<el-select
|
|
- v-model="item.assessmentModelId"
|
|
|
|
|
|
+ v-model="item.am"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
filterable
|
|
filterable
|
|
style="width: 180px"
|
|
style="width: 180px"
|
|
- @change="handleSelect"
|
|
|
|
|
|
+ value-key="id"
|
|
|
|
+ @change="handleSelect(index)"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="itemTmp in resTmp"
|
|
v-for="itemTmp in resTmp"
|
|
:key="itemTmp.id"
|
|
:key="itemTmp.id"
|
|
:label="itemTmp.tpName"
|
|
:label="itemTmp.tpName"
|
|
- :value="itemTmp.id"
|
|
|
|
|
|
+ :value="itemTmp"
|
|
style="width: 180px"
|
|
style="width: 180px"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|