From f169a06cea16bc6215743a7be07febdb1d4fdc38 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期五, 12 七月 2024 17:16:55 +0800
Subject: [PATCH] qxtj

---
 src/views/system/comp/index.vue |  245 +++++++++++++++++++++++++++----------------------
 1 files changed, 135 insertions(+), 110 deletions(-)

diff --git a/src/views/system/comp/index.vue b/src/views/system/comp/index.vue
index f1f039a..819277a 100644
--- a/src/views/system/comp/index.vue
+++ b/src/views/system/comp/index.vue
@@ -453,7 +453,6 @@
                   icon="el-icon-plus"
                   size="mini"
                   @click="handleGroup"
-                  v-hasPermi="['system:comp:add']"
                   >淇濆瓨</el-button
                 >
               </el-col>
@@ -464,7 +463,6 @@
                   size="mini"
                   :disabled="singlegg"
                   @click="GroupUpdate"
-                  v-hasPermi="['system:comp:edit']"
                   >閲嶇疆</el-button
                 >
                 <el-button
@@ -473,7 +471,6 @@
                   size="mini"
                   :disabled="singlegg"
                   @click="deleteGroup"
-                  v-hasPermi="['system:comp:edit']"
                   >鍒犻櫎</el-button
                 >
               </el-col>
@@ -606,16 +603,19 @@
                   style="width: 140px"
                 />
               </el-form-item>
+              <el-form-item>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">閲嶇疆</el-button>
+      </el-form-item>
             </el-form>
-            <div style="color: red; font-size: 8px">
+            <!-- <div style="color: red; font-size: 8px">
               娉ㄩ噴锛氶紶鏍囧乏閿弻鍑婚�変腑琛屽彲鍒犻櫎
-            </div>
+            </div> -->
+            <!--       @row-dblclick="dbclick" -->
             <el-table
               border
               v-loading="loading"
               :data="OnenewpacName"
               :row-class-name="tableRowClassName"
-              @row-dblclick="dbclick"
               height="478"
             >
               <el-table-column
@@ -625,6 +625,17 @@
               >
                 <template slot-scope="scope">
                   {{ scope.row.proName + "/" + scope.row.proPrice }}
+                </template>
+              </el-table-column>
+              <el-table-column label="鎿嶄綔" align="center" width="68">
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handledbelete(scope.row)"
+                    >鍒犻櫎</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -1011,31 +1022,31 @@
         contactPhone: [
           { required: true, validator: checkPhoneNum, trigger: "blur" },
         ],
-        taxNumber: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        legalPerson: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        registerAddress: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        bankAccount: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        countNum: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        principal: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        faxNumber: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        mailingAddress: [
-          { required: true, validator: checkPhoneNum, trigger: "blur" },
-        ],
-        email: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
+        // taxNumber: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // legalPerson: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // registerAddress: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // bankAccount: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // countNum: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // principal: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // faxNumber: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // mailingAddress: [
+        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
+        // ],
+        // email: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
       },
     };
   },
@@ -1126,6 +1137,11 @@
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    resetQuerys(){
+      this.OnenewpacName = [],
+      this.queryParams.price = 0,
+       this.$refs.tbone.toggleRowSelection(this.pacList[0], false);
+    },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
       selection.forEach((item) => {
@@ -1212,36 +1228,36 @@
               index +
               1;
           });
-          if (this.groupList.length >= 1) {
-            if (this.groupList[0].id) {
-              getfzgrouping(this.groupList[0].id).then((response) => {
-                this.OnenewpacName = response.data.groupingProList;
-                this.queryParams.price = 0;
-                this.OnenewpacName.forEach((item) => {
-                  this.queryParams.price += item.proPrice;
-                });
-              });
-            }
-          }
+          // if (this.groupList.length >= 1) {
+          //   if (this.groupList[0].id) {
+          //     getfzgrouping(this.groupList[0].id).then((response) => {
+          //       this.OnenewpacName = response.data.groupingProList;
+          //       this.queryParams.price = 0;
+          //       this.OnenewpacName.forEach((item) => {
+          //         this.queryParams.price += item.proPrice;
+          //       });
+          //     });
+          //   }
+          // }
 
