提交 ceb9f30d 编写于 作者: 张磊's avatar 张磊

save

上级 21e4abba
...@@ -641,4 +641,4 @@ export function setSelectedKeys(checkedKeys, halfCheckedKeys) { ...@@ -641,4 +641,4 @@ export function setSelectedKeys(checkedKeys, halfCheckedKeys) {
selected.push(obj); selected.push(obj);
} }
return selected; return selected;
} }
\ No newline at end of file
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
label-suffix=":" label-suffix=":"
class="basic-form" class="basic-form"
style="margin-top: 15px" style="margin-top: 15px"
:disabled="disabledFORM"
> >
<div> <div>
<el-tabs v-model="activeTabName" @tab-click="handleTabName"> <el-tabs v-model="activeTabName" @tab-click="handleTabName">
...@@ -358,12 +359,14 @@ ...@@ -358,12 +359,14 @@
class="required-label" class="required-label"
> >
<el-cascader <el-cascader
class="regionCascader"
ref="regionCascader"
style="width:35%" style="width:35%"
size="small" size="small"
:options="optionsRegion" :options="optionsRegion"
:props="propsRegion" :props="propsRegion"
@change="handleRegionChange" @change="handleRegionChange"
placeholder="请选择地区" :placeholder="orgRegionValueFirst"
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
...@@ -1198,6 +1201,7 @@ export default { ...@@ -1198,6 +1201,7 @@ export default {
} }
}; };
return { return {
disabledFORM: false,
controlLicense: [], controlLicense: [],
activeTabName:'first', activeTabName:'first',
curmbFirst: "云鹊店铺", curmbFirst: "云鹊店铺",
...@@ -1219,7 +1223,9 @@ export default { ...@@ -1219,7 +1223,9 @@ export default {
}, },
], ],
licenseDate: '', licenseDate: '',
orgRegionValueFirst: '请选择地区',
formData: { formData: {
orgRegionValue: [],
storeId: null, storeId: null,
userId: null, userId: null,
storeQualityUrl:"", storeQualityUrl:"",
...@@ -1489,7 +1495,7 @@ export default { ...@@ -1489,7 +1495,7 @@ export default {
} }
}, },
orgLIST: [], orgLIST: [],
orgScopeLIST:[] orgScopeLIST:[],
}; };
}, },
computed: { computed: {
...@@ -1498,13 +1504,15 @@ export default { ...@@ -1498,13 +1504,15 @@ export default {
"formData.certifyReq.bizScope": { "formData.certifyReq.bizScope": {
handler(val) { handler(val) {
const j = []; const j = [];
val.map( i => { if(val) {
if( i[0].includes('first') ){ val.map( i => {
const m = i[0].charAt(0); if( i[0].includes('first') ){
j.includes(m) || j.push(m); const m = i[0].charAt(0);
} j.includes(m) || j.push(m);
}) }
this.controlLicense = j; })
this.controlLicense = j;
}
}, },
deep: true, deep: true,
}, },
...@@ -1512,22 +1520,40 @@ export default { ...@@ -1512,22 +1520,40 @@ export default {
created() { created() {
vm = this; vm = this;
this.activeTabName = this.$route.query.currentTab || 'first'; this.activeTabName = this.$route.query.currentTab || 'first';
this.formData.storeId = this.$route.query.storeId || null; this.disabledFORM = this.$route.query.disabled == 'false' ? false : true;
this.getProvincesList();
vm.getRegionOption();
this.getCompanyList(); this.getCompanyList();
this.orgOptionList(); this.initDataLoading();
if (this.formData.storeId) {
this.curmbSecond = "编辑店铺";
this.isDisabled = true;
this.initInfo();
this.getDetail();
} else {
this.curmbSecond = "新建店铺";
this.isDisabled = false;
}
}, },
methods: { methods: {
async initDataLoading () {
const q = await this.getProvincesList();
const w = await this.getRegionOption();
const e = await this.orgOptionList();
if(q && w && e){
const storeId = this.$route.query.storeId || null;
const s = storejs.get('store_info');
if (storeId) {
this.curmbSecond = "编辑店铺";
this.isDisabled = true;
if(s && s.storeId == storeId){
this.formData = s;
const {orgRegionValue} = s;
const v = orgRegionValue.map(i => {return i.label;}).join('/');
this.orgRegionValueFirst = v;
}else{
this.formData.storeId = storeId;
storejs.remove('store_info');
this.initInfo();
this.getDetail();
}
} else {
storejs.remove('store_info');
this.curmbSecond = "新建店铺";
this.isDisabled = false;
}
}
},
getDetail() { getDetail() {
getStoreAdressRepot(this.formData.storeId).then(res => { getStoreAdressRepot(this.formData.storeId).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
...@@ -1549,7 +1575,6 @@ export default { ...@@ -1549,7 +1575,6 @@ export default {
storePhone, storePhone,
storeQualityUrl storeQualityUrl
} = this.storeData.tradeStore; } = this.storeData.tradeStore;
console.log('---this.storeData.tradeStore', this.storeData.tradeStore, storeType);
this.formData.storeLogo = storeLogo; this.formData.storeLogo = storeLogo;
this.formData.storeName = storeName; this.formData.storeName = storeName;
this.formData.storeQualityUrl=storeQualityUrl; this.formData.storeQualityUrl=storeQualityUrl;
...@@ -1630,13 +1655,7 @@ export default { ...@@ -1630,13 +1655,7 @@ export default {
queryStore(req).then((res) => { queryStore(req).then((res) => {
if (res.code == "000000") { if (res.code == "000000") {
this.storeData = res.data.tradeStore[0]; this.storeData = res.data.tradeStore[0];
const s = storejs.get('store_info'); this.getStoreInfo();
if(s){
this.formData = s;
console.log('--this.formData', this.formData);
}else{
this.getStoreInfo();
}
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
...@@ -1794,7 +1813,6 @@ export default { ...@@ -1794,7 +1813,6 @@ export default {
submitForm() { submitForm() {
let formName = "formData"; let formName = "formData";
let submitFlag = false; let submitFlag = false;
console.log('-this.formData', this.formData);
if (!this.formData.storeLogo) { if (!this.formData.storeLogo) {
this.uploadImgMessage1 = true; this.uploadImgMessage1 = true;
return; return;
...@@ -2269,13 +2287,57 @@ export default { ...@@ -2269,13 +2287,57 @@ export default {
}, },
//获取省列表 //获取省列表
getProvincesList() { getProvincesList() {
getProvinces() return new Promise((resolve) => {
.then((res) => { getProvinces().then((res) => {
if (res.code == "000000") { if (res.code == "000000") {
this.provincesList = res.data.provinceList; this.provincesList = res.data.provinceList;
resolve(true);
} }
}) })
.catch({}); })
},
//获取地区
getRegionOption() {
return new Promise((resolve) => {
let req = {};
vm.GET("basic-data/position/provinces", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
const p = operationData.setRegionOption2(res.data.provinceList);
p.map(i => {
if(i.id == 0) {
i.disabled = true
}
});
vm.optionsRegion = p;
resolve(true);
}
});
})
},
orgOptionList () {
return new Promise((resolve) => {
orgOptionList().then(res => {
if(res.code == '000000') {
this.orgLIST = res.data;
}
});
orgScopeOptionList().then( res => {
if(res.code == '000000') {
const m = [
{id: '1_first', name: '药品', list: []},
{id: '2_first', name: '医疗器械', list: []},
{id: '3_first', name: '食品', list: []},
{id: '4_first', name: '其他', list: []},
];
m.map(item => {
item.list = res.data.filter(v => v.type == item.id.charAt(0) );
});
this.orgScopeLIST = m;
}
});
resolve(true);
})
}, },
//获取市列表 //获取市列表
getCitiesList() { getCitiesList() {
...@@ -2407,28 +2469,25 @@ export default { ...@@ -2407,28 +2469,25 @@ export default {
}, },
handleTabName() { handleTabName() {
storejs.set('store_info', this.formData); storejs.set('store_info', this.formData);
vm.$router.push({ path: "create-shop", query: {currentTab: this.activeTabName, storeId: this.formData.storeId}}); vm.$router.push({ path: "create-shop", query: {currentTab: this.activeTabName, storeId: this.formData.storeId,disabled: this.disabledFORM}});
}, },
nextStepFirst(v) { nextStepFirst(v) {
storejs.set('store_info', this.formData); storejs.set('store_info', this.formData);
this.activeTabName = v; this.activeTabName = v;
vm.$router.push({ path: "create-shop", query: {currentTab: this.activeTabName, storeId: this.formData.storeId}}); vm.$router.push({ path: "create-shop", query: {currentTab: this.activeTabName, storeId: this.formData.storeId,disabled: this.disabledFORM}});
}, },
handleRegionChange(v) { handleRegionChange(v) {
console.log(v); const checkedNodes = this.$refs['regionCascader'].getCheckedNodes()[0];
}, const n = [];
//获取地区 checkedNodes.pathNodes.map(i => {
getRegionOption() { n.push({label: i.label, value: i.value});
let req = {};
openLoading(vm);
vm.GET("basic-data/position/provinces", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.optionsRegion = operationData.setRegionOption2(
res.data.provinceList
);
}
}); });
// countyId provinceId townId cityId
this.formData.orgRegionValue = n;
this.formData.certifyReq.provinceId = v[0] || '';
this.formData.certifyReq.cityId = v[1] || '';
this.formData.certifyReq.countyId = v[2] || '';
this.formData.certifyReq.townId = v[3] || '';
}, },
setMoreOption(data, type) { setMoreOption(data, type) {
let option = []; let option = [];
...@@ -2494,31 +2553,10 @@ export default { ...@@ -2494,31 +2553,10 @@ export default {
}) })
return [...m.values()]; return [...m.values()];
}, },
orgOptionList () {
orgOptionList().then(res => {
if(res.code == '000000') {
this.orgLIST = res.data;
}
});
orgScopeOptionList().then( res => {
if(res.code == '000000') {
const m = [
{id: '1_first', name: '药品', list: []},
{id: '2_first', name: '医疗器械', list: []},
{id: '3_first', name: '食品', list: []},
{id: '4_first', name: '其他', list: []},
];
m.map(item => {
item.list = res.data.filter(v => v.type == item.id.charAt(0) );
});
this.orgScopeLIST = m;
}
});
},
certifyValidDtoList (v) { certifyValidDtoList (v) {
const l = vm.formData.certifyValidDtoList || []; const l = vm.formData.certifyValidDtoList || [];
return l.filter(i => {return i.infoType == v;})[0] || ''; return l.filter(i => {return i.infoType == v;})[0] || '';
} },
}, },
filters: { filters: {
verifyStatus: function(value){ verifyStatus: function(value){
...@@ -2752,5 +2790,10 @@ export default { ...@@ -2752,5 +2790,10 @@ export default {
.red{ .red{
color: #FF4B33; color: #FF4B33;
} }
.regionCascader{
input::-webkit-input-placeholder{
color: #606266;
}
}
} }
</style> </style>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<div> <div>
<el-button v-if="scope.row.tradeStore.commissionFlag == 2" @click="setPrice(scope.row, false)" type="text" size="small">设置分佣</el-button> <el-button v-if="scope.row.tradeStore.commissionFlag == 2" @click="setPrice(scope.row, false)" type="text" size="small">设置分佣</el-button>
<el-button v-if="scope.row.tradeStore.storeStatus <= 2" @click="editShop(scope.row)" type="text" size="small">{{scope.row.tradeStore.storeStatus <= 2 ? '查看' : ''}}</el-button> <el-button v-if="scope.row.tradeStore.storeStatus <= 2" @click="editShop(scope.row)" type="text" size="small">{{scope.row.tradeStore.storeStatus <= 2 ? '查看' : ''}}</el-button>
<el-button @click="editShop(scope.row)" type="text" size="small">编辑</el-button> <el-button @click="editShop(scope.row, 'false')" type="text" size="small">编辑</el-button>
<el-button @click="shopManage(scope.row)" type="text" size="small">商品管理</el-button> <el-button @click="shopManage(scope.row)" type="text" size="small">商品管理</el-button>
<el-button @click="orderManage(scope.row)" type="text" size="small">订单管理</el-button> <el-button @click="orderManage(scope.row)" type="text" size="small">订单管理</el-button>
<el-button v-if="scope.row.tradeStore.commissionFlag == 2" @click="setFreight(scope.row)" type="text" size="small">运费配置</el-button> <el-button v-if="scope.row.tradeStore.commissionFlag == 2" @click="setFreight(scope.row)" type="text" size="small">运费配置</el-button>
...@@ -438,15 +438,9 @@ ...@@ -438,15 +438,9 @@
window.open(routeData.href, '_blank'); window.open(routeData.href, '_blank');
}, },
//编辑 //编辑
editShop(row) { editShop(row, disabled) {
const l = `${location.origin}#/create-shop?storeId=${row.tradeStore.id}`; let l = `${location.origin}#/create-shop?storeId=${row.tradeStore.id}&disabled=${disabled}`;
window.open(l); window.open(l);
// this.$router.push({
// path: `/create-shop`,
// query:{
// storeId: row.tradeStore.id,
// }
// })
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.searchForm.pageSize = val; this.searchForm.pageSize = val;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册