From bf6cd3cc53c8f57b5c01585f640a34b8849a44b1 Mon Sep 17 00:00:00 2001
From: huaxinzhu <15565133664@163.com>
Date: Fri, 30 Apr 2021 14:25:32 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=BF=90=E8=B4=B9=EF=BC=8C=E4=BF=9D?=
 =?UTF-8?q?=E5=AD=98=E6=97=B6=E5=80=99=EF=BC=8C=E9=87=91=E9=A2=9D=E5=AD=97?=
 =?UTF-8?q?=E6=AE=B5*100=E5=A4=84=E7=90=86=EF=BC=9B2=E3=80=81=E4=BC=98?=
 =?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/utils/request.js                          |  6 ++--
 .../system/freight/freight_list/index.vue     |  1 +
 .../system/freight/freight_list/indexbtn.vue  | 13 +++------
 .../system/goods/add/components/goodsimg.vue  | 11 +++++--
 .../goods/add/components/goodsinfomation.vue  | 29 ++-----------------
 .../system/goods/add/components/guide.vue     | 11 -------
 src/views/system/goods/add/index.vue          | 21 ++------------
 src/views/system/goods/offsale/index.vue      |  6 +++-
 8 files changed, 27 insertions(+), 71 deletions(-)

diff --git a/src/utils/request.js b/src/utils/request.js
index 6d8d118..7ea4944 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -19,7 +19,7 @@ service.interceptors.request.use(config => {
   if (getToken() && !isToken) {
     config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
   }
-  //config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5NzQ4NzcxLCJpc3MiOiJnaW4tYmxvZyJ9.sAefBY0yvwxkQN3f6VjiYZellZasfLs7oRLGFi83BBA'
+  //config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4'
   return config
 }, error => {
   console.log("25reject");
@@ -42,7 +42,7 @@ service.interceptors.response.use(res => {
         if( message ) {
           Message({message: message, type: 'error'});
         }else {
-          Message({message: '后台数据出错了!', type: 'error'});
+          Message({message: '后台数据出错啦!', type: 'error'});
         }
         return Promise.reject('error');
       }
@@ -103,7 +103,7 @@ service.interceptors.response.use(res => {
       message: message,
       type: "error"
     });
-    console.log(message);
+    // console.log(message);
     // --- end ---- 开发时候用这段,把错误彻底抛出来 --- end ---
 
     // --- start --- 正式上线,隐藏报错信息 ----- start ----
diff --git a/src/views/system/freight/freight_list/index.vue b/src/views/system/freight/freight_list/index.vue
index acc9677..68495c8 100644
--- a/src/views/system/freight/freight_list/index.vue
+++ b/src/views/system/freight/freight_list/index.vue
@@ -272,6 +272,7 @@
         getFreight(id).then(response => {
           let formdate = response.data
           response.data.Dispatching = JSON.parse(formdate.Dispatching)
+          console.log("点击修改获取的数据:",response.data.Dispatching);
           this.form = response.data
           this.isOpen = true;
           this.title = "修改运费模板";
diff --git a/src/views/system/freight/freight_list/indexbtn.vue b/src/views/system/freight/freight_list/indexbtn.vue
index 4118c61..e4209bb 100644
--- a/src/views/system/freight/freight_list/indexbtn.vue
+++ b/src/views/system/freight/freight_list/indexbtn.vue
@@ -267,20 +267,18 @@ export default {
       this.dialogVisible = true;
     },
     handleinfomationclick() {//提交
-      //debugger;
-
       this.goodsDate.Dispatching.forEach(item=>{
-        item.np = Number(item.np*100).toFixed()
+        item.fp= Number(item.fp*100).toFixed();
+        item.np = Number(item.np*100).toFixed();
       })
 
-      //console.log("提交前的数据:",this.goodsDate);
+      console.log("提交前的数据:",this.goodsDate);
       addFreight(this.goodsDate).then(response => {
-        console.log(296,response);
+        //console.log(296,response);
         if(response.data.code === 1) {
           this.$message({ message: '新增成功!', type: 'success'});
           this.$emit("closeIndexbtn",false);
         }
-
         this.loading = false;
       });
     },
@@ -301,13 +299,10 @@ export default {
     },
     deletearrinput(index) {
       //删除
-
       this.goodsDate.Dispatching.splice(index, 1);
     },
     info() {
-
       this.goodsDate = this.option
-
     },
   },
 };
diff --git a/src/views/system/goods/add/components/goodsimg.vue b/src/views/system/goods/add/components/goodsimg.vue
index c0c6250..7305a34 100644
--- a/src/views/system/goods/add/components/goodsimg.vue
+++ b/src/views/system/goods/add/components/goodsimg.vue
@@ -43,7 +43,7 @@
       </el-dialog>
     </div>
     <div>
-      <el-button style="margin: 20px 0;">重置</el-button>
+      <el-button style="margin: 20px 0;" @click="resetGoodsImgForm">重置</el-button>
     </div>
   </div>
 </template>
@@ -262,8 +262,9 @@
       },
 
       // 轮播图 删除前
-      beforeRemoveCarouselImg(file) {
-        console.log("轮播图删除前方法", file);
+      beforeRemoveCarouselImg(file,fileList) {
+        console.log("轮播图删除前66", file);
+        console.log("轮播图删除前77", fileList);
         if(file.status === 'success') {
           return new Promise((res, rej) => {
             this.$confirm(`是否删除此图片`, '提示', {
@@ -307,6 +308,10 @@
 
         this.$emit('imgclicks', pic)
       },
+      // 重置
+      resetGoodsImgForm(form) {
+
+      },
 
       // removeAaary(_arr, _obj) {
       //   var length = _arr.length;
diff --git a/src/views/system/goods/add/components/goodsinfomation.vue b/src/views/system/goods/add/components/goodsinfomation.vue
index fbba4fd..0352ae8 100644
--- a/src/views/system/goods/add/components/goodsinfomation.vue
+++ b/src/views/system/goods/add/components/goodsinfomation.vue
@@ -91,15 +91,11 @@
           <el-form-item label="三方编号" prop="outGoodsId">
             <el-input v-model="ruleForm.outGoodsId" style="width:400px;"></el-input>
           </el-form-item>
-          <el-form-item label="附加运费" prop="" v-if="ruleForm.resource==0">
+          <el-form-item label="附加运费" prop="pywlPrice" v-if="ruleForm.resource==0">
             <el-input v-model="ruleForm.pywlPrice" style="width:400px;" placeholder="偏远地区六省"></el-input> 元
           </el-form-item>
         </el-col>
       </el-row>
-
-
-
-
       <el-form-item label="商品备注" prop="mark">
         <el-input type="textarea" v-model="ruleForm.mark"></el-input>
       </el-form-item>
@@ -113,7 +109,7 @@
       </el-form-item>
       <el-form-item>
 <!--        <el-button type="primary" @click="handleinfomationclick('ruleForm')">下一步</el-button>-->
-        <el-button @click="resetForm('ruleForm')">重置</el-button>
+        <el-button @click="resetGoodsInfForm('ruleForm')">重置</el-button>
       </el-form-item>
     </el-form>
 
@@ -174,7 +170,6 @@
           mark: '',
           serviceagsTags: [],
           description: ''
-
         },
         rules: {
           goodsName: [{
@@ -299,20 +294,16 @@
     mounted() {
       this.getCategory();
       this.getFreight();
-
     },
     methods: {
       getCategory() {
-        console.log("12wer")
         GetCategory({}).then(response => {
-          // console.log("类目",response.data.data)
           this.options = response.data.data
         });
       },
       getFreight() {
         GetFreight(this.queryParams).then(response => {
           this.freightList = response.data
-          console.log(response.data, 'd')
         });
       },
       handleChange(value) {
@@ -337,7 +328,6 @@
             treeData.push(child);
           }
         });
-
         return treeData;
       },
       onEditorChange({
@@ -348,20 +338,7 @@
         this.content = html;
       },
 
-      handleinfomationclick(formName) {
-        // console.log(this.infomationdatas,'3')
-        // console.log("this.serviceagsTags",this.serviceagsTags)
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
-            // alert('submit!');
-            this.$emit('infomationclick', this.ruleForm)
-          } else {
-            console.log('error submit!!');
-            return false;
-          }
-        });
-      },
-      resetForm(formName) {
+      resetGoodsInfForm(formName) {
         this.$refs[formName].resetFields();
       }
 
diff --git a/src/views/system/goods/add/components/guide.vue b/src/views/system/goods/add/components/guide.vue
index ebaeb73..19ca9eb 100644
--- a/src/views/system/goods/add/components/guide.vue
+++ b/src/views/system/goods/add/components/guide.vue
@@ -322,7 +322,6 @@ export default {
     },
   guidedata(curVal,oldVal){
     if(curVal){
-      // console.log("curVal",curVal)
       if(curVal.goodsSpec){
         this.checked = true
       }
@@ -366,7 +365,6 @@ export default {
             }
           })
           })
-          // console.log(specValue)
           specOption.forEach(item=>{
             let goodsarr = item.specValueIds.split('_')
               goodsarr.forEach(itemchild=>{
@@ -378,7 +376,6 @@ export default {
 
               })
           })
-        // console.log(specOption,999999)
         this.tableData7 = specOption
         this.getSpanArr(this.tableData7);
         },
@@ -443,7 +440,6 @@ export default {
       this.tableData7.forEach((element, index) => {
         this.tableData7[index].goodsNowStock = this.goodsNowStock;
       });
-      // console.log(this.tableData7);
     },
     //删除规格项
     deleteinput(index, indexs) {
@@ -486,7 +482,6 @@ export default {
     inputimg() {
       let file = document.getElementById(this.imgname).files[0];
       //  let formdata=new FormData()
-      console.log(file)
       if (file.size > 1024 * 1024 * 3) {
         return false;
       } else {
@@ -510,12 +505,10 @@ export default {
 
 
        this.getBase64(file).then((res) => {
-         // console.log(res)
          var result = res.split(",");
          let Base64img = result[1];
          let data = {"image": Base64img}
          UploadImg(data).then((res) => {
-           console.log("上传图片返回",res)
            if (res.data.code == 1) {
              this.shopType[this.indeximg].specValue[this.indexsimg].img =
                res.data.data.imageUrl
@@ -589,7 +582,6 @@ export default {
         }
         this.newData.push(newlist);
       }
-      console.log(this.newData);
       this.getList();
     },
     //转换数据
@@ -600,7 +592,6 @@ export default {
       for (let i = 0; i < this.shopTypes.length; i++) {
         this.tablearr.push(this.shopTypes[i].specName);
       }
-      console.log(listobj);
       for (let index = 0; index < this.newList.length; index++) {
         // this.tableData7.push({
         //   color: this.newList[index][0],
@@ -628,7 +619,6 @@ export default {
         this.tableData7.push(listobj);
       }
       this.getSpanArr(this.tableData7);
-      console.log(this.tableData7);
       let arrlist = JSON.stringify(this.tableData7); //可以将json对象转换成json对符串
       let listarr = JSON.parse(arrlist); //可以将json字符串转换成json对象
       this.processguidelist(listarr);
@@ -678,7 +668,6 @@ export default {
       //     }
       //   }
       // }
-      console.log(this.spanArrS);
     },
     // 合并行数
     objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
diff --git a/src/views/system/goods/add/index.vue b/src/views/system/goods/add/index.vue
index 71ce164..4fc5001 100644
--- a/src/views/system/goods/add/index.vue
+++ b/src/views/system/goods/add/index.vue
@@ -36,6 +36,8 @@
     name: 'goods',
     data() {
       return {
+        infomationdata: {},
+        parameterdata: {},
         goodsOnsale: 0,
         loading: false,
         title: "添加新商品",
@@ -69,7 +71,6 @@
       genGoodsInfo(goodsId) {
         const goods_id = goodsId
         getGoods(goods_id).then(response => {
-          console.log("商品详情", response.data.data)
           this.goodsOnsale = response.data.data.isOnsale;
             this.infomationdata = {
               goodsId: response.data.data.goodsId,
@@ -115,8 +116,6 @@
       },
       //商品图片
       imgclick(type) {
-        type.ruleFormdialogImageUrlplus //主图
-        type.ruleFormdialogImageUrl //多图
         let img = []
         type.ruleFormdialogImageUrl.forEach((res, index) => {
           img.push(res.url)
@@ -137,27 +136,13 @@
       /** 确定按钮 */
       submitForm() {
         this.loading = true;
-        //-------------------------
-        if (this.goodsOnsale) {
-          var redUrl = '/system/goods/onsale'
-        } else {
-          var redUrl = '/system/goods/offsale'
-        }
-        this.$router.push({
-          path: redUrl
-        });
-
-        this.loading = false;
-        return;
-
-
-        //------------------------
         addGoods(this.params).then(response => {
           if (response.data.code == 1) {
             this.$message({
               message: response.data.msg,
               type: 'success'
             });
+            this.$emit('closeDialog',false);
             if (this.goodsOnsale) {
               var redUrl = '/system/goods/onsale'
             } else {
diff --git a/src/views/system/goods/offsale/index.vue b/src/views/system/goods/offsale/index.vue
index 67f7ee0..51c730c 100644
--- a/src/views/system/goods/offsale/index.vue
+++ b/src/views/system/goods/offsale/index.vue
@@ -97,7 +97,7 @@
       />
       <!-- 添加或修改goods对话框 -->
       <el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
-        <IndexBtn :option="form"/>
+        <IndexBtn :option="form" @closeDialog="closeDialog"/>
       </el-dialog>
     </el-card>
   </div>
@@ -272,6 +272,10 @@
         }).catch(function () {
         });
       },
+      // 子组件关闭父组件对话框
+      closeDialog(params) {
+        this.open = params;
+      }
     } //methods结束
   };
 </script>
-- 
2.18.1