From 52bb988de16298ca1c7364e5fb6b0faa47d0c088 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期二, 10 十月 2023 15:35:42 +0800
Subject: [PATCH] feat: 销售机会/报价单销售总单/销售子单 去除批量删除添加单独删除;表单宽度/label宽度调整

---
 src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue |   37 +++++---
 src/views/sales/subOrder/index.vue                             |   34 +++++++-
 src/views/sales/quotation/AddQuotationDialog.vue               |   14 ++-
 src/views/sales/salesOpportunity/index.vue                     |   37 ++++++++-
 src/views/sales/subOrder/AddSubOrderDialog.vue                 |    9 +
 src/views/sales/masterOrder/index.vue                          |   36 +++++++-
 src/views/sales/masterOrder/AddMasterOrderDialog.vue           |   13 ++-
 src/views/sales/quotation/index.vue                            |   36 +++++++-
 8 files changed, 168 insertions(+), 48 deletions(-)

diff --git a/src/views/sales/masterOrder/AddMasterOrderDialog.vue b/src/views/sales/masterOrder/AddMasterOrderDialog.vue
index 72975cd..666e60f 100644
--- a/src/views/sales/masterOrder/AddMasterOrderDialog.vue
+++ b/src/views/sales/masterOrder/AddMasterOrderDialog.vue
@@ -13,7 +13,7 @@
         :model="editConfig.infomation"
         :rules="rules"
         label-position="right"
-        label-width="308px"
+        label-width="120px"
         size="mini"
       >
         <!-- 淇℃伅 -->
@@ -59,7 +59,7 @@
                     v-model="editConfig.infomation.member_id"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
+                    style="width: 100%"
                   >
                     <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
@@ -71,6 +71,7 @@
                   <el-date-picker
                     v-model="editConfig.infomation.start_time"
                     value-format="yyyy-MM-dd HH:mm:ss"
+                    style="width: 100%"
                     type="datetime"
                     placeholder="閫夋嫨鏃ユ湡"
                   >
@@ -83,6 +84,7 @@
                     v-model="editConfig.infomation.end_time"
                     value-format="yyyy-MM-dd HH:mm:ss"
                     type="datetime"
+                    style="width: 100%"
                     placeholder="閫夋嫨鏃ユ湡"
                   >
                   </el-date-picker>
@@ -96,7 +98,7 @@
                     :min="0"
                     :precision="2"
                     :controls="false"
-                    style="width: 25%; margin-right: 5px"
+                    style="width: 100%"
                   ></el-input-number>
                 </el-form-item>
               </el-col>
@@ -177,7 +179,7 @@
   },
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
         number: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -338,6 +340,9 @@
             font-size: 18px;
             cursor: pointer;
           }
+          .el-autocomplete{
+            flex: 1;
+          }
         }
       }
       .address-view {
diff --git a/src/views/sales/masterOrder/index.vue b/src/views/sales/masterOrder/index.vue
index 85e9afe..7c1f35a 100644
--- a/src/views/sales/masterOrder/index.vue
+++ b/src/views/sales/masterOrder/index.vue
@@ -8,15 +8,13 @@
       <div class="filter-card">
         <CommonSearch
             :show-add="false"
-            :show-download="false"
             :amount-view="false"
-            :show-action-btn="false"
             placeholder="璇疯緭鍏ュ崟鎹紪鍙�"
             @searchClick="onFilterSearch"
         >
           <template slot="leftButton">
             <el-button size="small" type="primary"  @click="addBtnClick">鏂板缓</el-button>
-            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>
+<!--            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>-->
           </template>
         </CommonSearch>
       </div>
@@ -29,7 +27,6 @@
               ref="tableListRef"
               :show-summary="showSummary"
               :table-list="tableList"
-              :select-box="!isDetail"
               @selClientClick="selClientClick"
               @selCommonClick="selCommonClick"
               @getSelectArray="getSelectArray"
@@ -39,7 +36,7 @@
               <el-table-column label="鎿嶄綔" width="90">
                 <template slot-scope="scope">
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
-                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+                   <el-button @click="deleteItem(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
                 </template>
               </el-table-column>
             </template>
@@ -243,7 +240,7 @@
       this.editConfig.title = "缂栬緫"
       this.editConfig.infomation = { ...row }
     },
-    // 鍒犻櫎
+    // 鎵归噺鍒犻櫎
     delClick() {
       if (this.selValueList && this.selValueList.length > 0) {
         this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
@@ -266,6 +263,33 @@
         this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
       }
     },
