|
@@ -25,8 +25,28 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="绑定主商户" prop="platformType">
|
|
|
<el-checkbox-group v-model="setQuery.platformType">
|
|
|
- <el-checkbox label="1">慧研学惠生活</el-checkbox>
|
|
|
- <el-checkbox label="2" >印象贵大</el-checkbox>
|
|
|
+ <div class="flex" v-for="(item,index) in masterShopOptions" :key="index" ><el-checkbox :label="item.value">{{item.label}}</el-checkbox>
|
|
|
+ <el-form-item v-if="setQuery.platformType.includes(item.value)" :prop="'platformShareLists.' + index + '.shareId'" :rules="{required: true, message: '请选择分账规则', trigger: 'change'}">
|
|
|
+ <el-select
|
|
|
+ v-model="setQuery.platformShareLists[index].shareId"
|
|
|
+ class="item-width-300"
|
|
|
+ size="small"
|
|
|
+
|
|
|
+ placeholder="请选择商品分账规则"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in ruleOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <el-checkbox label="1">慧研学惠生活</el-checkbox>
|
|
|
+ <el-checkbox label="2" >印象贵大</el-checkbox> -->
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="商户名称:" prop="accountName">
|
|
@@ -96,10 +116,10 @@
|
|
|
:maxlength="11"
|
|
|
size="small"
|
|
|
class="item-width-300"
|
|
|
- :disabled="this.$route.query.id"
|
|
|
+ :disabled="!!this.$route.query.id"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="商品分账规则:" prop="shareId">
|
|
|
+ <!-- <el-form-item label="商品分账规则:" prop="shareId">
|
|
|
<el-select
|
|
|
v-model="setQuery.shareId"
|
|
|
class="item-width-300"
|
|
@@ -113,7 +133,7 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="备注:" prop="notes">
|
|
|
<el-input
|
|
|
v-model="setQuery.notes"
|
|
@@ -165,7 +185,8 @@ export default {
|
|
|
phoneNum: "",
|
|
|
province: "",
|
|
|
shareId:'',
|
|
|
- platformType:[]
|
|
|
+ platformType:[],
|
|
|
+ platformShareLists:[]
|
|
|
},
|
|
|
region:{
|
|
|
"code": "",
|
|
@@ -226,6 +247,9 @@ export default {
|
|
|
this.countyList = []
|
|
|
}
|
|
|
}),
|
|
|
+ // 'setQuery.platformType'(val) {
|
|
|
+ // console.log(123);
|
|
|
+ // }
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取地区数据
|
|
@@ -255,7 +279,22 @@ export default {
|
|
|
accountDetail({accountId}).then((res) => {
|
|
|
if (res.state == "Success") {
|
|
|
this.setQuery = res.content
|
|
|
- this.setQuery.platformType = this.setQuery.platformType.split(',')
|
|
|
+ this.$set(this.setQuery,'platformShareLists',[])
|
|
|
+ this.masterShopOptions.map(item=>{
|
|
|
+ this.setQuery.platformShareLists.push({
|
|
|
+ shareId:'',
|
|
|
+ platformType:item.value
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let platformShareLists = JSON.parse(this.setQuery.platformShares)
|
|
|
+ platformShareLists.map(item=>{
|
|
|
+ this.setQuery.platformShareLists.map(i=>{
|
|
|
+ if(item.platformType == i.platformType){
|
|
|
+ i.shareId = item.shareId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.setQuery.platformType = this.setQuery.platformType.split(',').map(Number)
|
|
|
|
|
|
setTimeout(() => {
|
|
|
this.isInit = false
|
|
@@ -286,6 +325,14 @@ export default {
|
|
|
if(this.$route.query.id){
|
|
|
delete obj.phoneNum
|
|
|
}
|
|
|
+ let platformShareLists = JSON.parse(JSON.stringify(obj.platformShareLists))
|
|
|
+ obj.platformShareLists = []
|
|
|
+ platformShareLists.map((item,index)=>{
|
|
|
+ if(item.shareId&&obj.platformType.includes(item.platformType)){
|
|
|
+ obj.platformShareLists.push(item)
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
obj.platformType = obj.platformType.toString()
|
|
|
|
|
|
addOrUpdateAccount(obj).then((res) => {
|
|
@@ -310,7 +357,8 @@ export default {
|
|
|
notes: "",
|
|
|
phoneNum: "",
|
|
|
province: "",
|
|
|
- platformType:[]
|
|
|
+ platformType:[],
|
|
|
+ platformShareLists:[]
|
|
|
};
|
|
|
this.$router.push("/merchantManage/index");
|
|
|
}
|
|
@@ -321,6 +369,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
+ this.setQuery.platformShareLists=[]
|
|
|
+ this.masterShopOptions.map(item=>{
|
|
|
+ this.setQuery.platformShareLists.push({
|
|
|
+ shareId:'',
|
|
|
+ platformType:item.value
|
|
|
+ })
|
|
|
+ })
|
|
|
this.getRuleList()
|
|
|
if(this.$route.query.title == '编辑商户'){
|
|
|
// this.setQuery = JSON.parse( sessionStorage.getItem('shopUser') )
|
|
@@ -335,6 +390,12 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.addUser {
|
|
|
padding-bottom: 40px;
|
|
|
+ .flex{
|
|
|
+ width: 500px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
.btn-group {
|
|
|
display: flex;
|
|
|
align-items: center;
|