13176889840 5 years ago
parent
commit
90d0da69fe
  1. 10
      epmet-oper-web/public/index.html
  2. 9
      epmet-oper-web/src/js/ajax.js
  3. 22
      epmet-oper-web/src/js/columns/miniPro/partnerApp.js
  4. 8
      epmet-oper-web/src/views/modules/customer/init/RegisterList.vue
  5. 98
      epmet-oper-web/src/views/modules/partner/app/edit.vue

10
epmet-oper-web/public/index.html

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" /> <link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" />
@ -61,9 +62,10 @@
window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>

9
epmet-oper-web/src/js/ajax.js

@ -179,15 +179,16 @@ export default {
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data
if (data.sysresultcode === 'success') { if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === 'function') {
cb_su(data.data, data.rspMsg) cb_su(data.data, data.msg + ":" + data.internalMsg)
} }
} else if (data.sysresultcode === 'fail') { } else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg, data.data) if (typeof cb_err === 'function') cb_err(data.msg + ":" + data.internalMsg, data.data)
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === 'function') cb_err(res)

22
epmet-oper-web/src/js/columns/miniPro/partnerApp.js

@ -5,29 +5,37 @@ export default [{
fixed: false, fixed: false,
block: true, block: true,
width: 100 width: 100
}, },
{ {
key: 'appName', key: 'appName',
title: '应用名称', title: '应用名称',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 100 width: 100
}, },
{ {
key: 'customerName', key: 'customerName',
title: '所属客户', title: '所属客户',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 100 width: 100
}, },
{ {
key: 'customerTypeName',
title: '客户类型',
display: ['formA', 'formU', 'table', 'model'],
fixed: false,
block: true,
width: 100
},
{
key: 'secret', key: 'secret',
title: '秘钥', title: '秘钥',
display: ['formA', 'formU', 'table', 'model'], display: ['formA', 'formU', 'table', 'model'],
fixed: false, fixed: false,
block: true, block: true,
width: 200 width: 200
}, },
] ]

8
epmet-oper-web/src/views/modules/customer/init/RegisterList.vue

@ -139,11 +139,11 @@ export default {
plain: false, plain: false,
methodName: 'showToken', // methodName: 'showToken', //
isShow: (row) => { isShow: (row) => {
if (this.env !== 'prod') { // if (this.env !== 'prod') {
return true return true
} else { // } else {
return false // return false
} // }
} }
} }
], ],

98
epmet-oper-web/src/views/modules/partner/app/edit.vue

@ -1,46 +1,46 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible"
:visible.sync="visible"
:title="'编辑外部应用'" :title="'编辑外部应用'"
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="handleClose" :before-close="handleClose"
:close-on-press-escape="false" :close-on-press-escape="false">
> <el-form :inline="true"
<el-form
:inline="true"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
:label-width="'120px'" :label-width="'120px'">
> <el-form-item label="应用名称"
<el-form-item label="应用名称" prop="appName"> prop="appName">
<el-input <el-input class="item_width_1"
class="item_width_1"
v-model="dataForm.appName" v-model="dataForm.appName"
placeholder="应用名称" placeholder="应用名称"></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属客户" prop="customerId"> <el-form-item label="所属客户"
<el-select prop="customerId">
class="item_width_1" <div>
<el-radio-group v-model="dataForm.customerType"
@change="onSelectedCustomerTypeChange">
<el-radio label="external">外部客户</el-radio>
<el-radio label="internal">内部客户</el-radio>
</el-radio-group>
</div>
<el-select class="item_width_1"
v-model="dataForm.customerId" v-model="dataForm.customerId"
placeholder="请选择" placeholder="请选择"
clearable clearable>
> <el-option v-for="item in customerList"
<el-option
v-for="item in customerList"
:key="item.customerId" :key="item.customerId"
:label="item.customerName" :label="item.customerName"
:value="item.customerId" :value="item.customerId">
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button> <el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="saveForm()">{{ <el-button type="primary"
@click="saveForm()">{{
$t("confirm") $t("confirm")
}}</el-button> }}</el-button>
</template> </template>
@ -58,7 +58,7 @@ const requestUrlPrefix = isMockEnv ? mockUrlPrefix : "";
let loading; // let loading; //
export default { export default {
data() { data () {
return { return {
visible: false, visible: false,
type: "", // A/U type: "", // A/U
@ -67,6 +67,7 @@ export default {
appName: "", appName: "",
customerId: "", customerId: "",
customerName: "", customerName: "",
customerType: "internal",
}, },
customerList: [ customerList: [
// { // {
@ -76,11 +77,11 @@ export default {
], ],
}; };
}, },
created() { mounted () {
this.queryCustomerList(); this.queryCustomerList();
}, },
computed: { computed: {
dataRule() { dataRule () {
return { return {
customerId: [ customerId: [
{ {
@ -100,7 +101,16 @@ export default {
}, },
}, },
methods: { methods: {
async queryCustomerList() { async queryCustomerList () {
if (this.dataForm.customerType === 'external') {
this.queryExternalCustomerList();
} else {
this.queryInternalCustomerList();
}
},
//
async queryExternalCustomerList () {
debugger
const { data, code, msg } = await requestPost( const { data, code, msg } = await requestPost(
requestUrlPrefix + "/commonservice/externalcustomer/list", requestUrlPrefix + "/commonservice/externalcustomer/list",
{ {
@ -108,27 +118,47 @@ export default {
pageSize: 1000, pageSize: 1000,
} }
); );
if (code === 0) { if (code === 0) {
this.customerList = data.list; this.customerList = data.list;
} }
}, },
init(dataForm, type) { //
queryInternalCustomerList () {
window.app.ajax.get(
"/oper/crm/customer/getvalidcustomerlist",
{},
(data, rspMsg) => {
this.customerList = data;
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}
)
},
//
onSelectedCustomerTypeChange (value) {
this.dataForm.customerType = value;
this.queryCustomerList();
},
init (dataForm, type) {
this.type = type; this.type = type;
this.visible = true; this.visible = true;
// this.dataForm=dataForm // this.dataForm=dataForm
this.$nextTick(() => { this.$nextTick(() => {
Object.assign(this.dataForm, dataForm); Object.assign(this.dataForm, dataForm);
this.queryCustomerList();
}); });
}, },
addRequest() { addRequest () {
this.dataForm.domainNameList.push(""); this.dataForm.domainNameList.push("");
}, },
delRequest(index) { delRequest (index) {
this.dataForm.domainNameList.splice(index, 1); this.dataForm.domainNameList.splice(index, 1);
}, },
saveForm() { saveForm () {
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (!valid) { if (!valid) {
this.$message.error("表单验证失败!"); this.$message.error("表单验证失败!");
@ -159,12 +189,12 @@ export default {
} }
}); });
}, },
handleClose() { handleClose () {
this.visible = false; this.visible = false;
}, },
// //
startLoading() { startLoading () {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: "正在加载……", // text: "正在加载……", //
@ -172,7 +202,7 @@ export default {
}); });
}, },
// //
endLoading() { endLoading () {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close(); loading.close();

Loading…
Cancel
Save