+    /**
+     * 鍗曚釜鍒犻櫎
+     * @param id 閿�鍞�诲崟id
+     */
+    deleteItem(id) {
+      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+          .then(() => {
+            getDelMasterOrder({ids: [id]}).then((response) => {
+              if (response.code === 200) {
+                this.$message.success("鍒犻櫎鎴愬姛")
+                this.getData()
+              } else {
+                this.$message.warning("鍒犻櫎澶辫触")
+              }
+            })
+          })
+          .catch((err) => {
+            if (err !== 'cancel') {
+              console.error(err)
+              this.$message.warning("鍒犻櫎澶辫触")
+            }
+          })
+    },
     getSelectArray(val) {
       console.log(val)
       this.selValueList = []
diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue
index 055cc94..23192e4 100644
--- a/src/views/sales/quotation/AddQuotationDialog.vue
+++ b/src/views/sales/quotation/AddQuotationDialog.vue
@@ -13,7 +13,7 @@
         :model="editConfig.infomation"
         :rules="rules"
         label-position="right"
-        label-width="308px"
+        label-width="110px"
         size="mini"
         style="height: 60vh; overflow-x: hidden"
       >
@@ -82,6 +82,7 @@
                     v-model="editConfig.infomation.validity_date"
                     value-format="yyyy-MM-dd HH:mm:ss"
                     type="datetime"
+                    style="width: 100%"
                     placeholder="閫夋嫨鏃ユ湡"
                   >
                   </el-date-picker>
@@ -119,7 +120,7 @@
                     v-model="editConfig.infomation.member_id"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
+                    style="width: 100%"
                   >
                     <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
@@ -324,7 +325,7 @@
   },
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
         client_id: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -625,7 +626,7 @@
         .common-select {
           display: flex;
           .common-select-sel {
-            width: 270px;
+            flex: 1;
           }
           .common-select-btn {
             margin-left: 5px;
@@ -633,6 +634,11 @@
             cursor: pointer;
           }
         }
+        .custom-name{
+          .el-autocomplete{
+            flex: 1;
+          }
+        }
       }
       .annex-view {
         display: flex;
diff --git a/src/views/sales/quotation/index.vue b/src/views/sales/quotation/index.vue
index 4ef0aae..1dd24be 100644
--- a/src/views/sales/quotation/index.vue
+++ b/src/views/sales/quotation/index.vue
@@ -8,15 +8,13 @@
       <div class="filter-card">
         <CommonSearch
             :show-add="false"
-            :show-download="false"
             :amount-view="false"
-            :show-action-btn="false"
             placeholder="璇疯緭鍏ユ姤浠峰崟鍙�"
             @searchClick="onFilterSearch"
         >
           <template slot="leftButton">
             <el-button size="small" type="primary"  @click="addBtnClick">鏂板缓</el-button>
-            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>
+<!--            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>-->
           </template>
         </CommonSearch>
       </div>
@@ -28,7 +26,6 @@
           <TableCommonView
               ref="tableListRef"
               :table-list="tableList"
-              :select-box="!isDetail"
               @selClientClick="selClientClick"
               @selContactsClick="selContactsClick"
               @selCommonClick="selCommonClick"
@@ -39,7 +36,7 @@
               <el-table-column label="鎿嶄綔" width="90">
                 <template slot-scope="scope">
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
-                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+                   <el-button @click="deleteItem(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
                 </template>
               </el-table-column>
             </template>
@@ -242,7 +239,7 @@
       this.editConfig.title = "缂栬緫"
       this.editConfig.infomation = { ...row, currency: "浜烘皯甯�" }
     },
-    // 鍒犻櫎
+    // 鎵归噺鍒犻櫎
     delClick() {
       if (this.selValueList && this.selValueList.length > 0) {
         this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
@@ -265,6 +262,33 @@
         this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
       }
     },
