Ver Fonte

Merge remote-tracking branch 'origin/master'

ZaiZai há 2 anos atrás
pai
commit
b8ffe64eae

+ 12 - 3
src/views/project/contract/components/base.vue

@@ -96,7 +96,7 @@
                 <span v-if="isDisabled">返回上一级</span>
                 <span v-else>取消并返回</span>
             </el-button>
-            <el-button size="large" type="primary" hc-btn @click="saveClick" v-if="!isDisabled">
+            <el-button size="large" type="primary" hc-btn @click="saveClick" v-if="!isDisabled" :loading="saveLoaingVal">
                 <HcIcon name="check-double"/>
                 <span>提交保存</span>
             </el-button>
@@ -123,10 +123,15 @@ const props = defineProps({
         type: Boolean,
         default: false
     },
+    saveLoaing:{
+        type: Boolean,
+        default: false
+    }
 })
 
 const infoData = ref(props.datas)
 const isDisabled = ref(props.disabled)
+const saveLoaingVal=ref(props.saveLoaing)
 
 //深度监听
 watch(() => [
@@ -141,8 +146,10 @@ watch(() => [
 //监听
 watch(() => [
     props.disabled,
-], ([disabled]) => {
+    props.saveLoaing,
+], ([disabled,saveLoaing]) => {
     isDisabled.value = disabled
+    saveLoaingVal.value=saveLoaing
 })
 onActivated(()=>{
     dataType.value = useRoutes?.query?.type ?? ''
@@ -182,10 +189,12 @@ const formInvoiceRules = {}
 const goBackClick = () => {
     router.back()
 }
-
+const emit= defineEmits(['saveClick'])
 //提交保存
 const saveClick = () => {
     console.log(formBaseModel.value,'formBaseModel');
+    emit('saveClick',formBaseModel.value,'base')
+ 
 
 }
 //获取合同类型

+ 13 - 3
src/views/project/contract/components/file.vue

@@ -25,7 +25,7 @@
                 <span v-if="isDisabled">返回上一级</span>
                 <span v-else>取消并返回</span>
             </el-button>
-            <el-button size="large" type="primary" hc-btn @click="saveClick" v-if="!isDisabled">
+            <el-button size="large" type="primary" hc-btn @click="saveClick" v-if="!isDisabled" :loading="saveLoaingVal">
                 <HcIcon name="check-double"/>
                 <span>提交保存</span>
             </el-button>
@@ -51,10 +51,15 @@ const props = defineProps({
         type: Boolean,
         default: false
     },
+    saveLoaing:{
+        type: Boolean,
+        default: false
+    }
 })
 
 const infoData = ref(props.datas)
 const isDisabled = ref(props.disabled)
+const saveLoaingVal=ref(props.saveLoaing)
 
 //深度监听
 watch(() => [
@@ -66,8 +71,10 @@ watch(() => [
 //监听
 watch(() => [
     props.disabled,
-], ([disabled]) => {
+    props.saveLoaing,
+], ([disabled,saveLoaing]) => {
     isDisabled.value = disabled
+    saveLoaingVal.value=saveLoaing
 })
 
 //上传配置
@@ -92,9 +99,12 @@ const reuploadClick = () => {
 const goBackClick = () => {
     router.back()
 }
-
+const emit= defineEmits(['saveClick'])
 //提交保存
 const saveClick = () => {
+    console.log(infoData.value,'infoData');
+    emit('saveClick',infoData.value,'file')
+    
 
 }
 </script>

+ 49 - 27
src/views/project/contract/components/milestone.vue

@@ -1,24 +1,31 @@
 <template>
     <HcCard actionUi="text-center">
-        <HcTable :column="tableColumn" :datas="tableData">
-            <template #key1="{row,index}">
-                <span v-if="isDisabled">{{row.key1}}</span>
-                <el-input v-model="row.key1" v-else/>
+        <HcTable :column="tableColumn" :datas="infoData">
+            <template #returnedCondition="{row,index}">
+                <span v-if="isDisabled">{{row.returnedCondition}}</span>
+                <el-input v-model="row.returnedCondition" v-else/>
             </template>
-            <template #key2="{row,index}">
-                <span v-if="isDisabled">{{row.key2}}</span>
-                <el-date-picker class="block" v-model="row.key2" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" v-else/>
+            <template #shouldReturnedTime="{row,index}">
+                <span v-if="isDisabled">{{row.shouldReturnedTime}}</span>
+                <el-date-picker class="block" v-model="row.shouldReturnedTime" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" v-else/>
             </template>
-            <template #key3="{row,index}">
-                <span v-if="isDisabled">{{row.key3}}</span>
-                <el-input v-model="row.key3" v-else/>
+            <template #shouldReturnedMoney="{row,index}">
+                <span v-if="isDisabled">{{row.shouldReturnedMoney}}</span>
+                <el-input v-model="row.shouldReturnedMoney" v-else/>
             </template>
-            <template #key6="{row,index}">
-                <span v-if="isDisabled">{{row.key6}}</span>
-                <el-select v-model="row.key6" v-else>
-                    <el-option label="选项1" value="选项1"/>
-                    <el-option label="选项2" value="选项2"/>
-                </el-select>
+            <template #practicalReturnedTime="{row,index}">
+                <span v-if="isDisabled">{{row.practicalReturnedTime}}</span>
+                <el-date-picker class="block" v-model="row.practicalReturnedTime" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" v-else/>
+            </template>
+            <template #practicalReturnedMoney="{row,index}">
+                <span v-if="isDisabled">{{row.practicalReturnedMoney}}</span>
+                <el-input v-model="row.practicalReturnedMoney" v-else/>
+            </template>
+            <template #reminderUserName="{row,index}">
+                <span v-if="isDisabled">{{row.reminderUserName}}</span>
+                <el-select v-model="row.reminderUserName" block  placeholder="请选择" v-else>
+                                        <el-option v-for="item in reminderUserList" :label="item.dictName" :value="item.dictValue"/>
+                 </el-select>
             </template>
             <template #action="{row,index}">
                 <el-button size="small" type="primary" :disabled="isDisabled">
@@ -37,7 +44,7 @@
                 <span v-if="isDisabled">返回上一级</span>
                 <span v-else>取消并返回</span>
             </el-button>
-            <el-button size="large" type="primary" hc-btn @click="saveClick" v-if="!isDisabled">
+            <el-button size="large" type="primary" hc-btn @click="saveClick" v-if="!isDisabled" :loading="saveLoaingVal">
                 <HcIcon name="check-double"/>
                 <span>提交保存</span>
             </el-button>
@@ -54,41 +61,49 @@ const router = useRouter()
 //参数
 const props = defineProps({
     datas: {
-        type: Object,
-        default: () => ({})
+        type: Array,
+        default: () => ([{}])
     },
     disabled: {
         type: Boolean,
         default: false
     },
+    saveLoaing:{
+        type: Boolean,
+        default: false
+    }
 })
 
 const infoData = ref(props.datas)
 const isDisabled = ref(props.disabled)
+const saveLoaingVal=ref(props.saveLoaing)
 
 //深度监听
 watch(() => [
     props.datas,
 ], ([datas]) => {
     infoData.value = datas
+
 }, {deep: true})
 
 //监听
 watch(() => [
     props.disabled,
-], ([disabled]) => {
+    props.saveLoaing,
+], ([disabled,saveLoaing]) => {
     isDisabled.value = disabled
+    saveLoaingVal.value=saveLoaing
 })
 
 //成本测算表格
 const tableColumn = [
-    {key: 'key1', name: '回款条件',  align: 'center'},
-    {key: 'key2', name: '应收款时间',  align: 'center'},
-    {key: 'key3', name: '应收回款金额', align: 'center'},
-    {key: 'key4', name: '实际回款时间',  align: 'center'},
-    {key: 'key5', name: '实际回款金额', align: 'center'},
-    {key: 'key6', name: '催款执行人', align: 'center'},
-    {key: 'action', name: '操作', width: '160', align: 'center'},
+    {key: 'returnedCondition', name: '回款条件',  align: 'center'},
+    {key: 'shouldReturnedTime', name: '应收款时间',  align: 'center'},
+    {key: 'shouldReturnedMoney', name: '应收回款金额', align: 'center'},
+    {key: 'practicalReturnedTime', name: '实际回款时间',  align: 'center'},
+    {key: 'practicalReturnedMoney', name: '实际回款金额', align: 'center'},
+    {key: 'reminderUserName', name: '催款执行人', align: 'center'},
+    {key: 'action', name: '操作', width: '180', align: 'center'},
 ]
 const tableData = ref([
     {id: 1}, {id: 2}, {id: 3}, {id: 4},
@@ -99,9 +114,16 @@ const tableData = ref([
 const goBackClick = () => {
     router.back()
 }
+//催款执行人reminderUserList
+const reminderUserList=ref([])
+
 
+const emit= defineEmits(['saveClick'])
 //提交保存
 const saveClick = () => {
+    console.log(infoData.value,'infoData');
+    emit('saveClick',infoData.value,'milestone')
+ 
 
 }
 </script>

+ 23 - 9
src/views/project/contract/form.vue

@@ -1,17 +1,18 @@
 <template>
     <HcTabsSimple :cur="tabsKey" :datas="tabsData" @tabClick="tabsClick">
         <template #tab-base>
-            <baseTabCard :datas="infoData" :disabled="dataType === 'view'" v-if="tabsKey === 'base'"/>
+            <baseTabCard :datas="infoData" :disabled="dataType === 'view'" v-if="tabsKey === 'base'" @saveClick="saveClick" :saveLoaing="saveLoaing"/>
         </template>
         <template #tab-file>
-            <fileTabCard :datas="infoDataFile" :disabled="dataType === 'view'" v-if="tabsKey === 'file'"/>
+            <fileTabCard :datas="infoDataFile" :disabled="dataType === 'view'" v-if="tabsKey === 'file'" @saveClick="saveClick"  :saveLoaing="saveLoaing"/>
         </template>
         <template #tab-milestone>
-            <milestoneTab :datas="milestoneData" :disabled="dataType === 'view'" v-if="tabsKey === 'milestone'"/>
+            <milestoneTab :datas="milestoneData" :disabled="dataType === 'view'" v-if="tabsKey === 'milestone'" @saveClick="saveClick"  :saveLoaing="saveLoaing"/>
         </template>
         <template #tab-record>
             <recordTabCard :datas="infoData" v-if="tabsKey === 'record'"/>
         </template>
+        
     </HcTabsSimple>
 </template>
 
@@ -22,7 +23,7 @@ import baseTabCard from "./components/base.vue";
 import fileTabCard from "./components/file.vue";
 import milestoneTab from "./components/milestone.vue";
 import recordTabCard from "./components/record.vue";
-import {arrIndex,getObjValue} from "js-fast-way";
+import {arrIndex,getObjValue,getArrValue} from "js-fast-way";
 import contractApi from '~api/project/project-contract.js';
 
 //初始变量
@@ -38,8 +39,10 @@ onActivated(() => {
     setTabsData()
     if(dataType.value!=='add'){
         getContractInfoById()
-    }else{
+    }else if(dataType.value=='add'){
         infoData.value={}
+        infoDataFile.value={}
+        milestoneData.value=[]
     }
 })
 const infoDataFile=ref({pdfUrl:''})
@@ -83,24 +86,35 @@ const tabsData = ref([
 ])
 const tabsClick = (key) => {
     tabsKey.value = key
-    if(key=='milestone'){
+    if(key=='milestone'&&dataType.value!=='add'){
         getListByContractId()
+      
+    }else if(key=='base'&&dataType.value!=='add'){
+        getContractInfoById()
     }
 }
 
 const infoData = ref({})
 const isNoDropShadow = ref(false)
 //合同里程碑
-const milestoneData=ref([])
+const milestoneData=ref([{}])
 const getListByContractId=async()=>{
-    const {error, code, data} = await contractApi.getListByContractId({id: dataId.value})
+    const {error, code, data} = await contractApi.getListByContractId({contractId: dataId.value})
     if (!error && code === 200) {
-        milestoneData.value=getObjValue(data)
+        milestoneData.value=getArrValue(data)
        
 
     } else {
         milestoneData.value=[]
     }
 }
+const saveLoaing=ref(false)
+//保存
+const saveClick=(info,type)=>{
+    console.log(info,'info');
+    console.log(type,'type');
+    console.log(infoData.value,'原始信息infoData.value');
+ 
+}
 
 </script>

+ 1 - 1
src/views/project/contract/index.vue

@@ -111,7 +111,7 @@ const tableColumn = [
     {key: 'key4', name: '合同起止日期', width: '220', align: 'center'},
     {key: 'returnedMoney', name: '合同已履约回款', width: '140', align: 'center'},
     {key: 'unreturnedMoney', name: '合同未履约回款', width: '140', align: 'center'},
-    {key: 'action', name: '操作', width: '130', align: 'center'},
+    {key: 'action', name: '操作', width: '180', align: 'center'},
 ]
 const tableData = ref([])
 

+ 2 - 2
src/views/project/cost/form.vue

@@ -10,7 +10,7 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item label="成本测算总金额:">
-                            <el-input v-model="formBaseModel.previewTotalCost" disabled/>
+                            <el-input v-model="formBaseModel.projectCostTotal" disabled/>
                         </el-form-item>
                         <el-form-item label="研发部成本总金额:">
                             <el-input v-model="formBaseModel.devCostTotal" disabled/>
@@ -79,7 +79,7 @@
                     </template>
                     <template #postType="{row,index}">
                         <el-select v-model="row.postType">
-                            <el-option v-for="item in postTypeList" :label="item.dictName" :value="item.dictValue"/>
+                            <el-option v-for="item in postTypeList" :label="item.dictName" :value="item.code"/>
                         </el-select>
                     </template>
                     

+ 1 - 1
src/views/project/cost/index.vue

@@ -96,7 +96,7 @@ const pageChange = ({current, size}) => {
 const tableLoading = ref(false)
 const tableColumn = [
     {key: 'projectName', name: '项目名称'},
-    {key: 'previewTotalCost', name: '项目测算总金额', width: '120', align: 'center'},
+    {key: 'projectCostTotal', name: '项目测算总金额', width: '120', align: 'center'},
     {key: 'devCostTotal', name: '研发部成本总金额', width: '120', align: 'center'},
     {key: 'businessCostTotal', name: '实施部成本总金额', width: '120', align: 'center'},
     {key: 'maintainCostTotal', name: '维护部成本总金额', width: '120', align: 'center'},