From d86ccb2b95f03aaa4e3ef3fdab8f3bda5d965473 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期二, 17 十月 2023 20:38:06 +0800
Subject: [PATCH] Merge branch 'dev' into songshankun/adjust-style

---
 src/views/warehouseManage/warehouse/AddDialog.vue |  251 +++++++++++++++++++++++++++----------------------
 1 files changed, 139 insertions(+), 112 deletions(-)

diff --git a/src/views/warehouseManage/warehouse/AddDialog.vue b/src/views/warehouseManage/warehouse/AddDialog.vue
index 11e26d7..3a53609 100644
--- a/src/views/warehouseManage/warehouse/AddDialog.vue
+++ b/src/views/warehouseManage/warehouse/AddDialog.vue
@@ -27,96 +27,113 @@
         ref="form"
         :model="editConfig.infomation"
         :rules="rules"
-        label-position="left"
+        label-position="right"
         label-width="100px"
         size="mini"
-        style="height: 60vh; overflow-x: hidden"
       >
-        <div>
-          <!-- <div>aaa</div> -->
+        <div class="content-number-bg">
           <FormBtnsView :showWarehouse="true" @productClick="productClick" />
         </div>
         <div class="basic-info">
           <div class="basic-info-view">
-
             <el-row>
-              <el-col :span="24" class="line_height_30px">
+              <el-col :span="12" class="line_height_30px">
                 <el-form-item label="浠撳簱" prop="name">
-                  <el-input
-                  :disabled="showEdit"
-                    v-model="editConfig.infomation.name"
-                    placeholder="璇疯緭鍏�"
-                  ></el-input>
+                  <el-input :disabled="showEdit" v-model="editConfig.infomation.name" placeholder="璇疯緭鍏�"></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="11">
+              <el-col :span="12">
                 <el-form-item label="缂╁啓" prop="code">
-                  <el-input
-                  :disabled="showEdit"
-                    v-model="editConfig.infomation.code"
-                    placeholder="璇疯緭鍏�"
-                  ></el-input>
+                  <el-input :disabled="showEdit" v-model="editConfig.infomation.code" placeholder="璇疯緭鍏�"></el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="2">&nbsp;</el-col>
-              <el-col :span="11">
+              <el-col :span="12">
                 <el-form-item label="鍦板潃" prop="address">
                   <el-input
-                  :disabled="showEdit"
+                    :disabled="showEdit"
                     v-model="editConfig.infomation.address"
                     placeholder="璇疯緭鍏�"
                   ></el-input>
                 </el-form-item>
               </el-col>
+              <el-col :span="24">
+                <el-form-item label="鍏ュ悜杩愯緭" prop="inboundTransportation">
+                  <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.inboundTransportation">
+                    <el-radio
+                      style="width: 90%"
+                      class="line_height_30px"
+                      v-for="item in inboundTransportationList"
+                      :key="item.id"
+                      :disabled="item.disabled"
+                      :label="item.id"
+                      >{{ item.name }}</el-radio
+                    >
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="鍑哄簱杩愯緭" prop="outboundTransportation">
+                  <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.outboundTransportation">
+                    <el-radio
+                      style="width: 90%"
+                      class="line_height_30px"
+                      v-for="item in outboundTransportationList"
+                      :key="item.id"
+                      :disabled="item.disabled"
+                      :label="item.id"
+                      >{{ item.name }}</el-radio
+                    >
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
             </el-row>
           </div>
-          <div class="bottom">
+          <!-- <div class="bottom">
             <el-tabs v-model="activeName" type="card">
               <el-tab-pane label="浠撳簱閰嶇疆" name="first">
-                <div class="second-label">杩愯緭</div>
                 <el-form-item label="鍏ュ悜杩愯緭" prop="inboundTransportation">
-                  <el-radio-group
-                  :disabled="showEdit"
-                  v-model="editConfig.infomation.inboundTransportation"
-                  >
-                    <el-radio style="width:100%;" class="line_height_30px"
-                     v-for="(item) in inboundTransportationList" 
-                     :key='item.id'
-                     :disabled="item.disabled"
-                     :label="item.id"
-                      >{{item.name}}</el-radio>
+                  <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.inboundTransportation">
+                    <el-radio
+                      style="width: 100%"
+                      class="line_height_30px"
+                      v-for="item in inboundTransportationList"
+                      :key="item.id"
+                      :disabled="item.disabled"
+                      :label="item.id"
+                      >{{ item.name }}</el-radio
+                    >
                   </el-radio-group>
                 </el-form-item>
                 <el-form-item label="鍑哄簱杩愯緭" prop="outboundTransportation">
