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

save

上级 21e4abba
......@@ -33,6 +33,7 @@
label-suffix=":"
class="basic-form"
style="margin-top: 15px"
:disabled="disabledFORM"
>
<div>
<el-tabs v-model="activeTabName" @tab-click="handleTabName">
......@@ -358,12 +359,14 @@
class="required-label"
>
<el-cascader
class="regionCascader"
ref="regionCascader"
style="width:35%"
size="small"
:options="optionsRegion"
:props="propsRegion"
@change="handleRegionChange"
placeholder="请选择地区"
:placeholder="orgRegionValueFirst"
></el-cascader>
</el-form-item>
<el-form-item
......@@ -1198,6 +1201,7 @@ export default {
}
};
return {
disabledFORM: false,
controlLicense: [],
activeTabName:'first',
curmbFirst: "云鹊店铺",
......@@ -1219,7 +1223,9 @@ export default {
},
],
licenseDate: '',
orgRegionValueFirst: '请选择地区',
formData: {
orgRegionValue: [],
storeId: null,
userId: null,
storeQualityUrl:"",
......@@ -1489,7 +1495,7 @@ export default {
}
},
orgLIST: [],
orgScopeLIST:[]
orgScopeLIST:[],
};
},
computed: {
......@@ -1498,6 +1504,7 @@ export default {
"formData.certifyReq.bizScope": {
handler(val) {
const j = [];
if(val) {
val.map( i => {
if( i[0].includes('first') ){
const m = i[0].charAt(0);
......@@ -1505,6 +1512,7 @@ export default {
}
})
this.controlLicense = j;
}
},
deep: true,
},
......@@ -1512,22 +1520,40 @@ export default {
created() {
vm = this;
this.activeTabName = this.$route.query.currentTab || 'first';
this.formData.storeId = this.$route.query.storeId || null;
this.getProvincesList();
vm.getRegionOption();
this.disabledFORM = this.$route.query.disabled == 'false' ? false : true;
this.getCompanyList();
this.orgOptionList();
if (this.formData.storeId) {
this.initDataLoading();
},
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;
}
}
},
methods: {
getDetail() {
getStoreAdressRepot(this.formData.storeId).then(res => {
if (res.code == "000000") {
......@@ -1549,7 +1575,6 @@ export default {
storePhone,
storeQualityUrl
} = this.storeData.tradeStore;
console.log('---this.storeData.tradeStore', this.storeData.tradeStore, storeType);
this.formData.storeLogo = storeLogo;
this.formData.storeName = storeName;
this.formData.storeQualityUrl=storeQualityUrl;
......@@ -1630,13 +1655,7 @@ export default {
queryStore(req).then((res) => {
if (res.code == "000000") {
this.storeData = res.data.tradeStore[0];
const s = storejs.get('store_info');
if(s){
this.formData = s;
console.log('--this.formData', this.formData);
}else{
this.getStoreInfo();
}
} else {
this.$message.error(res.message);
}
......@@ -1794,7 +1813,6 @@ export default {
submitForm() {
let formName = "formData";
let submitFlag = false;
console.log('-this.formData', this.formData);
if (!this.formData.storeLogo) {
this.uploadImgMessage1 = true;
return;
......@@ -2269,13 +2287,57 @@ export default {
},
//获取省列表
getProvincesList() {
getProvinces()
.then((res) => {
return new Promise((resolve) => {
getProvinces().then((res) => {
if (res.code == "000000") {
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() {
......@@ -2407,28 +2469,25 @@ export default {
},
handleTabName() {
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) {
storejs.set('store_info', this.formData);
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) {
console.log(v);
},
//获取地区
getRegionOption() {
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
);
}
const checkedNodes = this.$refs['regionCascader'].getCheckedNodes()[0];
const n = [];
checkedNodes.pathNodes.map(i => {
n.push({label: i.label, value: i.value});
});
// 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) {
let option = [];
......@@ -2494,31 +2553,10 @@ export default {
})
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) {
const l = vm.formData.certifyValidDtoList || [];
return l.filter(i => {return i.infoType == v;})[0] || '';
}
},
},
filters: {
verifyStatus: function(value){
......@@ -2752,5 +2790,10 @@ export default {
.red{
color: #FF4B33;
}
.regionCascader{
input::-webkit-input-placeholder{
color: #606266;
}
}
}
</style>
......@@ -168,7 +168,7 @@
<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.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="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>
......@@ -438,15 +438,9 @@
window.open(routeData.href, '_blank');
},
//编辑
editShop(row) {
const l = `${location.origin}#/create-shop?storeId=${row.tradeStore.id}`;
editShop(row, disabled) {
let l = `${location.origin}#/create-shop?storeId=${row.tradeStore.id}&disabled=${disabled}`;
window.open(l);
// this.$router.push({
// path: `/create-shop`,
// query:{
// storeId: row.tradeStore.id,
// }
// })
},
handleSizeChange(val) {
this.searchForm.pageSize = val;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册