Selaa lähdekoodia

部门月度计划修改

duy 2 vuotta sitten
vanhempi
commit
d42caee016
1 muutettua tiedostoa jossa 7 lisäystä ja 5 poistoa
  1. 7 5
      src/views/program/section/index.vue

+ 7 - 5
src/views/program/section/index.vue

@@ -65,7 +65,7 @@
         >
             <el-form ref="formMonthRef" label-position="top" size="large" :model="formMonthModel" :rules="formMonthRules">
                 <el-form-item label="选择部门" prop="section">
-                    <el-select v-model="formMonthModel.section" block placeholder="选择部门" >
+                    <el-select v-model="formMonthModel.section" block placeholder="选择部门"  @change="changeDpt">
                         <el-option v-for="item in department" :label="item.deptName" :value="item.deptCategory"/>
                     </el-select>
                 </el-form-item>
@@ -129,7 +129,7 @@ const tableColumn = [
     {key: 'planTotal', name: '计划数量', width: '120', align: 'center'},
     {key: 'finishPlanTotal', name: '已完成计划', width: '120', align: 'center'},
     {key: 'beginPlanTotal', name: '未完成计划', width: '120', align: 'center'},
-    {key: 'planDesigner', name: '计划制定人', width: '120', align: 'center'},
+    {key: 'planDesignerName', name: '计划制定人', width: '120', align: 'center'},
     {key: 'action', name: '操作', width: '160', align: 'center'},
 ]
 const tableData = ref([
@@ -192,18 +192,20 @@ const monthCloseClick = () => {
 //选择部门
 const deptId=ref('')
 const changeDpt=(val)=>{
-  
+    console.log(val,'val');
     department.value.forEach((ele)=>{
-        if(ele.deptCategory=val){
+        if(ele.deptCategory===val){
             deptId.value=ele.id
         }
     })
+    console.log(deptId.value,'deptId.value');
 }
 //新增部门月计划
 const addPlan=async(obj)=>{
     const {error, code, data,msg} = await sectionApi.addDepartmentPlan( {
         planDate:obj.month,
-        departmentType:obj.section
+        departmentType:obj.section,
+        deptId:deptId.value
     })
     if (!error && code === 200) {
        window.$message.success(msg)