-                  <el-radio-group
-                  :disabled="showEdit"
-                  v-model="editConfig.infomation.outboundTransportation"
-                  >
-                    <el-radio style="width:100%;" class="line_height_30px" 
-                    v-for="(item) in outboundTransportationList"
-                     :key='item.id'
-                     :disabled="item.disabled" 
-                     :label="item.id"
-                     >{{item.name}}</el-radio>
+                  <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.outboundTransportation">
+                    <el-radio
+                      style="width: 100%"
+                      class="line_height_30px"
+                      v-for="item in outboundTransportationList"
+                      :key="item.id"
+                      :disabled="item.disabled"
+                      :label="item.id"
+                      >{{ item.name }}</el-radio
+                    >
                   </el-radio-group>
                 </el-form-item>
               </el-tab-pane>
             </el-tabs>
-          </div>
+          </div> -->
         </div>
       </el-form>
       <!-- 灏� -->
-      <div v-if="showFooter" slot="footer" class="dialog-footer">
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" size="small" @click="saveClick('form')" :disabled="!showFooter">淇濆瓨</el-button>
         <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
-        <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { addWarehouse,updateWarehouse,deleteWarehouse } from "@/api/warehouseManage/warehouse"
-import { getDataByType } from "@/api/data";
+import { addWarehouse, updateWarehouse, deleteWarehouse } from "@/api/warehouseManage/warehouse"
+import { getDataByType } from "@/api/data"
 export default {
   name: "AddScrapDialog",
   props: {
@@ -135,20 +152,20 @@
   computed: {},
   data() {
     return {
-      activeName:'first',
+      activeName: "first",
       dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
         name: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
-        code: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
+        code: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }]
       },
       memberOptions: [],
       paymentTypeListOptions: [],
       showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
       showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨
       currentState: "todo", // 褰撳墠鐘舵��
-      inboundTransportationList:getDataByType('inboundTransportation'),
-      outboundTransportationList:getDataByType('outboundTransportation'),
+      inboundTransportationList: getDataByType("inboundTransportation"),
+      outboundTransportationList: getDataByType("outboundTransportation")
     }
   },
   created() {
@@ -156,9 +173,7 @@
   },
   methods: {
     // 璺嚎
-    productClick() {
-      
-    },
+    productClick() {},
     // 璁剧疆鍒犻櫎/鎵撳嵃/缂栬緫鏄惁鏄剧ず
     setBottonView() {
       if (this.editConfig.title === "鏂板缓") {
@@ -178,16 +193,16 @@
     },
     // 鍒櫎
     deleteClick() {
-      let data = JSON.parse(JSON.stringify(this.editConfig.infomation));
+      let data = JSON.parse(JSON.stringify(this.editConfig.infomation))
       deleteWarehouse({ id: data.id }).then((res) => {
         if (res.code === 200) {
-          this.editConfig.visible = false;
-          this.$message.success("鍒櫎鎴愬姛!");
-          this.$emit("refresh");
-        }else {
-                    this.$message.warning(res.msg?res.msg:"鍒櫎澶辫触!")
-                }
-      });
+          this.editConfig.visible = false
+          this.$message.success("鍒櫎鎴愬姛!")
+          this.$emit("refresh")
+        } else {
+          this.$message.warning(res.msg ? res.msg : "鍒櫎澶辫触!")
+        }
+      })
     },
     // 缂栬緫
     editClick() {
@@ -195,52 +210,52 @@
       this.showFooter = true
     },
     saveParams() {
-      let data =JSON.parse(JSON.stringify(this.editConfig.infomation));
-      
+      let data = JSON.parse(JSON.stringify(this.editConfig.infomation))
+
       let params = {
-        address:data.address,
-        buyToResupply:data.buyToResupply,
-        code:data.code,
-        name:data.name,
-        inboundTransportation:data.inboundTransportation,
-        outboundTransportation:data.outboundTransportation,
+        address: data.address,
+        buyToResupply: data.buyToResupply,
+        code: data.code,
+        name: data.name,
+        inboundTransportation: data.inboundTransportation,
+        outboundTransportation: data.outboundTransportation
       }
-      if(data.id){
-        params.id=data.id
+      if (data.id) {
+        params.id = data.id
       }
-      return params;
+      return params
     },
     // 淇濆瓨
     saveClick(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
-          const params = this.saveParams();
-            if (this.editConfig.title === "鏂板缓") {
-              addWarehouse(params).then((res) => {
-                if (res.code === 200) {
-                  this.editConfig.visible = false;
-                  this.$message.success("娣诲姞鎴愬姛!");
-                  this.$emit('refresh')
-                }else {
-                    this.$message.warning(res.msg?res.msg:"娣诲姞澶辫触!")
-                }
-              });
-            } else {
-              updateWarehouse(params).then((res) => {
-                if (res.code === 200) {
-                  this.editConfig.visible = false;
-                  this.$message.success("缂栬緫鎴愬姛!");
-                  this.$emit('refresh')
-                }else {
-                    this.$message.warning(res.msg?res.msg:"缂栬緫澶辫触!")
-                }
-              });
-            }
-        }else {
-          console.log("error submit");
-          return false;
+          const params = this.saveParams()
+          if (this.editConfig.title === "鏂板缓") {
+            addWarehouse(params).then((res) => {
+              if (res.code === 200) {
+                this.editConfig.visible = false
+                this.$message.success("娣诲姞鎴愬姛!")
+                this.$emit("refresh")
+              } else {
+                this.$message.warning(res.msg ? res.msg : "娣诲姞澶辫触!")
+              }
+            })
+          } else {
+            updateWarehouse(params).then((res) => {
+              if (res.code === 200) {
+                this.editConfig.visible = false
+                this.$message.success("缂栬緫鎴愬姛!")
+                this.$emit("refresh")
+              } else {
+                this.$message.warning(res.msg ? res.msg : "缂栬緫澶辫触!")
+              }
+            })
+          }
+        } else {
+          console.log("error submit")
+          return false
         }
-      });
+      })
     }
   }
 }
