|
@@ -18,13 +18,13 @@
|
|
|
:label-col="formItemLayout.labelCol"
|
|
|
:wrapper-col="formItemLayout.wrapperCol"
|
|
|
>
|
|
|
- <a-form-model-item label="商户名称" prop="linkageGroupName">
|
|
|
- <custList ref="custList" id="chainGroupStore-linkageGroupName" @change="custChange"></custList>
|
|
|
+ <a-form-model-item label="商户名称" prop="dealerSn">
|
|
|
+ <custList ref="custList" id="chainGroupStore-dealerSn" @change="custChange"></custList>
|
|
|
</a-form-model-item>
|
|
|
</a-form-model>
|
|
|
<div class="btn-cont">
|
|
|
<a-button type="primary" id="chainGroupStore-save" @click="handleSave">确认关联</a-button>
|
|
|
- <a-button id="chainGroupStore-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
|
|
|
+ <a-button id="chainGroupStore-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-modal>
|
|
@@ -40,17 +40,20 @@ export default {
|
|
|
openModal: { // 弹框显示状态
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ itemSn: {
|
|
|
+ type: [Number, String],
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
form: {
|
|
|
- dealerSn: '',
|
|
|
- linkageGroupSn: ''
|
|
|
+ dealerSn: ''
|
|
|
},
|
|
|
rules: {
|
|
|
- linkageGroupName: [
|
|
|
+ dealerSn: [
|
|
|
{ required: true, message: '请输入商户名称', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
@@ -63,26 +66,26 @@ export default {
|
|
|
methods: {
|
|
|
custChange (val) {
|
|
|
console.log('选中', val)
|
|
|
- this.form.linkageGroupName = val.key
|
|
|
+ this.form.dealerSn = val.key
|
|
|
},
|
|
|
// 保存
|
|
|
handleSave () {
|
|
|
- // const _this = this
|
|
|
- // _this.$refs.ruleForm.validate(valid => {
|
|
|
- // if (valid) {
|
|
|
- // const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
- // form.id = _this.itemId ? _this.itemId : null
|
|
|
- // linkageGroupSave(form).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // _this.$message.success(res.message)
|
|
|
- // _this.$emit('ok')
|
|
|
- // _this.isShow = false
|
|
|
- // }
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // })
|
|
|
+ const _this = this
|
|
|
+ _this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
+ form.linkageGroupSn = _this.itemSn
|
|
|
+ linkageGroupSave(form).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$emit('ok')
|
|
|
+ _this.isShow = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
watch: {
|