songxy 1 rok temu
rodzic
commit
5a684806bf

+ 15 - 12
client/src/views/OaSystem/components/RatioInput/index.vue

@@ -23,24 +23,18 @@ const _props = defineProps({
     default: 0
   }
 })
-watch(
-  () => _props.modelValue,
-  (n, o) => {
-    computedRatioNumC(n)
-  }
-)
 const _emit = defineEmits<{ (e: 'update:modelValue', v: number): void }>()
-const ratioNum1 = ref<any>()
-const ratioNum2 = ref<any>()
+const ratioNum1 = ref<any>(0)
+const ratioNum2 = ref<any>(0)
 const shareRatioIndex = ref<string>('')
 const shareRatioMap = reactive<any>({
   '1': [58, 42],
   '2': [62.5, 37.5],
-  '3': []
+  '3': [0, 0]
 })
 const setRatioNumC = (): void => {
-  shareRatioMap['c'][0] = parseFloat(ratioNum1.value)
-  shareRatioMap['c'][1] = parseFloat(ratioNum2.value)
+  shareRatioMap['3'][0] = parseFloat(ratioNum1.value)
+  shareRatioMap['3'][1] = parseFloat(ratioNum2.value)
 }
 const computedRatioNumC = (v): void => {
   const num2 = v * 100
@@ -61,7 +55,7 @@ const computedRatioNumC = (v): void => {
 }
 const ratioChangeHandle = (): void => {
   const index: string = shareRatioIndex.value
-  if (index == 'c') {
+  if (index == '3') {
     const ratio: number = shareRatioMap[index][1] / 100
     _emit('update:modelValue', ratio)
   }
@@ -82,6 +76,15 @@ const radioChange = (): void => {
   const ratio: number = shareRatioMap[index][1] / 100
   _emit('update:modelValue', ratio)
 }
+watch(
+  () => _props.modelValue,
+  (n, o) => {
+    computedRatioNumC(n)
+  },
+  {
+    immediate: true
+  }
+)
 </script>
 
 <style scoped lang="scss">

+ 1 - 1
client/src/views/OaSystem/projectCenter/projectDetail/components/xmxx/AddSubProject.vue

@@ -46,7 +46,7 @@ setTimeout(() => {
   projectChildForm.value.shareRatio = 0.62
 }, 2000)
 const submitProjectChild = () => {
-  projectChildForm.value['xmbh'] = projectNo
+  projectChildForm.value.xmbh = projectNo
   const sendData = {
     pid: unref(projectId),
     ...projectChildForm.value

+ 1 - 2
client/src/views/OaSystem/projectCenter/projectDetail/components/xmxx/index.vue

@@ -143,7 +143,7 @@
                 <td>
                   <el-input
                     class="form-item-disable-style"
-                    v-model="projectDetail['ygje']"
+                    v-model="projectDetail['estimateAmount']"
                     :disabled="!editor"
                   />
                 </td>
@@ -303,7 +303,6 @@ const { mutate: save } = useMutation(saveProject, {
     ElMessage({ message: '保存项目成功', type: 'success' })
   }
 })
-
 defineExpose({
   saveProjectHandle,
   saveProjectStateHandler,