提交 5308da59 编写于 作者: changdi.hao's avatar changdi.hao

Merge branch 'testing/3.19.0-after-sale' into 'release'

Testing/3.19.0 after sale

See merge request com.pica.cloud.education.frontend/pica.cloud.web-education-admin!334
import fetch from "../fetch";
import { getBaseUrl } from "@/utils/index";
let headers = {
"Content-Type": "application/json;charset=UTF-8",
token: localStorage.getItem("storageToken"),
};
/*获取省份*/
export const getProvinces = () => {
return fetch({
headers,
url: getBaseUrl(`/basic-data/position/provinces`),
method: "get",
});
};
// /*获取市*/
export const getCities = (params) => {
return fetch({
headers,
url: getBaseUrl(`/basic-data/position/cities`),
method: "get",
params: params,
});
};
// /*获取区*/
export const getCounties = (params) => {
return fetch({
url: getBaseUrl(`/basic-data/position/counties`),
method: "get",
params: params,
});
};
// /*获取乡镇*/
export const getTowns = (params) => {
return fetch({
url: getBaseUrl(`/basic-data/position/towns`),
method: "get",
params: params,
});
};
......@@ -137,3 +137,21 @@ export const getRefundDesc = (aid) => {
description: '退款说明',
})
};
export const getLgCompanyList = () => {
return fetch({
headers,
url: getBaseUrl(`/basic-data/constants/app/no-chars/P307`),
method: "get",
description: "获取物流公司",
});
};
export const getStoreAdressRepot = (storeId) => {
return fetch({
headers,
url: getBaseUrl(`store/query/${storeId}/repot`),
method: "get",
description: "获取店铺退货地址信息",
});
};
......@@ -76,6 +76,7 @@
</div>
</el-upload>
<p class="upload-message" v-if="!isgoodsImages">请上传商品头图</p>
<!-- <p class="upload-message" v-if="uploadImgMessage1">请上传商品头图</p> -->
</el-form-item>
<el-form-item label="商品类型" prop="goodsType">
<el-select
......@@ -92,7 +93,15 @@
></el-option>
</el-select>
</el-form-item>
<!-- <p class="upload-message" v-if="uploadImgMessage1">请上传商品头图</p> -->
<el-form-item label="是否支持售后" prop="expressLimitFlag" v-if="storeType < 3">
<el-radio-group v-model="formData.expressLimitFlag" :disabled="!hasRepoFlag">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
<p class="backTip" v-if="!hasRepoFlag" @click="goShopDeatil">若需设置商品支持售后,需先至店铺页<span class="ad-back">设置售后地址</span></p>
</el-form-item>
</div>
</el-form>
......@@ -860,8 +869,8 @@
import { openLoading, closeLoading } from "../../utils/utils";
import { doUpload, getFilePath } from "../../utils/qiniu-util";
import { updateGoods ,updateStock,dosageAll,getDeparts,getGoodsList, getGoodDetails, updateGoodsV2, getHospitalInfoByStoreId, getCheckPackageIdList, getTypeCodeList } from '@/utils/goods';
import { getStoreAdressRepot } from "@/utils/shop";
import Cropper from '@/components/common/cropper.vue'
import { originRules1, originRules2, originRules } from './rules';
import { originForm1, originForm2, originForm } from './forms';
......@@ -992,17 +1001,19 @@
limitVisibleFlag:false,
limit:{
title:"限购条件"
}
},
storeType: 1, //1: "供货商",2: "小药房",3: "医生小店"
hasRepoFlag: 0 //店铺是否有退货地址
}
},
created() {
vm = this;
const { id, storeId, goodsType, inputType, commissionFlag} = this.$route.query;
const { id, storeId, goodsType, inputType, commissionFlag, storeType} = this.$route.query;
this.goodsType = goodsType;
this.storeId = storeId;
this.inputType = inputType || '';
this.commissionFlag = commissionFlag;
this.storeType = storeType;
// this.formData = originForm;
// this.formData1 = originForm1;
// this.formData2 = originForm2;
......@@ -1011,7 +1022,7 @@
this.rules2 = originRules2;
// this.rules2.barCode = originRules.barCode;
this.jumPathThird = '/goods-manage?storeId=' + storeId +'&commissionFlag=' + this.commissionFlag;
this.jumPathThird = '/goods-manage?storeId=' + storeId +'&commissionFlag=' + this.commissionFlag +'&storeType=' + this.storeType;
//this.jumPathThird = '/create-good?id=add&storeId=46'
this.title = id == 'add' ? '新增商品' : '编辑商品';
this.isEdit = id != 'add';
......@@ -1034,6 +1045,8 @@
console.log(`getCheckPackageIdList`, res);
this.checkPackageIdList = res.data;
})
} else {
this.getStoreAdress();
}
// debugger;
// 判空
......@@ -1083,12 +1096,13 @@
});
};
const { goodsInfo, medicalService, buyLimitDtoList} = res.data;
const { goodsInfo, medicalService, buyLimitDtoList, hasRepoFlag} = res.data;
this.formData = {...this.formData, ...goodsInfo};
this.formData2 = medicalService;
this.formData = { ...this.formData, ...this.formData2 };
this.buyLimitDtoList = buyLimitDtoList;
this.hasRepoFlag = hasRepoFlag;
this.$set(this.formData2, 'suitableArr', this.formData.suitable.split(','));
this.$set(this.formData, 'suitableArr', this.formData.suitable.split(','));
this.formData.optPrice = this.formData.costPrice/100;
......@@ -1109,6 +1123,7 @@
goodsType :'',
pageNo:1,
pageSize: 10,
storeId: this.storeId
});
if(res.code != '000000'){
return this.$message({
......@@ -1122,9 +1137,10 @@
type: 'error'
});
}
const {goodsList} = res.data;
const {goodsList, hasRepoFlag } = res.data;
this.formData1 = goodsList[0];
this.formData = goodsList[0];
this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100;
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1);
......@@ -1506,7 +1522,8 @@
path: '/goods-manage',
query: {
storeId: this.formData.storeId,
commissionFlag: this.commissionFlag
commissionFlag: this.commissionFlag,
storeType: this.storeType
}
})
})
......@@ -1763,7 +1780,6 @@
}
}
},
checkCount(){
let flag = true;
if(this.formData.saleType == 1 && this.formData.mostCount == 0){
......@@ -1785,8 +1801,31 @@
}
return flag;
}
},
goShopDeatil() {
this.$router.push({
path: `/create-shop`,
query:{
storeId: this.storeId,
// storeData: JSON.stringify(row),
}
})
},
//店铺是否配置售后地址
getStoreAdress() {
getStoreAdressRepot(this.storeId).then(res => {
if (res.code == "000000") {
// repotList 地址数组
if(res.data && res.data.repotList && res.data.repotList.length) {
this.hasRepoFlag = true;
} else {
this.hasRepoFlag = false;
}
} else {
this.$message.error(res.message);
}
})
},
},
}
</script>
......@@ -1856,7 +1895,14 @@
font-size: 12px;
color: #f56c6c;
}
.backTip {
font-size: 12px;
color: red;
cursor: pointer;
}
.ad-back {
color: #449284;
}
.img-delete {
position: absolute;
left: 0px;
......
const form1 = {
categoryIdLevel2: '',
categoryIdLevel3: '',
categoryIdLevel4: '',
categoryIdLevel5: '',
medicCommonName:'',
medicGoodsName:'',
size:'',
dosageId:null,
usage:'',
otc1:'1',
approvalNumber:'',
manufacturer:'',
department:'',
expiredTime:'',
specification_url:'',
treatDisease:'',
barCode: '',
modelNo: '', // 型号
standardNo: '', // 执行标准号
}
categoryIdLevel2: "",
categoryIdLevel3: "",
categoryIdLevel4: "",
categoryIdLevel5: "",
medicCommonName: "",
medicGoodsName: "",
size: "",
dosageId: null,
usage: "",
otc1: "1",
approvalNumber: "",
manufacturer: "",
department: "",
expiredTime: "",
specification_url: "",
treatDisease: "",
barCode: "",
modelNo: "", // 型号
standardNo: "", // 执行标准号
};
const form2 = {
checkPackageId: '', // 检测登记表,暂无,先隐藏!!!!!!!!!!!
......@@ -48,24 +48,25 @@ const form = {
// specificationImages:[],
// goodsId: 0, // 新增时传0,更新时必需>0
id: 0,
goodsName:'',
goodsDescription:'',
goodsHeaderImages:[],
goodsType:'',
barCode: '',
costPrice:0,
decrStock:0,//减少库存
incrStock:'',//增加库存
storeId: '',
optPrice:'',
goodsStock:0,
goodsName: "",
goodsDescription: "",
goodsHeaderImages: [],
goodsType: "",
barCode: "",
costPrice: 0,
decrStock: 0, //减少库存
incrStock: "", //增加库存
storeId: "",
optPrice: "",
goodsStock: 0,
stock: 0,
externalGoodsCode: '',
leastCount:1,
externalGoodsCode: "",
leastCount: 1,
mostCount: -1,
incrType:1,
saleType:1,
minWhole:0
incrType: 1,
saleType: 1,
minWhole: 0,
expressLimitFlag: 0, //是否支持退货退款
};
......
......@@ -486,9 +486,10 @@
vm = this;
this.getLists()
this.getLever()
const {storeId,commissionFlag} = this.$route.query;
const {storeId,commissionFlag,storeType} = this.$route.query;
this.searchForm.storeId = Number(storeId) || 0;
this.commissionFlag = commissionFlag;
this.storeType = storeType;
// if(storeId){
// this.searchForm.storeId = storeId
// }
......@@ -691,12 +692,13 @@
}
},
edit(row){
const { goodsType } = row;
const { goodsType, storeType } = row;
// storeType 1: "供货商",2: "小药房",3: "医生小店"
let url = ''
if(row == 'add'){
url = `/create-good?id=add&storeId=${this.searchForm.storeId}&inputType=1&commissionFlag=${this.commissionFlag}`
url = `/create-good?id=add&storeId=${this.searchForm.storeId}&inputType=1&commissionFlag=${this.commissionFlag}&storeType=${this.storeType}`
}else{
url = `/create-good?id=${row.goodsId}&storeId=${this.searchForm.storeId}&goodsType=${goodsType}&commissionFlag=${this.commissionFlag}`
url = `/create-good?id=${row.goodsId}&storeId=${this.searchForm.storeId}&goodsType=${goodsType}&commissionFlag=${this.commissionFlag}&storeType=${storeType}`
}
// this.$store.dispatch('goodsManage/changeGoodsInfo', {...row});
this.$router.push({
......
......@@ -99,6 +99,9 @@ const rules = {
goodsType:[
{ required: true, message: "请选择商品类型", trigger: "change" }
],
hcd:[
{ required: true, message: "请选择是否支持退货退款", trigger: "change" }
],
optPrice: [
{ required: true, message: "请输入价格", trigger: "blur" },
],
......
此差异已折叠。
......@@ -386,7 +386,8 @@
path: '/goods-manage',
query: {
storeId: row.tradeStore.id,
commissionFlag:row.tradeStore.commissionFlag
commissionFlag:row.tradeStore.commissionFlag,
storeType:row.tradeStore.storeType // 1: "供货商",2: "小药房",3: "医生小店"
}
});
window.open(routeData.href, '_blank');
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册