+    /**
+     * 鍗曚釜鍒犻櫎
+     * @param id 鎶ヤ环鍗昳d
+     */
+    deleteItem(id) {
+      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+          .then(() => {
+            getDelQuotation({ids: [id]}).then((response) => {
+              if (response.code === 200) {
+                this.$message.success("鍒犻櫎鎴愬姛")
+                this.getData()
+              } else {
+                this.$message.warning("鍒犻櫎澶辫触")
+              }
+            })
+          })
+          .catch((err) => {
+            if (err !== 'cancel') {
+              console.error(err)
+              this.$message.warning("鍒犻櫎澶辫触")
+            }
+          })
+    },
     getSelectArray(val) {
       console.log(val)
       this.selValueList = []
diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
index 75d34f6..69c9edd 100644
--- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
+++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -13,7 +13,7 @@
         :model="editConfig.infomation"
         :rules="rules"
         label-position="right"
-        label-width="308px"
+        label-width="208px"
         size="mini"
         style="height: 60vh; overflow-x: hidden"
       >
@@ -151,7 +151,7 @@
                     v-model="editConfig.infomation.member_id"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
+                    style="width: 100%"
                   >
                     <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
@@ -214,7 +214,7 @@
                     v-model="editConfig.infomation.currency"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
+                    style="width: 100%"
                   >
                     <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id">
                     </el-option>
@@ -229,7 +229,7 @@
                     :min="0"
                     :precision="2"
                     :controls="false"
-                    style="width: 25%; margin-right: 5px"
+                    style="width: 100%"
                   ></el-input-number>
                 </el-form-item>
               </el-col>
@@ -239,6 +239,7 @@
                     v-model="editConfig.infomation.expected_time"
                     value-format="yyyy-MM-dd"
                     type="date"
+                    style="width: 100%"
                     placeholder="閫夋嫨鏃ユ湡"
                   >
                   </el-date-picker>
@@ -278,16 +279,17 @@
           <div class="basic-info-title">鍟嗘満涓冭绱�(5W2P)</div>
           <div class="basic-info-view">
             <el-row>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="瀹㈡埛闇�姹傛垨鐥涚偣锛坵hy锛�" prop="pain_points">
                   <el-input
                     type="textarea"
+                    style="width: 100%"
                     :autosize="{ minRows: 2 }"
                     v-model="editConfig.infomation.pain_points"
                   ></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="鏄惁宸茬粡绔嬮」锛坧lan锛�" prop="whether_established">
                   <el-input
                     type="textarea"
@@ -296,7 +298,7 @@
                   ></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="璧勯噾棰勭畻鏄灏戯紙plan锛�" prop="capital_budget">
                   <el-input
                     type="textarea"
@@ -305,7 +307,7 @@
                   ></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="鍏抽敭鍐崇瓥浜烘槸璋侊紙who锛�" prop="key_maker">
                   <el-input
                     type="textarea"
@@ -314,7 +316,7 @@
                   ></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="鍏抽敭鍐崇瓥鍥犵礌鏈夊摢浜涳紙what锛�" prop="key_factors">
                   <el-input
                     type="textarea"
@@ -323,7 +325,7 @@
                   ></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="鍐崇瓥娴佺▼鏄�庢牱鐨勶紙what锛�" prop="process">
                   <el-input
                     type="textarea"
@@ -332,7 +334,7 @@
                   ></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="绔炰簤瀵规墜鎻愪緵鐨勬柟妗堬紙what锛�" prop="solutions">
                   <el-input
                     type="textarea"
@@ -466,7 +468,7 @@
                   </div>
                 </el-form-item>
               </el-col> -->
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="璇︾粏鍦板潃" prop="detail_address">
                   <el-input
                     type="textarea"
@@ -482,7 +484,7 @@
           <div class="basic-info-title">澶囨敞淇℃伅</div>
           <div class="basic-info-view">
             <el-row>
-              <el-col :span="20">
+              <el-col>
                 <el-form-item label="澶囨敞" prop="remark">
                   <el-input
                     type="textarea"
@@ -578,7 +580,7 @@
   },
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
         number: [{ required: true, message: "璇疯緭鍏ラ攢鍞満浼氱紪鍙�", trigger: "blur" }],
@@ -829,7 +831,12 @@
         }
         .common-select {
           .common-select-sel {
-            width: 270px;
+            flex: 1;
+          }
+        }
+        .custom-name{
+          .el-autocomplete{
+            flex: 1;
           }
         }
       }
diff --git a/src/views/sales/salesOpportunity/index.vue b/src/views/sales/salesOpportunity/index.vue
index 78ef867..a1aab11 100644
--- a/src/views/sales/salesOpportunity/index.vue
+++ b/src/views/sales/salesOpportunity/index.vue
@@ -10,13 +10,12 @@
             :show-add="false"
             :show-download="false"
             :amount-view="false"
-            :show-action-btn="false"
             placeholder="璇疯緭鍏ユ満浼氬悕绉�"
             @searchClick="onFilterSearch"
         >
           <template slot="leftButton">
             <el-button size="small" type="primary"  @click="addBtnClick">鏂板缓</el-button>
-            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>
+<!--            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>-->
           </template>
         </CommonSearch>
       </div>
@@ -28,6 +27,7 @@
           <TableCommonView
               ref="tableListRef"
               :table-list="tableList"
+              :select-box="false"
               @selClientClick="selClientClick"
               @selContactsClick="selContactsClick"
               @selCommonClick="selCommonClick"
@@ -35,11 +35,11 @@
               @selTableCol="selTableCol"
           >
             <template slot="tableButton">
