فهرست منبع

fix(发票管理): 修复新增编辑对话框初始化参数顺序问题

liujt 5 ماه پیش
والد
کامیت
f84b6a3cfa

+ 8 - 3
src/views/financialManage/collectionPlan/index.vue

@@ -596,9 +596,14 @@ export default {
 
     //新增编辑
     openEdit(type, row) {
-      this.$refs.addDialogRef.open(type, row, row.id);
-      this.$refs.addDialogRef.$refs.form &&
-        this.$refs.addDialogRef.$refs.form.clearValidate();
+      let partaIds = this.selection.map((item) => item.partaId);
+      if(this.selection.length == 0 || new Set(partaIds).size != 1) {
+        this.$message.warning('请选择相同客户的计划!');
+        return
+      }
+      this.$refs.addOrEditDialogNewRef.init(type, row, row.id);
+      this.$refs.addOrEditDialogNewRef.$refs.form &&
+        this.$refs.addOrEditDialogNewRef.$refs.form.clearValidate();
     },
     uploadFile() {
       this.$refs.importDialogRef.open();

+ 2 - 1
src/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue

@@ -706,6 +706,7 @@
         accountingSubjectList: [],
         deptList: [],
         deptTreeList: [],
+        tableForm: {},
         rules: {
           applyDeptId: { required: true, message: '请选择', trigger: 'change' },
           applyUserId: { required: true, message: '请选择', trigger: 'change' },
@@ -728,7 +729,7 @@
     },
     methods: {
       //从发票管理新增发票初始化
-      async init(row = {}, type) {
+      async init(type, row = {}) {
         this.title = type == 'add' ? '新增' : '修改';
         this.dialogType = type;
         if (type == 'add') {