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