-              <el-table-column label="鎿嶄綔" width="100">
+              <el-table-column label="鎿嶄綔" width="120">
                 <template slot-scope="scope">
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
                   <el-button @click="followupClick(scope.row)" type="text" size="small">璺熻繘</el-button>
-                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+                   <el-button @click="deleteItem(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
                 </template>
               </el-table-column>
             </template>
@@ -257,7 +257,7 @@
       this.editConfig.title = "缂栬緫"
       this.editConfig.infomation = { ...row }
     },
-    // 鍒犻櫎
+    // 鎵归噺鍒犻櫎
     delClick() {
       if (this.selValueList && this.selValueList.length > 0) {
         this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
@@ -281,6 +281,33 @@
         this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
       }
     },
+    /**
+     * 鍗曚釜鍒犻櫎
+     * @param id 閿�鍞満浼歩d
+     */
+    deleteItem(id) {
+      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+          .then(() => {
+            getDelSaleChance({ids: [id]}).then((response) => {
+              if (response.code === 200) {
+                this.$message.success("鍒犻櫎鎴愬姛")
+                this.getData()
+              } else {
+                this.$message.warning("鍒犻櫎澶辫触")
+              }
+            })
+          })
+          .catch((err) => {
+            if (err!== 'cancel'){
+              console.error(err)
+              this.$message.warning("鍒犻櫎澶辫触")
+            }
+          })
+    },
     getSelectArray(val) {
       console.log(val)
       this.selValueList = []
diff --git a/src/views/sales/subOrder/AddSubOrderDialog.vue b/src/views/sales/subOrder/AddSubOrderDialog.vue
index 06be56e..10f5a17 100644
--- a/src/views/sales/subOrder/AddSubOrderDialog.vue
+++ b/src/views/sales/subOrder/AddSubOrderDialog.vue
@@ -13,7 +13,7 @@
         :model="editConfig.infomation"
         :rules="rules"
         label-position="right"
-        label-width="308px"
+        label-width="100px"
         size="mini"
       >
         <!-- 淇℃伅 -->
@@ -88,7 +88,7 @@
                     v-model="editConfig.infomation.memberId"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    style="width: 63%"
+                    style="width: 100%"
                   >
                     <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
                     </el-option>
@@ -200,7 +200,7 @@
   },
   data() {
     return {
-      dialogWidth: "80%",
+      dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
         number: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
@@ -498,6 +498,9 @@
             font-size: 18px;
             cursor: pointer;
           }
+          .el-autocomplete{
+            flex: 1;
+          }
         }
       }
       .address-view {
diff --git a/src/views/sales/subOrder/index.vue b/src/views/sales/subOrder/index.vue
index 124acd0..b1306d7 100644
--- a/src/views/sales/subOrder/index.vue
+++ b/src/views/sales/subOrder/index.vue
@@ -8,15 +8,13 @@
       <div class="filter-card">
         <CommonSearch
             :show-add="false"
-            :show-download="false"
             :amount-view="false"
-            :show-action-btn="false"
             placeholder="璇疯緭鍏ュ崟鎹紪鍙�"
             @searchClick="onFilterSearch"
         >
           <template slot="leftButton">
             <el-button size="small" type="primary"  @click="addBtnClick">鏂板缓</el-button>
-            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>
+<!--            <el-button size="small"  @click="delClick">鍒犻櫎</el-button>-->
           </template>
         </CommonSearch>
       </div>
@@ -29,7 +27,6 @@
               ref="tableListRef"
               :table-list="tableList"
               :show-summary="showSummary"
-              :select-box="!isDetail"
               @selClientClick="selClientClick"
               @selMasterClick="selMasterClick"
               @selCommonClick="selCommonClick"
@@ -40,7 +37,7 @@
               <el-table-column label="鎿嶄綔" width="90">
                 <template slot-scope="scope">
                   <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
-                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+                   <el-button @click="deleteItem(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
                 </template>
               </el-table-column>
             </template>
@@ -284,6 +281,33 @@
         this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
       }
     },
+    /**
+     * 鍗曚釜鍒犻櫎
+     * @param id 閿�鍞瓙鍗昳d
+     */
+    deleteItem(id) {
+      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+          .then(() => {
+            getDelSubOrder({ids: [id]}).then((response) => {
+              if (response.code === 200) {
+                this.$message.success("鍒犻櫎鎴愬姛")
+                this.getData()
+              } else {
+                this.$message.warning("鍒犻櫎澶辫触")
+              }
+            })
+          })
+          .catch((err) => {
+            if (err !== 'cancel') {
+              console.error(err)
+              this.$message.warning("鍒犻櫎澶辫触")
+            }
+          })
+    },
     getSelectArray(val) {
       console.log(val)
       this.selValueList = []

--
Gitblit v1.8.0