瀏覽代碼

客户管理-修复必填项没填不提示的BUG。

DongZ 1 年之前
父節點
當前提交
dfd71af247

+ 10 - 6
src/views/business/spd/cm/customers/index.vue

@@ -384,8 +384,10 @@
                     </el-button>
                   </el-col>
                 </el-row>
-                <el-table :data="mkCmCustomersResponsiblePersonList" :row-class-name="rowMkCmCustomersResponsiblePersonIndex"
-                  @selection-change="handleMkCmCustomersResponsiblePersonSelectionChange" ref="mkCmCustomersResponsiblePerson">
+                <el-table :data="mkCmCustomersResponsiblePersonList"
+                  :row-class-name="rowMkCmCustomersResponsiblePersonIndex"
+                  @selection-change="handleMkCmCustomersResponsiblePersonSelectionChange"
+                  ref="mkCmCustomersResponsiblePerson">
                   <el-table-column type="selection" width="55" align="center" />
                   <el-table-column label="人员姓名" align="center" prop="personName" min-width="150" />
                   <el-table-column label="客户名称" align="center" prop="customersName" min-width="150" />
@@ -459,7 +461,7 @@
               </el-tab-pane>
             </el-tabs>
 
-            <div slot="footer" class="dialog-footer" style="margin-left: 88%; margin-top: 1%">
+            <div slot="footer" style="margin-left: 88%; margin-top: 1%">
               <el-button type="primary" @click="submitForm" :disabled="openState == 'check'">确 定</el-button>
               <el-button @click="cancel">取 消</el-button>
             </div>
@@ -693,6 +695,7 @@
         this.activeName = 'first';
         this.mkCmCustomersResponsiblePersonList = [];
         this.mkCmCustomersDepartmentList = [];
+        this.resetForm("form");
       },
       /** 搜索按钮操作 */
       handleQuery() {
@@ -701,6 +704,7 @@
       },
       /** 重置按钮操作 */
       resetQuery() {
+        this.resetForm("queryForm");
         this.handleQuery();
       },
       // 多选框选中数据
@@ -776,23 +780,23 @@
       /** 提交按钮 */
       submitForm() {
         this.$refs["form"].validate(valid => {
+          console.log(this.isList, 'this.isList');
           if (valid) {
             if (this.form.id != null) {
               updateCustomers(this.form).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.getList();
+                this.isList = true;
               });
             } else {
               addCustomers(this.form).then(response => {
                 this.$modal.msgSuccess("新增成功");
                 this.getList();
+                this.isList = true;
               });
             }
-          } else {
-            this.$modal.msgError("校验失败");
           }
         });