@@ -264,29 +279,31 @@
 .content-status {
   display: flex;
 }
+.content-number-bg {
+  margin-top: 10px;
+}
 .basic-info {
   height: calc(100% - 80px);
   overflow: auto;
   margin: 20px;
-  border: 1px solid #dcdfe6;
-  box-shadow: inset 0 0 2px #dee2e6;
-  -moz-box-shadow: inset 0 0 2px #dee2e6;
-  -webkit-box-shadow: inset 0 0 2px #dee2e6;
-  .basic-info-view {
-    margin-top: 20px;
-    padding:0 20px;
+  // border: 1px solid #dcdfe6;
+  // box-shadow: inset 0 0 2px #dee2e6;
+  // -moz-box-shadow: inset 0 0 2px #dee2e6;
+  // -webkit-box-shadow: inset 0 0 2px #dee2e6;
+  // .basic-info-view {
+  //   margin-top: 20px;
+  //   padding: 0 20px;
+  // }
 
-  }
-  .bottom{
+  .bottom {
     .second-label {
       border-bottom: 1px solid #d9d9d9;
       margin-bottom: 10px;
     }
-    ::v-deep .el-tabs__content{
+    ::v-deep .el-tabs__content {
       padding: 0 20px;
     }
   }
-  
 }
 .purchase-view {
   display: flex;
@@ -309,8 +326,18 @@
       color: #333;
     }
   }
-  .el-tabs--card > .el-tabs__header .el-tabs__nav {
-    margin-left: 20px;
+  .el-tabs--card > .el-tabs__header {
+    border-bottom: none;
+  }
+  .el-tabs__item.is-active {
+    color: #fff;
+    background: #2a78fb;
+  }
+  .el-tabs__item {
+    height: 30px;
+    line-height: 30px;
+    font-size: 13px;
+    background: #f3f3f3;
   }
   .el-tabs__item {
     height: 30px;

--
Gitblit v1.8.0