提交 bf6cd3cc authored 作者: huaxinzhu's avatar huaxinzhu

1、运费,保存时候,金额字段*100处理;2、优化

上级 c452c3c5
......@@ -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 ----
......
......@@ -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 = "修改运费模板";
......
......@@ -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
},
},
};
......
......@@ -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;
......
......@@ -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();
}
......
......@@ -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 }) {
......
......@@ -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 {
......
......@@ -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>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论