-        this.isList = true;
       },
       /** 删除按钮操作 */
       handleDelete(row) {

+ 11 - 48
src/views/business/spd/cm/customersDepartment/index.vue

@@ -55,15 +55,11 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row type="flex" class="row-bg" justify="space-around">
-        <el-col :span="6">
-          <el-form-item label="单据状态" prop="state">
-          </el-form-item>
-        </el-col>
-      </el-row>
+    </el-form>
+    <div slot="footer" style="margin-left: 88%; margin-top: 1%">
       <el-button type="primary" @click="submitForm" :disabled="disable">确 定</el-button>
       <el-button @click="cancel">取 消</el-button>
-    </el-form>
+    </div>
   </div>
 </template>
 
@@ -107,14 +103,9 @@
         total: 0,
         // 客户科室表格数据
         customersDepartmentList: [],
-        // 弹出层标题
-        title: "",
-        // 是否显示弹出层
-        open: false,
-        // 查询参数
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
+        // 表单参数
+        form: {
+          id: null,
           name: null,
           customersName: null,
           responsiblePerson: null,
@@ -132,9 +123,12 @@
           customersId: null,
           tenantId: null,
           revision: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          delFlag: null
         },
-        // 表单参数
-        form: {},
         // 表单校验
         rules: {
           name: [{
@@ -146,7 +140,6 @@
       };
     },
     created() {
-      this.reset();
       // 客户主键赋值
       this.form.customersId = this.customersId;
       if (this.pageStu == 'check' || this.pageStu == 'update') {
@@ -158,34 +151,6 @@
       cancel() {
         this.$emit('jugislist', false);
       },
-      // 表单重置
-      reset() {
-        this.form = {
-          id: null,
-          name: null,
-          customersName: null,
-          responsiblePerson: null,
-          responsiblePersonName: null,
-          phone: null,
-          address: null,
-          conventionalTherapy: null,
-          characteristic: null,
-          salesman: null,
-          salesmanName: null,
-          marketingArea: null,
-          marketingAreaName: null,
-          memo: null,
-          state: null,
-          customersId: null,
-          tenantId: null,
-          revision: null,
-          createBy: null,
-          createTime: null,
-          updateBy: null,
-          updateTime: null,
-          delFlag: null
-        };
-      },
       /** 提交按钮 */
       submitForm() {
         this.$refs["form"].validate(valid => {
@@ -193,13 +158,11 @@
             if (this.form.id != null) {
               updateCustomersDepartment(this.form).then(response => {
                 this.$modal.msgSuccess("修改成功");
-                this.open = false;
                 this.cancel();
               });
             } else {
               addCustomersDepartment(this.form).then(response => {
                 this.$modal.msgSuccess("新增成功");
-                this.open = false;
                 this.cancel();
               });
             }

+ 11 - 35
src/views/business/spd/cm/customersResponsiblePerson/index.vue

@@ -46,9 +46,11 @@
           </el-form-item>
         </el-col>
       </el-row>
+    </el-form>
+    <div slot="footer" style="margin-left: 88%; margin-top: 1%">
       <el-button type="primary" @click="submitForm" :disabled="disable">确 定</el-button>
       <el-button @click="cancel">取 消</el-button>
-    </el-form>
+    </div>
   </div>
 </template>
 
@@ -93,14 +95,9 @@
         total: 0,
         // 客户负责人表格数据
         customersResponsiblePersonList: [],
-        // 弹出层标题
-        title: "",
-        // 是否显示弹出层
-        open: false,
-        // 查询参数
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
+        // 表单参数
+        form: {
+          id: null,
           person: null,
           personName: null,
           customersName: null,
@@ -111,9 +108,12 @@
           customersId: null,
           tenantId: null,
           revision: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          delFlag: null
         },
-        // 表单参数
-        form: {},
         // 表单校验
         rules: {
           personName: [{
@@ -135,7 +135,6 @@
       };
     },
     created() {
-      this.reset();
       // 客户主键赋值
       this.form.customersId = this.customersId;
       if (this.pageStu == 'check' || this.pageStu == 'update') {
@@ -147,27 +146,6 @@
       cancel() {
         this.$emit('jugislist', false);
       },
-      // 表单重置
-      reset() {
-        this.form = {
-          id: null,
-          person: null,
-          personName: null,
-          customersName: null,
-          relationshipType: null,
-          productionLine: null,
-          startDate: null,
-          endDate: null,
-          customersId: null,
-          tenantId: null,
-          revision: null,
-          createBy: null,
-          createTime: null,
-          updateBy: null,
-          updateTime: null,
-          delFlag: null
-        };
-      },
       /** 提交按钮 */
       submitForm() {
         this.$refs["form"].validate(valid => {
@@ -175,13 +153,11 @@
             if (this.form.id != null) {
               updateCustomersResponsiblePerson(this.form).then(response => {
                 this.$modal.msgSuccess("修改成功");
-                this.open = false;
                 this.cancel();
               });
             } else {
               addCustomersResponsiblePerson(this.form).then(response => {
                 this.$modal.msgSuccess("新增成功");
-                this.open = false;
                 this.cancel();
               });
             }