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

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

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