|
@@ -66,7 +66,7 @@
|
|
<el-form ref="formMonthRef" label-position="top" size="large" :model="formMonthModel" :rules="formMonthRules">
|
|
<el-form ref="formMonthRef" label-position="top" size="large" :model="formMonthModel" :rules="formMonthRules">
|
|
<el-form-item label="选择部门" prop="section">
|
|
<el-form-item label="选择部门" prop="section">
|
|
<el-select v-model="formMonthModel.section" block placeholder="选择部门">
|
|
<el-select v-model="formMonthModel.section" block placeholder="选择部门">
|
|
- <el-option v-for="item in department" :label="item.name" :value="item.key"/>
|
|
|
|
|
|
+ <el-option v-for="item in department" :label="item.dictName" :value="item.dictValue"/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="选择月份" prop="month">
|
|
<el-form-item label="选择月份" prop="month">
|
|
@@ -81,8 +81,9 @@
|
|
<script setup>
|
|
<script setup>
|
|
import {ref,onMounted,onActivated} from "vue";
|
|
import {ref,onMounted,onActivated} from "vue";
|
|
import {useRouter} from 'vue-router'
|
|
import {useRouter} from 'vue-router'
|
|
-import {getArrValue} from "js-fast-way"
|
|
|
|
import sectionApi from '~api/program/section.js';
|
|
import sectionApi from '~api/program/section.js';
|
|
|
|
+import {useAppStore} from "~src/store";
|
|
|
|
+import {getArrValue,getObjValue,formValidate} from "js-fast-way"
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
onActivated(()=>{
|
|
onActivated(()=>{
|
|
@@ -178,7 +179,7 @@ const monthModal = ref(false)
|
|
//选择月份的表单数据
|
|
//选择月份的表单数据
|
|
const formMonthRef = ref(null)
|
|
const formMonthRef = ref(null)
|
|
const formMonthModel = ref({
|
|
const formMonthModel = ref({
|
|
- section: '', month: null
|
|
|
|
|
|
+ section: null, month: null
|
|
})
|
|
})
|
|
const formMonthRules = {
|
|
const formMonthRules = {
|
|
section: [{required: true, message: '请选择部门', trigger: 'blur'}],
|
|
section: [{required: true, message: '请选择部门', trigger: 'blur'}],
|
|
@@ -188,21 +189,42 @@ const formMonthRules = {
|
|
const monthCloseClick = () => {
|
|
const monthCloseClick = () => {
|
|
monthModal.value = false
|
|
monthModal.value = false
|
|
}
|
|
}
|
|
|
|
+//新增部门月计划
|
|
|
|
+const addPlan=async(obj)=>{;
|
|
|
|
+ const {error, code, data,msg} = await sectionApi.addDepartmentPlan( {
|
|
|
|
+ planDate:obj.month,
|
|
|
|
+ departmentType:obj.section
|
|
|
|
+ })
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.$message.success(msg)
|
|
|
|
+ monthModal.value = false
|
|
|
|
+ router.push({
|
|
|
|
+ name: 'program-section-form',
|
|
|
|
+ query: {...formMonthModel.value,type:'add'},
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
//确认下一步
|
|
//确认下一步
|
|
-const monthSaveClick = () => {
|
|
|
|
|
|
+const monthSaveClick =async() => {
|
|
|
|
+ const res = await formValidate(formMonthRef.value)
|
|
|
|
+ if(res){
|
|
|
|
+ addPlan(formMonthModel.value)
|
|
|
|
+ }
|
|
monthModal.value = false
|
|
monthModal.value = false
|
|
- router.push({
|
|
|
|
- name: 'program-section-form',
|
|
|
|
- query: formMonthModel.value
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//编辑预算
|
|
//编辑预算
|
|
const editRowClick = (row) => {
|
|
const editRowClick = (row) => {
|
|
router.push({
|
|
router.push({
|
|
- name: 'program-index-info',
|
|
|
|
|
|
+ name: 'program-section-form',
|
|
query: {
|
|
query: {
|
|
- id: row.id
|
|
|
|
|
|
+ id: row.id,
|
|
|
|
+ month:row.planDate,
|
|
|
|
+ section:row.departmentType,
|
|
|
|
+ type:'edit'
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|