修改问题。

feature_0521
kevin jiang 5 years ago
parent fed30b92d5
commit 1407638c6e

@ -25,16 +25,14 @@
type="primary" type="primary"
size="small" size="small"
style="border: 0px;color:#2074E2" style="border: 0px;color:#2074E2"
@click="open(1,row)" @click="open(1,row)">修改
>修改
</Button> </Button>
<Button <Button
ghost ghost
type="error" type="error"
size="small" size="small"
style="border: 0px" style="border: 0px"
@click="remove(row)" @click="remove(row)">删除</Button>
>删除</Button>
</template> </template>
</Table> </Table>
@ -288,7 +286,8 @@
name: val.name, name: val.name,
code: val.code, code: val.code,
detailName: val.detailName, detailName: val.detailName,
parentId: val.parentId parentId: val.parentId,
level: 2
}; };
that.btnLoading = true; that.btnLoading = true;
service.postOrganizationCompanyAdd(request, function (res) { service.postOrganizationCompanyAdd(request, function (res) {
@ -299,7 +298,7 @@
that.hide(); that.hide();
that.getData(); that.getData();
}else{ }else{
that.$Message.error("添加失败"); that.$Message.error(data.msg);
} }
}, function () { }, function () {
that.btnLoading = false; that.btnLoading = false;
@ -315,7 +314,8 @@
name: val.name, name: val.name,
code: val.code, code: val.code,
detailName: val.detailName, detailName: val.detailName,
parentId: val.parentId parentId: val.parentId,
level: 2
}; };
service.postOrganizationRegionModify(request, function (res) { service.postOrganizationRegionModify(request, function (res) {
that.btnLoading = false; that.btnLoading = false;
@ -325,7 +325,7 @@
that.hide(); that.hide();
that.getData(); that.getData();
}else{ }else{
that.$Message.error("修改失败"); that.$Message.error(data.msg);
} }
}, function () { }, function () {
that.btnLoading = false; that.btnLoading = false;

@ -286,7 +286,8 @@
let request = { let request = {
name: val.name, name: val.name,
code: val.code, code: val.code,
parentId: val.parentId parentId: val.parentId,
level: 3
}; };
that.btnLoading = true; that.btnLoading = true;
service.postOrganizationCustomerAdd(request, function (res) { service.postOrganizationCustomerAdd(request, function (res) {
@ -312,9 +313,10 @@
id: val.id, id: val.id,
name: val.name, name: val.name,
code: val.code, code: val.code,
parentId: val.parentId parentId: val.parentId,
level: 3
}; };
service.postOrganizationRegionModify(request, function (res) { service.postOrganizationCustomerModify(request, function (res) {
that.btnLoading = false; that.btnLoading = false;
let data = res.data; let data = res.data;
if(data.code === "0000"){ if(data.code === "0000"){
@ -322,7 +324,7 @@
that.hide(); that.hide();
that.getData(); that.getData();
}else{ }else{
that.$Message.error("修改失败"); that.$Message.error(data.msg);
} }
}, function () { }, function () {
that.btnLoading = false; that.btnLoading = false;

@ -220,7 +220,8 @@
addRegion: function (name) { addRegion: function (name) {
let that = this; let that = this;
let request = { let request = {
name: name name: name,
level: 1
}; };
that.btnLoading = true; that.btnLoading = true;
service.postOrganizationRegionAdd(request, function (res) { service.postOrganizationRegionAdd(request, function (res) {
@ -231,7 +232,7 @@
that.hide(); that.hide();
that.getData(); that.getData();
}else{ }else{
that.$Message.error("添加失败"); that.$Message.error(data.msg);
} }
}, function () { }, function () {
that.btnLoading = false; that.btnLoading = false;
@ -242,7 +243,8 @@
let that = this; let that = this;
let request = { let request = {
id: val.id, id: val.id,
name: val.name name: val.name,
level: 1
}; };
service.postOrganizationRegionModify(request, function (res) { service.postOrganizationRegionModify(request, function (res) {
that.btnLoading = false; that.btnLoading = false;
@ -252,7 +254,7 @@
that.hide(); that.hide();
that.getData(); that.getData();
}else{ }else{
that.$Message.error("修改失败"); that.$Message.error(data.msg);
} }
}, function () { }, function () {
that.btnLoading = false; that.btnLoading = false;

@ -149,6 +149,17 @@ export function postOrganizationStoreRemoveId(params, call, errorCallback) {
return http.post('/organization/store/remove/id', params).then(call).catch(errorCallback) return http.post('/organization/store/remove/id', params).then(call).catch(errorCallback)
} }
/**
* 修改组织 客户
* @param params 参数
* @param call 成功回调
* @param errorCallback 错误回调
* @returns {Promise<any>}
*/
export function postOrganizationCustomerModify(params, call, errorCallback) {
return http.post('/organization/customer/modify', params).then(call).catch(errorCallback)
}
export default { export default {
getOrganizationRegionList, getOrganizationRegionList,
postOrganizationRegionModify, postOrganizationRegionModify,
@ -162,5 +173,6 @@ export default {
postOrganizationStoreList, postOrganizationStoreList,
postOrganizationStoreAdd, postOrganizationStoreAdd,
postOrganizationStoreModify, postOrganizationStoreModify,
postOrganizationStoreRemoveId postOrganizationStoreRemoveId,
postOrganizationCustomerModify
} }

Loading…
Cancel
Save