Browse Source

重置formValues

lifanagju_citu 4 tháng trước cách đây
mục cha
commit
f22bdf8fba

+ 15 - 3
src/views/salary/claim/components/form.vue

@@ -1,7 +1,7 @@
 <template>
   <m-dialog title="分润认领" ref="dialog" @sure="onSure">
     <m-divider content-position="left">基准分润</m-divider>
-    <m-form :items="showItemForm" v-model="itemData" v-loading="loading"></m-form>
+    <m-form :items="showItemForm" v-model="itemData"></m-form>
     <m-divider content-position="left">新增分润认领</m-divider>
     <m-form ref="form" :items="formItems" v-model="formValues" v-loading="loading"></m-form>
   </m-dialog>
@@ -17,6 +17,12 @@ import {
 import { getRosterList } from '@/api/system'
 export default {
   name: 'ClaimForm',
+  props: {
+    staff: {
+      type: Boolean,
+      default: false
+    }
+  },
   data () {
     return {
       formValues: {
@@ -154,9 +160,15 @@ export default {
       this.loading = true
       this.itemData = item || {}
       if (item?.employeeProfitSharingRatio) this.itemData.ratioShow = item.employeeProfitSharingRatio * 100
+      this.formValues = {
+        serialNumber: item.serialNumber,
+        customerId: item.customerId,
+        organizationNo: null,
+        unifiedCertificationNumber: null,
+        employeeProfitSharingRatio: null
+      }
       this.$refs.dialog.open()
-      this.formValues.serialNumber = item.serialNumber
-      this.formValues.customerId = item.customerId
+
       this.$nextTick(() => {
         this.$refs.form.clearValidate()
         this.loading = false

+ 1 - 7
src/views/salary/claim/staff/index.vue

@@ -31,12 +31,6 @@ export default {
   components: {
     ClaimForm
   },
-  props: {
-    staff: {
-      type: Boolean,
-      default: false
-    }
-  },
   data () {
     return {
       searchItems: [
@@ -119,7 +113,7 @@ export default {
       this.$refs.templateRefs.open()
     },
     onEdit (item) {
-      this.$refs.templateRefs.open(item)
+      this.$refs.claimFormRef.open(item)
     },
     onSearch () {
       if (!this.searchValues.customerId) return this.$message.warning('请输入要查询的客户编码')