|
@@ -4,9 +4,9 @@
|
|
<HcCard scrollbar actionUi="text-center">
|
|
<HcCard scrollbar actionUi="text-center">
|
|
<div class="hc-card-form-center">
|
|
<div class="hc-card-form-center">
|
|
<el-form ref="formBaseRef" :model="formBaseModel" :rules="formBaseRules" label-width="auto" size="large">
|
|
<el-form ref="formBaseRef" :model="formBaseModel" :rules="formBaseRules" label-width="auto" size="large">
|
|
- <el-form-item label="项目名称:" prop="keprojectNamey">
|
|
|
|
- <el-select v-model="formBaseModel.projectName" block placeholder="项目名称">
|
|
|
|
- <el-option v-for="item in projectName" :label="item.name" :value="item.key"/>
|
|
|
|
|
|
+ <el-form-item label="项目名称:" prop="projectId">
|
|
|
|
+ <el-select v-model="formBaseModel.projectId" block placeholder="项目名称">
|
|
|
|
+ <el-option v-for="item in projectList" :label="item.name" :value="item.id"/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="成本测算总金额:">
|
|
<el-form-item label="成本测算总金额:">
|
|
@@ -37,7 +37,7 @@
|
|
<HcIcon name="arrow-go-back"/>
|
|
<HcIcon name="arrow-go-back"/>
|
|
<span>取消并返回</span>
|
|
<span>取消并返回</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button size="large" type="primary" hc-btn>
|
|
|
|
|
|
+ <el-button size="large" type="primary" hc-btn @click="submitForm" :loading="submitLoaing">
|
|
<HcIcon name="check-double"/>
|
|
<HcIcon name="check-double"/>
|
|
<span>提交保存</span>
|
|
<span>提交保存</span>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -45,77 +45,80 @@
|
|
</HcCard>
|
|
</HcCard>
|
|
</template>
|
|
</template>
|
|
<template #tab-table>
|
|
<template #tab-table>
|
|
- <HcCard actionUi="text-center" :title="formBaseModel.key">
|
|
|
|
|
|
+ <HcCard actionUi="text-center" :title="formBaseModel.projectName">
|
|
<template #extra>
|
|
<template #extra>
|
|
<HcNewSwitch :datas="tabTab" :keys="tabKey" @change="tabChange" :round="false"/>
|
|
<HcNewSwitch :datas="tabTab" :keys="tabKey" @change="tabChange" :round="false"/>
|
|
|
|
+
|
|
|
|
+
|
|
</template>
|
|
</template>
|
|
|
|
+
|
|
<HcTable :isIndex="false" :column="tableColumn" :datas="tableData">
|
|
<HcTable :isIndex="false" :column="tableColumn" :datas="tableData">
|
|
- <template #key1="{row,index}">
|
|
|
|
- <el-select v-model="row.key1">
|
|
|
|
- <el-option label="选项1" value="选项1"/>
|
|
|
|
- <el-option label="选项2" value="选项2"/>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+
|
|
|
|
+ <template #costType="{row,index}">
|
|
|
|
+ <el-select v-model="row.costType" block placeholder="请选择">
|
|
|
|
+ <el-option v-for="item in costTypeList" :label="item.dictName" :value="item.dictValue"/>
|
|
|
|
+ </el-select>
|
|
</template>
|
|
</template>
|
|
- <template #key2="{row,index}">
|
|
|
|
- <el-select v-model="row.key2">
|
|
|
|
- <el-option label="选项1" value="选项1"/>
|
|
|
|
- <el-option label="选项2" value="选项2"/>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <template #projectProcess="{row,index}">
|
|
|
|
+ <el-select v-model="row.projectProcess" block placeholder="请选择">
|
|
|
|
+ <el-option v-for="item in processList" :label="item.name" :value="item.id"/>
|
|
|
|
+ </el-select>
|
|
</template>
|
|
</template>
|
|
- <template #key3="{row,index}">
|
|
|
|
- <el-select v-model="row.key3">
|
|
|
|
- <el-option label="选项1" value="选项1"/>
|
|
|
|
- <el-option label="选项2" value="选项2"/>
|
|
|
|
|
|
+ <template #budgetType="{row,index}">
|
|
|
|
+ <el-select v-model="row.budgetType" @change="budgetTypeChange">
|
|
|
|
+ <el-option v-for="item in budgetTypeList" :label="item.dictName" :value="item.dictValue"/>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- <template #key4="{row,index}">
|
|
|
|
- <el-select v-model="row.key4">
|
|
|
|
- <el-option label="选项1" value="选项1"/>
|
|
|
|
- <el-option label="选项2" value="选项2"/>
|
|
|
|
|
|
+ <template #taskDetail="{row,index}">
|
|
|
|
+ <el-select v-model="row.taskDetail">
|
|
|
|
+ <el-option v-for="item in taskDetailList" :label="item.dictName" :value="item.dictValue"/>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- <template #key5="{row,index}">
|
|
|
|
- <el-input v-model="row.key5"/>
|
|
|
|
|
|
+ <template #budgetDays="{row,index}">
|
|
|
|
+ <el-input v-model="row.budgetDays"/>
|
|
</template>
|
|
</template>
|
|
- <template #key6="{row,index}">
|
|
|
|
- <el-select v-model="row.key6">
|
|
|
|
- <el-option label="选项1" value="选项1"/>
|
|
|
|
- <el-option label="选项2" value="选项2"/>
|
|
|
|
|
|
+ <template #postType="{row,index}">
|
|
|
|
+ <el-select v-model="row.postType">
|
|
|
|
+ <el-option v-for="item in postTypeList" :label="item.dictName" :value="item.dictValue"/>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- <template #key7="{row,index}">
|
|
|
|
- <el-input v-model="row.key7"/>
|
|
|
|
|
|
+
|
|
|
|
+ <template #staffCount="{row,index}">
|
|
|
|
+ <el-input v-model="row.staffCount"/>
|
|
</template>
|
|
</template>
|
|
- <template #key8="{row,index}">
|
|
|
|
- <el-input v-model="row.key8" disabled/>
|
|
|
|
|
|
+ <template #budgetStaffCost="{row,index}">
|
|
|
|
+ <el-input v-model="row.budgetStaffCost" disabled/>
|
|
</template>
|
|
</template>
|
|
- <template #key9="{row,index}">
|
|
|
|
- <el-input v-model="row.key9"/>
|
|
|
|
|
|
+ <template #budgetTravelExpense="{row,index}">
|
|
|
|
+ <el-input v-model="row.budgetTravelExpense" />
|
|
</template>
|
|
</template>
|
|
- <template #key10="{row,index}">
|
|
|
|
- <el-input v-model="row.key10"/>
|
|
|
|
|
|
+ <template #outsourceUnitPrice="{row,index}">
|
|
|
|
+ <el-input v-model="row.outsourceUnitPrice"/>
|
|
</template>
|
|
</template>
|
|
- <template #key11="{row,index}">
|
|
|
|
- <el-input v-model="row.key11" disabled/>
|
|
|
|
|
|
+ <template #outsourcePeopleCount="{row,index}">
|
|
|
|
+ <el-input v-model="row.outsourcePeopleCount"/>
|
|
</template>
|
|
</template>
|
|
- <template #key12="{row,index}">
|
|
|
|
- <el-input v-model="row.key12"/>
|
|
|
|
|
|
+ <template #outsourceCountMoney="{row,index}">
|
|
|
|
+ <el-input v-model="row.outsourceCountMoney" disabled />
|
|
</template>
|
|
</template>
|
|
- <template #key13="{row,index}">
|
|
|
|
- <el-input v-model="row.key13"/>
|
|
|
|
|
|
+ <template #otherBudgetMoney="{row,index}">
|
|
|
|
+ <el-input v-model="row.otherBudgetMoney" />
|
|
</template>
|
|
</template>
|
|
- <template #key14="{row,index}">
|
|
|
|
- <el-input v-model="row.key14" disabled/>
|
|
|
|
|
|
+ <template #budgetCountMoney="{row,index}">
|
|
|
|
+ <el-input v-model="row.budgetCountMoney"/>
|
|
|
|
+ </template>
|
|
|
|
+ <template #budgetRemark="{row,index}">
|
|
|
|
+ <el-input v-model="row.budgetRemark" />
|
|
</template>
|
|
</template>
|
|
<template #key15="{row,index}">
|
|
<template #key15="{row,index}">
|
|
<el-input v-model="row.key15"/>
|
|
<el-input v-model="row.key15"/>
|
|
- </template>
|
|
|
|
|
|
+ </template>
|
|
<template #action="{row,index}">
|
|
<template #action="{row,index}">
|
|
- <el-button size="small" type="primary">
|
|
|
|
|
|
+ <el-button size="small" type="primary" @click="addRow">
|
|
<HcIcon name="add"/>
|
|
<HcIcon name="add"/>
|
|
<span>新增</span>
|
|
<span>新增</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button size="small" type="danger">
|
|
|
|
|
|
+ <el-button size="small" type="danger" @click="delRow(index)">
|
|
<HcIcon name="delete-bin"/>
|
|
<HcIcon name="delete-bin"/>
|
|
<span>删除</span>
|
|
<span>删除</span>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -126,7 +129,7 @@
|
|
<HcIcon name="arrow-go-back"/>
|
|
<HcIcon name="arrow-go-back"/>
|
|
<span>取消并返回</span>
|
|
<span>取消并返回</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button size="large" type="primary" hc-btn>
|
|
|
|
|
|
+ <el-button size="large" type="primary" hc-btn @click="submitForm" :loading="submitLoaing">
|
|
<HcIcon name="check-double"/>
|
|
<HcIcon name="check-double"/>
|
|
<span>提交保存</span>
|
|
<span>提交保存</span>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -149,46 +152,150 @@ const dataId = ref(useRoutes?.query?.id ?? '')
|
|
//缓存页面被激活时
|
|
//缓存页面被激活时
|
|
onActivated(() => {
|
|
onActivated(() => {
|
|
dataId.value = useRoutes?.query?.id ?? ''
|
|
dataId.value = useRoutes?.query?.id ?? ''
|
|
- console.log(useRoutes.query)
|
|
|
|
|
|
+ //清除数据
|
|
|
|
+ tableData.value=[{}]
|
|
|
|
+ constructUnitData.value=[]
|
|
|
|
+ supervisorUnitData.value=[]
|
|
|
|
+ bulidUnitData.value=[]
|
|
|
|
+ tabsKey.value = 'base'
|
|
|
|
+ tabKey.value='construction'
|
|
if(dataId.value.length>0){
|
|
if(dataId.value.length>0){
|
|
getBudgetStatsById()
|
|
getBudgetStatsById()
|
|
|
|
+ getProjectList(2)
|
|
}else{
|
|
}else{
|
|
|
|
+ getProjectList(1)
|
|
formBaseModel.value={}
|
|
formBaseModel.value={}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ getCostTypeDict()
|
|
|
|
+ getBudgetTypeList()
|
|
|
|
+ getPostDict()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
|
+const projectList=ref([])
|
|
|
|
+//获取项目下拉框
|
|
|
|
+const getProjectList=async(type)=>{
|
|
|
|
+ const {error, code, data} = await costApi.getProjectList({type})
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ projectList.value=getArrValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ projectList.value={}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+//获取费用分类
|
|
|
|
+const costTypeList=ref([])
|
|
|
|
+const getCostTypeDict=async(type)=>{
|
|
|
|
+ const {error, code, data} = await costApi.getCostTypeDict()
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ costTypeList.value=getArrValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ costTypeList.value={}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+//获取项目环节
|
|
|
|
+const processList=ref([])
|
|
|
|
+const getProcessList=async(projectId)=>{
|
|
|
|
+ const {error, code, data} = await costApi.getProcessList({projectId:projectId})
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ processList.value=getArrValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ processList.value={}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//获取预算分类getSecondSubject
|
|
|
|
+const budgetTypeList=ref([])
|
|
|
|
+const getBudgetTypeList=async()=>{
|
|
|
|
+ const {error, code, data} = await costApi.getSecondSubject()
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ budgetTypeList.value=getArrValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ budgetTypeList.value={}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+//任务明细
|
|
|
|
+const taskDetailList=ref([])
|
|
|
|
+const budgetTypeChange=async(val)=>{
|
|
|
|
+ console.log(val,'val');
|
|
|
|
+ let id=''
|
|
|
|
+ budgetTypeList.value.forEach((ele)=>{
|
|
|
|
+ if(ele.dictValue===val){
|
|
|
|
+ id=ele.id
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ const {error, code, data} = await costApi.getChlidList({parentId:id,type:1})
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ taskDetailList.value=getArrValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ taskDetailList.value={}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+//获取岗位分类postTypeList
|
|
|
|
+const postTypeList=ref([])
|
|
|
|
+const getPostDict=async(type)=>{
|
|
|
|
+ const {error, code, data} = await costApi.getPostDict()
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ postTypeList.value=getArrValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ postTypeList.value={}
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+//测算表格数据
|
|
|
|
+const constructUnitData=ref([])
|
|
|
|
+const bulidUnitData=ref([])
|
|
|
|
+const supervisorUnitData=ref([])
|
|
//获取详情
|
|
//获取详情
|
|
const getBudgetStatsById=async()=>{
|
|
const getBudgetStatsById=async()=>{
|
|
const {error, code, data} = await costApi.getBudgetStatsById({id: dataId.value})
|
|
const {error, code, data} = await costApi.getBudgetStatsById({id: dataId.value})
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
formBaseModel.value=getObjValue(data)
|
|
formBaseModel.value=getObjValue(data)
|
|
|
|
+ tableData.value= formBaseModel.value.constructUnit.length>0?formBaseModel.value.constructUnit:originTableData.value
|
|
|
|
+ constructUnitData.value=formBaseModel.value.constructUnit
|
|
|
|
+ bulidUnitData.value=formBaseModel.value.buildUnit
|
|
|
|
+ supervisorUnitData.value=formBaseModel.value.supervisorUnit
|
|
|
|
|
|
} else {
|
|
} else {
|
|
formBaseModel.value={}
|
|
formBaseModel.value={}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//选项卡
|
|
//选项卡
|
|
-const tabsKey = ref('table')
|
|
|
|
|
|
+const tabsKey = ref('base')
|
|
const tabsData = ref([
|
|
const tabsData = ref([
|
|
{icon: 'file-list-3', label: '基础信息', key: 'base'},
|
|
{icon: 'file-list-3', label: '基础信息', key: 'base'},
|
|
{icon: 'file-list-2', label: '成本测算', key: 'table'},
|
|
{icon: 'file-list-2', label: '成本测算', key: 'table'},
|
|
])
|
|
])
|
|
const tabsClick = (key) => {
|
|
const tabsClick = (key) => {
|
|
- tabsKey.value = key
|
|
|
|
|
|
+
|
|
|
|
+ if(!formBaseModel.value.projectId){
|
|
|
|
+ window.$message.warning('请先在基础信息栏选择项目')
|
|
|
|
+ }else{
|
|
|
|
+ if(key==='table'){
|
|
|
|
+ tabsKey.value = key
|
|
|
|
+ getProcessList(formBaseModel.value.projectId)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
-//项目名称
|
|
|
|
-const projectName = ref([
|
|
|
|
- {name: '陈油路', key: '陈油路'},
|
|
|
|
- {name: '奉建路', key: '奉建路'}
|
|
|
|
-])
|
|
|
|
|
|
+
|
|
|
|
|
|
//任务操作数据
|
|
//任务操作数据
|
|
const formBaseRef = ref(null)
|
|
const formBaseRef = ref(null)
|
|
const formBaseModel = ref({})
|
|
const formBaseModel = ref({})
|
|
const formBaseRules = {
|
|
const formBaseRules = {
|
|
- key: {
|
|
|
|
|
|
+ projectId: {
|
|
required: true,
|
|
required: true,
|
|
trigger: 'blur',
|
|
trigger: 'blur',
|
|
message: "请选择项目名称"
|
|
message: "请选择项目名称"
|
|
@@ -197,44 +304,84 @@ const formBaseRules = {
|
|
|
|
|
|
//类型tab数据和相关处理
|
|
//类型tab数据和相关处理
|
|
const tabKey = ref('construction')
|
|
const tabKey = ref('construction')
|
|
|
|
+
|
|
const tabTab = ref([
|
|
const tabTab = ref([
|
|
- {key: 'construction', name: '施工单位成本'},
|
|
|
|
|
|
+ {key: 'bulid', name: '施工单位成本'},
|
|
{key: 'supervision', name: '监理单位成本'},
|
|
{key: 'supervision', name: '监理单位成本'},
|
|
- {key: 'build', name: '建设单位成本'}
|
|
|
|
|
|
+ {key: 'construction', name: '建设单位成本'}
|
|
]);
|
|
]);
|
|
const tabChange = ({key}) => {
|
|
const tabChange = ({key}) => {
|
|
tabKey.value = key
|
|
tabKey.value = key
|
|
|
|
+ console.log(key,'key');
|
|
|
|
+ console.log(tableData.value,'tableData.value');
|
|
|
|
+ if(key=='supervision'){
|
|
|
|
+ tableData.value=supervisorUnitData.value.length>0?supervisorUnitData.value:originTableData.value
|
|
|
|
+ formBaseModel.value.supervisorUnit=tableData.value
|
|
|
|
+ }else if(key=='construction'){
|
|
|
|
+ tableData.value=constructUnitData.value.length>0?constructUnitData.value:originTableData.value
|
|
|
|
+ formBaseModel.value.constructUnit=tableData.value
|
|
|
|
+ console.log( formBaseModel.value.constructUnit,' formBaseModel.value.constructUnit');
|
|
|
|
+ }else if(key=='bulid'){
|
|
|
|
+ console.log(bulidUnitData.value,'=bulidUnitData.value');
|
|
|
|
+ tableData.value=bulidUnitData.value.length>0?bulidUnitData.value:originTableData.value
|
|
|
|
+ formBaseModel.value.buildUnit=tableData.value
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//成本测算表格
|
|
//成本测算表格
|
|
const tableColumn = [
|
|
const tableColumn = [
|
|
- {key: 'key1', name: '费用分类', width: '160', align: 'center'},
|
|
|
|
- {key: 'key2', name: '项目环节', width: '160', align: 'center'},
|
|
|
|
- {key: 'key3', name: '预算类型', width: '160', align: 'center'},
|
|
|
|
- {key: 'key4', name: '任务明细', width: '160', align: 'center'},
|
|
|
|
- {key: 'key5', name: '预计工作量(小数/整数)', width: '160', align: 'center'},
|
|
|
|
- {key: 'key6', name: '投入岗位类型(日单价)', width: '160', align: 'center'},
|
|
|
|
- {key: 'key7', name: '投入人员数量', width: '160', align: 'center'},
|
|
|
|
- {key: 'key8', name: '预计人工成本(元)', width: '160', align: 'center'},
|
|
|
|
- {key: 'key9', name: '预计差旅费(元)', width: '160', align: 'center'},
|
|
|
|
- {key: 'key10', name: '外包单价', width: '160', align: 'center'},
|
|
|
|
- {key: 'key11', name: '外包数量', width: '160', align: 'center'},
|
|
|
|
- {key: 'key12', name: '外包金额', width: '160', align: 'center'},
|
|
|
|
- {key: 'key13', name: '其他预算金额', width: '160', align: 'center'},
|
|
|
|
- {key: 'key14', name: '总预算金额', width: '160', align: 'center'},
|
|
|
|
- {key: 'key15', name: '测算备注', width: '160', align: 'center'},
|
|
|
|
- {key: 'action', name: '操作', width: '160', align: 'center', fixed: 'right'},
|
|
|
|
|
|
+ {key: 'costType', name: '费用分类', width: '160', align: 'center'},
|
|
|
|
+ {key: 'projectProcess', name: '项目环节', width: '160', align: 'center'},
|
|
|
|
+ {key: 'budgetType', name: '预算类型', width: '160', align: 'center'},
|
|
|
|
+ {key: 'taskDetail', name: '任务明细', width: '160', align: 'center'},
|
|
|
|
+ {key: 'budgetDays', name: '预计工作量(小数/整数)', width: '160', align: 'center'},
|
|
|
|
+ {key: 'postType', name: '投入岗位类型(日单价)', width: '160', align: 'center'},
|
|
|
|
+ {key: 'staffCount', name: '投入人员数量', width: '160', align: 'center'},
|
|
|
|
+ {key: 'budgetStaffCost', name: '预计人工成本(元)', width: '160', align: 'center'},
|
|
|
|
+ {key: 'budgetTravelExpense', name: '预计差旅费(元)', width: '160', align: 'center'},
|
|
|
|
+ {key: 'outsourceUnitPrice', name: '外包单价', width: '160', align: 'center'},
|
|
|
|
+ {key: 'outsourcePeopleCount', name: '外包数量', width: '160', align: 'center'},
|
|
|
|
+ {key: 'outsourceCountMoney', name: '外包金额', width: '160', align: 'center'},
|
|
|
|
+ {key: 'otherBudgetMoney', name: '其他预算金额', width: '160', align: 'center'},
|
|
|
|
+ {key: 'budgetCountMoney', name: '总预算金额', width: '160', align: 'center'},
|
|
|
|
+ {key: 'budgetRemark', name: '测算备注', width: '160', align: 'center'},
|
|
|
|
+ {key: 'action', name: '操作', width: '200', align: 'center', fixed: 'right'},
|
|
]
|
|
]
|
|
-const tableData = ref([
|
|
|
|
- {id: 1}, {id: 2}, {id: 3}, {id: 4},
|
|
|
|
-])
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+const tableData = ref([{}])
|
|
|
|
+const originTableData=ref([ {}])
|
|
|
|
+const addRow=()=>{
|
|
|
|
+ tableData.value.push({})
|
|
|
|
+}
|
|
|
|
+const delRow=(index)=>{
|
|
|
|
+ tableData.value.splice(index, 1)
|
|
|
|
+
|
|
|
|
+}
|
|
//取消并返回
|
|
//取消并返回
|
|
const goBackClick = () => {
|
|
const goBackClick = () => {
|
|
router.back()
|
|
router.back()
|
|
}
|
|
}
|
|
|
|
+//保存submitForm
|
|
|
|
+const submitLoaing=ref(false)
|
|
|
|
+const submitForm=async()=>{
|
|
|
|
+ console.log(formBaseModel.value,'formBaseModel.value');
|
|
|
|
+ if(tabKey.value='construction'){
|
|
|
|
+ formBaseModel.value.constructUnit=tableData.value
|
|
|
|
+ }
|
|
|
|
+ const res = await formValidate(formBaseRef.value)
|
|
|
|
+ if(res){
|
|
|
|
+ submitLoaing.value=true
|
|
|
|
+ const {error, code, data,msg} = await costApi.AddOrUpdate( formBaseModel.value)
|
|
|
|
+ submitLoaing.value=false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.$message.success(msg)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|