jinlin
2026-02-27 c7752a2c89e2a05ea1fe2f3183928ff69f60ef32
web/src/views/modules/statement/statement-AddOrUpdate.vue
@@ -23,13 +23,13 @@
        <el-input v-model="dataForm.directCost"></el-input>
      </zt-form-item>
      <zt-form-item label="分摊成本" prop="ftCost" rules="required">
        <el-input v-model="dataForm.ftCost"></el-input>
        <el-input v-model="dataForm.ftCost" readonly></el-input>
      </zt-form-item>
      <zt-form-item label="分摊限制" prop="ftLimit" rules="required">
        <el-input v-model="dataForm.ftLimit"></el-input>
      </zt-form-item>
      <zt-form-item label="工时" prop="hours" rules="required">
        <el-input v-model="dataForm.hours"></el-input>
        <el-input v-model="dataForm.hours" readonly></el-input>
      </zt-form-item>
      <zt-form-item label="价款科目编码" prop="priceAccount" rules="required">
        <el-input v-model="dataForm.priceAccount"></el-input>
@@ -45,45 +45,45 @@
</template>
<script>
export default {
  data() {
    return {
      dataForm: {
        id: '',
        year: '',
        project: '',
        projectTypeId: '',
        isFinished: '',
        department: '',
        price: '',
        directCost: '',
        ftCost: '',
        ftLimit: '',
        hours: '',
        priceAccount: '',
        costAccount: '',
        remark: ''
      }
    }
  },
  methods: {
    // 获取信息
    async getInfo() {
      let res = await this.$http.get(`/statement/Statement/${this.dataForm.id}`)
      this.dataForm = {
        ...this.dataForm,
        ...res.data
  export default {
    data() {
      return {
        dataForm: {
          id: '',
          year: '',
          project: '',
          projectTypeId: '',
          isFinished: '',
          department: '',
          price: '',
          directCost: '',
          ftCost: '',
          ftLimit: '',
          hours: '',
          priceAccount: '',
          costAccount: '',
          remark: ''
        }
      }
    },
    // 表单提交
    async formSubmit() {
      let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/statement/Statement/', this.dataForm)
      if (res.success) {
        await this.$tip.success()
        this.$refs.dialog.close()
        this.$emit('refreshDataList')
    methods: {
      // 获取信息
      async getInfo() {
        let res = await this.$http.get(`/statement/Statement/${this.dataForm.id}`)
        this.dataForm = {
          ...this.dataForm,
          ...res.data
        }
      },
      // 表单提交
      async formSubmit() {
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/statement/Statement/', this.dataForm)
        if (res.success) {
          await this.$tip.success()
          this.$refs.dialog.close()
          this.$emit('refreshDataList')
        }
      }
    }
  }
}
</script>