Commit 88e71b23 by chenwq

编辑置灰

1 parent 23fba8d9
......@@ -41,6 +41,7 @@ export default {
},
editStatus: false,
editForm: {
shopMerchantId: '',
yqMerchantId: '',
merchantName: '',
contactName: '',
......@@ -49,6 +50,7 @@ export default {
productCodeList: []
},
editRule: {
shopMerchantId: [{ required: true, message: '请输入商户号', trigger: 'change' }],
yqMerchantId: [{ required: true, message: '请选择所属服务中心', trigger: 'change' }],
merchantName: [{ required: true, message: '请输入客户名称', trigger: 'change' }],
contactName: [{ required: true, message: '请输入联系人', trigger: 'change' }],
......@@ -68,13 +70,21 @@ export default {
isWatch: false,
editFormData: [
{
label: '商户号',
name: 'shopMerchantId',
type: 'input',
maxlength: 50,
isDisabled: true
},
{
label: '所属服务中心',
name: 'yqMerchantId',
type: 'select',
optionList: [],
optionId: 'yqMerchantId',
optionLabel: 'yqMerchantName',
optionsName: 'merchantList'
optionsName: 'merchantList',
isDisabled: false
},
{
label: '客户名称',
......@@ -134,11 +144,24 @@ export default {
this.routeInfo.editType != 'add' ? this.getInfo() : ''
this.userInfo = this.$globalState.session
this.isWatch = this.routeInfo.editType != 'add'
if (this.routeInfo.editType == 'edit') {
this.changeFormAttr('editFormData', 'isDisabled', ['所属服务中心'], true)
} else {
this.editRule.shopMerchantId[0].required = false
let id = this.editFormData.findIndex(item => item.name == 'shopMerchantId')
this.editFormData.splice(id, 1)
}
this.getServiceCenterList()
this.findProByScene()
},
methods: {
changeFormAttr(formName, attrName, labelList, attrValue) {
labelList.forEach(item => {
let idx = this[formName].findIndex(k => k.label == item)
this[formName][idx][attrName] = attrValue
})
},
getServiceCenterList() {
const params = {
partnerMerchantId: this.userInfo.merchantId
......@@ -160,7 +183,6 @@ export default {
getSceneProStatus() {
const params = { merchant4sId: this.routeInfo.merchantInfo.shopMerchantId }
this.$apis.customer.getSceneProStatus(params).then(res => {
console.log(res, '开通状态----')
let productCodeList = []
res.forEach(item => {
item.productList.forEach(k => {
......@@ -170,7 +192,6 @@ export default {
})
})
this.$set(this.editForm, 'productCodeList', productCodeList)
console.log(this.editForm.productCodeList)
this.$nextTick(() => {
this.editStatus = false
})
......@@ -184,7 +205,6 @@ export default {
oldMerchantName: this.routeInfo.merchantInfo.shopMerchantName || ''
}
this.$apis.customer.getMerchantInfo({ merchantId: this.routeInfo.merchantInfo.shopMerchantId }).then(res => {
console.log(res, 'res----')
this.editForm.provinceCode = res.provinceCode
this.editForm.provinceName = res.provinceName
this.editForm.cityCode = res.cityCode
......@@ -206,7 +226,6 @@ export default {
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds + item.subList.map(k => k.id).join(',')
})
this.editForm.merchantBrandIds = this.editForm.merchantBrandIds.split(',')
console.log(this.editForm, '--------------')
this.$refs.provinceForm && this.$refs.provinceForm.init(this.editForm)
this.$nextTick(() => {
this.editStatus = false
......@@ -224,7 +243,6 @@ export default {
return false
},
handleConfirm() {
console.log(this.editForm, 'this.editForm-------------')
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
......@@ -249,7 +267,6 @@ export default {
params.sceneList.push(item.sceneCode)
}
})
console.log(params)
const apiName = this.routeInfo.editType == 'edit' ? 'updateMerchant' : 'createMerchant'
this.$apis.customer[apiName](params).then(res => {
this.$message({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!