-          if (this.newpacName.length != 0) {
-            this.$nextTick(() => {
-              if (this.forms.pacName) {
-                this.newpacName.forEach((item, index) => {
-                  if (this.forms.pacName == item.pacName) {
-                    this.$refs.tbone.toggleRowSelection(
-                      this.newpacName[index],
-                      true
-                    );
-                  }
-                });
-              } else {
-                this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
-              }
-            });
-          } else {
-            this.$refs.tbone.clearSelection();
-          }
+          // if (this.newpacName.length != 0) {
+          //   this.$nextTick(() => {
+          //     if (this.forms.pacName) {
+          //       this.newpacName.forEach((item, index) => {
+          //         if (this.forms.pacName == item.pacName) {
+          //           this.$refs.tbone.toggleRowSelection(
+          //             this.newpacName[index],
+          //             true
+          //           );
+          //         }
+          //       });
+          //     } else {
+          //       this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
+          //     }
+          //   });
+          // } else {
+          //   this.$refs.tbone.clearSelection();
+          // }
         });
       } else {
         deptTreeSelect().then((response) => {
@@ -1253,35 +1269,35 @@
               index +
               1;
           });
-          if (this.groupList.length >= 1) {
-            if (this.groupList[0].id) {
-              getfzgrouping(this.groupList[0].id).then((response) => {
-                this.OnenewpacName = response.data.groupingProList;
-                this.queryParams.price = 0;
-                this.OnenewpacName.forEach((item) => {
-                  this.queryParams.price += item.proPrice;
-                });
-              });
-            }
-          }
-          if (this.newpacName.length != 0) {
-            this.$nextTick(() => {
-              if (this.forms.pacName) {
-                this.newpacName.forEach((item, index) => {
-                  if (this.forms.pacName == item.pacName) {
-                    this.$refs.tbone.toggleRowSelection(
-                      this.newpacName[index],
-                      true
-                    );
-                  }
-                });
-              } else {
-                this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
-              }
-            });
-          } else {
-            this.$refs.tbone.clearSelection();
-          }
+          // if (this.groupList.length >= 1) {
+          //   if (this.groupList[0].id) {
+          //     getfzgrouping(this.groupList[0].id).then((response) => {
+          //       this.OnenewpacName = response.data.groupingProList;
+          //       this.queryParams.price = 0;
+          //       this.OnenewpacName.forEach((item) => {
+          //         this.queryParams.price += item.proPrice;
+          //       });
+          //     });
+          //   }
+          // }
+          // if (this.newpacName.length != 0) {
+          //   this.$nextTick(() => {
+          //     if (this.forms.pacName) {
+          //       this.newpacName.forEach((item, index) => {
+          //         if (this.forms.pacName == item.pacName) {
+          //           this.$refs.tbone.toggleRowSelection(
+          //             this.newpacName[index],
+          //             true
+          //           );
+          //         }
+          //       });
+          //     } else {
+          //       this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
+          //     }
+          //   });
+          // } else {
+          //   this.$refs.tbone.clearSelection();
+          // }
         });
       }
       getProjectList().then((response) => {
@@ -1357,6 +1373,17 @@
         this.queryParams.price += item.proPrice;
       });
     },
+    handledbelete(row){
+      this.queryParams.price = 0;
+      this.OnenewpacName.forEach((item,index) => {
+        if(item.proId == row.proId){
+          this.OnenewpacName.splice(index, 1);
+        }
+      });
+      return this.OnenewpacName.forEach((item) => {
+        this.queryParams.price += item.proPrice;
+      });
+    },
     submitrighr() {
       if (this.pacList.length >= 1) {
         this.openss = false;
@@ -1372,30 +1399,22 @@
     },
     // 濂楅鍗曢」鑾峰彇
     handleChangeOne(selection) {
-      this.pacList = selection;
-      this.OnenewpacName.forEach((item,index) => {
-        this.dataLists.forEach(item1 => {
-          if(item.proId == item1.proId){
-            this.OnenewpacName.splice(index,1)
-          }
-        })
-      })
-      this.dataLists = [];
-      this.queryParams.price = 0;
-      this.pacList.forEach((item) => {
-        this.dataLists = item.tjProjectList;
-      });
-      this.dataLists.forEach((item2) => {
-        this.OnenewpacName.push(item2);
-      });
-      this.OnenewpacName.forEach((item) => {
-        this.queryParams.price += item.proPrice;
-      });
-
       if (selection.length > 1) {
         let del_row = selection.shift();
         this.$refs.tbone.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
       }
+      this.pacList = selection;
+      this.dataLists = [];
+      this.queryParams.price = 0;
+      this.pacList.forEach((item) => {
+        this.OnenewpacName = item.tjProjectList;
+      });
+      // this.dataLists.forEach((item2) => {
+      //   this.OnenewpacName.push(item2);
+      // });
+      this.OnenewpacName.forEach((item) => {
+        this.queryParams.price += item.proPrice;
+      });
     },
     beCurrentDept() {
       Deptlist(this.form.drugManufacturerId).then((response) => {
@@ -1582,6 +1601,7 @@
 
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
+      
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.drugManufacturerId != null) {
@@ -1591,11 +1611,16 @@
               this.getList();
             });
           } else {
-            addComp(this.form).then((response) => {
+            if(this.form.cnName && this.form.contactPerson && this.form.contactPhone){
+              addComp(this.form).then((response) => {
               this.$modal.msgSuccess("鏂板鎴愬姛");
               this.open = false;
               this.getList();
             });
+            }else{
+              this.$modal.msgError("璇峰~鍐欏繀浼犻」");
+            }
+           
           }
         }
       });

--
Gitblit v1.8.0