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