Commit 34bee68a authored by caimeng's avatar caimeng

修改环境配置,自动上传OSS

parent 98052e66
NODE_ENV=production NODE_ENV=dr
VUE_APP_ENV=production VUE_APP_ENV=production
VUE_APP_SIGN_URL=https://sign.taimedias.com/dr/index.html VUE_APP_SIGN_URL=https://sign.taimedias.com/dr/index.html
VUE_APP_API=https://drwater.dingrongxd.com VUE_APP_API=https://drwater.dingrongxd.com
NODE_ENV=production NODE_ENV=prod
VUE_APP_ENV=production VUE_APP_ENV=production
VUE_APP_SIGN_URL=https://sign.taimedias.com/index.html VUE_APP_SIGN_URL=https://sign.taimedias.com/index.html
VUE_APP_API=https://water.jqtianxia.com VUE_APP_API=https://water.jqtianxia.com
NODE_ENV=production NODE_ENV=staging
VUE_APP_ENV=test VUE_APP_ENV=test
VUE_APP_SIGN_URL=http://m.jqtianxia.cn/sign_agreement/index.html VUE_APP_SIGN_URL=http://m.jqtianxia.cn/sign_agreement/index.html
VUE_APP_API=http://47.99.245.36:8202 VUE_APP_API=http://47.99.245.36:8202
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build:test": "vue-cli-service build --mode test", "build:test": "vue-cli-service build --mode test && node ./upload_oss.js",
"build:dr": "vue-cli-service build --mode dr --modern", "build:dr": "vue-cli-service build --mode dr --modern",
"build:prod": "vue-cli-service build --mode production --modern" "build:prod": "vue-cli-service build --mode production --modern"
}, },
"dependencies": { "dependencies": {
"ali-oss": "^6.20.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"element-ui": "^2.15.13", "element-ui": "^2.15.13",
"express": "^4.17.1", "express": "^4.17.1",
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
<tr> <tr>
<td>退款总金额</td> <td>退款总金额</td>
<td> <td>
<span v-if="loanVo.refundAmt !== 0" <span v-if="loanVo.refundAmt !== 0">{{ loanVo.refundAmt }} ({{ loanVo.refundStatusDesc }})</span>
>{{ loanVo.refundAmt }} ({{ loanVo.refundStatusDesc }})</span
>
<span v-else>{{ loanVo.refundAmt }}</span> <span v-else>{{ loanVo.refundAmt }}</span>
</td> </td>
<td>账单已还款</td> <td>账单已还款</td>
...@@ -24,25 +22,16 @@ ...@@ -24,25 +22,16 @@
<td>操作</td> <td>操作</td>
<td> <td>
<template v-if="!type"> <template v-if="!type">
<el-button <el-button type="primary" size="mini" @click="handleAdvanceLoanAmt" v-if="isNeedAudit">线下结清
type="primary"
size="mini"
@click="handleAdvanceLoanAmt"
v-if="isNeedAudit"
>线下结清
</el-button
>
<el-button type="primary" size="mini" @click="protocolSettleAll"
>代扣结清
</el-button
>
<el-button type="primary" size="mini" v-if="params.capitalCode === 'OWNBUSINESS'"
@click="handleDevicePayment">
分笔代扣
</el-button> </el-button>
<el-button type="primary" size="mini" @click="protocolSettleAll">代扣结清
</el-button>
<el-button type="primary" size="mini"
v-if="params.capitalCode === 'OWNBUSINESS' || params.capitalCode === 'YUANFENGBUSINESS'"
@click="handleDevicePayment">分笔代扣</el-button>
<template v-if="$permissionUtils.rolePermission('protocolSign')"> <template v-if="$permissionUtils.rolePermission('protocolSign')">
<el-button v-if="params.level==='CF'" :disabled="cf.disabled" type="primary" size="mini" <el-button v-if="params.level === 'CF'" :disabled="cf.disabled" type="primary" size="mini"
@click="handleChangeCFBill">CF账单变更 @click="handleChangeCFBill">CF账单变更
</el-button> </el-button>
</template> </template>
</template> </template>
...@@ -55,230 +44,87 @@ ...@@ -55,230 +44,87 @@
<div class="tables"> <div class="tables">
<!-- <block-header :title="title"></block-header> --> <!-- <block-header :title="title"></block-header> -->
<el-table <el-table @filter-change="handleFilterChange" border size="mini" :highlight-current-row="true"
@filter-change="handleFilterChange" :header-row-class-name="headerStyle" :data="data" stripe style="width: 100%">
border <el-table-column align="center" prop="planNo" label="计划编号" width="135px"></el-table-column>
size="mini" <el-table-column align="center" prop="planIndex" label="期数"></el-table-column>
:highlight-current-row="true" <el-table-column align="center" prop="planAmt" width="85" label="应还总金额"></el-table-column>
:header-row-class-name="headerStyle" <el-table-column align="center" prop="planBen" label="本金"></el-table-column>
:data="data" <el-table-column align="center" prop="planFu" label="服务费"></el-table-column>
stripe <el-table-column align="center" prop="planXi" label="利息"></el-table-column>
style="width: 100%" <el-table-column align="center" prop="planFa" label="计划罚息"></el-table-column>
> <el-table-column align="center" prop="accountAmt" label="担保费"></el-table-column>
<el-table-column <el-table-column align="center" prop="planDate" width="120" label="计划还款时间"
align="center" :formatter="dateFormats"></el-table-column>
prop="planNo" <el-table-column align="center" prop="backedAmt" label="已还金额" :formatter="planMoneyFormat"></el-table-column>
label="计划编号" <el-table-column align="center" prop="derateAmt" label="减免金额"></el-table-column>
width="135px" <el-table-column align="center" prop="remainAmt" label="待还金额"></el-table-column>
></el-table-column> <el-table-column align="center" prop="statusStr" label="还款状态"></el-table-column>
<el-table-column <el-table-column align="center" prop="gmtModified" width="120" label="结清时间"
align="center" :formatter="dateFormats"></el-table-column>
prop="planIndex"
label="期数"
></el-table-column>
<el-table-column
align="center"
prop="planAmt"
width="85"
label="应还总金额"
></el-table-column>
<el-table-column
align="center"
prop="planBen"
label="本金"
></el-table-column>
<el-table-column
align="center"
prop="planFu"
label="服务费"
></el-table-column>
<el-table-column
align="center"
prop="planXi"
label="利息"
></el-table-column>
<el-table-column
align="center"
prop="planFa"
label="计划罚息"
></el-table-column>
<el-table-column
align="center"
prop="accountAmt"
label="担保费"
></el-table-column>
<el-table-column
align="center"
prop="planDate"
width="120"
label="计划还款时间"
:formatter="dateFormats"
></el-table-column>
<el-table-column
align="center"
prop="backedAmt"
label="已还金额"
:formatter="planMoneyFormat"
></el-table-column>
<el-table-column
align="center"
prop="derateAmt"
label="减免金额"
></el-table-column>
<el-table-column
align="center"
prop="remainAmt"
label="待还金额"
></el-table-column>
<el-table-column
align="center"
prop="statusStr"
label="还款状态"
></el-table-column>
<el-table-column
align="center"
prop="gmtModified"
width="120"
label="结清时间"
:formatter="dateFormats"
></el-table-column>
<el-table-column fixed="right" v-if="!type" align="center" width="120" label="操作"> <el-table-column fixed="right" v-if="!type" align="center" width="120" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button type="text" size="small" v-if="scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
type="text" " @click="protocolOne(scope.row)">代扣
size="small" </el-button>
v-if=" <el-button type="text" size="small" v-else disabled @click="protocolOne(scope.row)">代扣
scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
"
@click="protocolOne(scope.row)"
>代扣
</el-button> </el-button>
<el-button
type="text"
size="small"
v-else
disabled
@click="protocolOne(scope.row)"
>代扣
</el-button
>
<el-button <el-button type="text" size="small" v-if="scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
type="text" " @click="offlineTransfer(scope.row)">线下转账
size="small" </el-button>
v-if=" <el-button type="text" size="small" v-else disabled @click="offlineTransfer(scope.row)">线下转账
scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
"
@click="offlineTransfer(scope.row)"
>线下转账
</el-button> </el-button>
<el-button
type="text"
size="small"
v-else
disabled
@click="offlineTransfer(scope.row)"
>线下转账
</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pages"> <div class="pages">
<el-pagination <el-pagination background @current-change="handleCurrentChange" @size-change="handleSizeChange"
background :current-page.sync="form.current" :page-sizes="[10, 20, 50, 100]" :page-size="form.size"
@current-change="handleCurrentChange" layout="total, sizes, prev, pager, next, jumper" :total="form.total">
@size-change="handleSizeChange"
:current-page.sync="form.current"
:page-sizes="[10, 20, 50, 100]"
:page-size="form.size"
layout="total, sizes, prev, pager, next, jumper"
:total="form.total"
>
</el-pagination> </el-pagination>
</div> </div>
<!--线下提前结清--> <!--线下提前结清-->
<advance-loan-amt <advance-loan-amt v-if="ui.advanceLoanAmt.visible" :loanNo="ui.advanceLoanAmt.loanNo"
v-if="ui.advanceLoanAmt.visible" :orderNo="ui.advanceLoanAmt.orderNo" @callback="init" :dialogVisible.sync="ui.advanceLoanAmt.visible">
:loanNo="ui.advanceLoanAmt.loanNo"
:orderNo="ui.advanceLoanAmt.orderNo"
@callback="init"
:dialogVisible.sync="ui.advanceLoanAmt.visible"
>
</advance-loan-amt> </advance-loan-amt>
<!--代扣提前结清--> <!--代扣提前结清-->
<protocol-settled <protocol-settled v-if="ui.protocolSettled.visible" :loanNo="ui.protocolSettled.loanNo"
v-if="ui.protocolSettled.visible" :clientNo="ui.protocolSettled.clientNo" :bizType="ui.protocolSettled.bizType" @callback="init"
:loanNo="ui.protocolSettled.loanNo" :dialogVisible.sync="ui.protocolSettled.visible">
:clientNo="ui.protocolSettled.clientNo"
:bizType="ui.protocolSettled.bizType"
@callback="init"
:dialogVisible.sync="ui.protocolSettled.visible"
>
</protocol-settled> </protocol-settled>
<!--分笔代扣--> <!--分笔代扣-->
<device-payment <device-payment v-if="ui.devicePayment.visible" :loanNo="ui.devicePayment.loanNo"
v-if="ui.devicePayment.visible" :orderNo="ui.devicePayment.orderNo" :clientNo="ui.devicePayment.clientNo" :bizType="ui.devicePayment.bizType"
:loanNo="ui.devicePayment.loanNo" @callback="init" :dialogVisible.sync="ui.devicePayment.visible">
:orderNo="ui.devicePayment.orderNo"
:clientNo="ui.devicePayment.clientNo"
:bizType="ui.devicePayment.bizType"
@callback="init"
:dialogVisible.sync="ui.devicePayment.visible"
>
</device-payment> </device-payment>
<protocol-settled-one <protocol-settled-one v-if="ui.protocolSettledOne.visible" :loanNo="ui.protocolSettledOne.loanNo"
v-if="ui.protocolSettledOne.visible" :periodNo="ui.protocolSettledOne.periodNo" :remainAmt="ui.protocolSettledOne.remainAmt"
:loanNo="ui.protocolSettledOne.loanNo" :planAmt="ui.protocolSettledOne.planAmt" :bizType="ui.protocolSettledOne.bizType"
:periodNo="ui.protocolSettledOne.periodNo" :clientNo="ui.protocolSettledOne.clientNo" :loanSign="ui.protocolSettledOne.loanSign"
:remainAmt="ui.protocolSettledOne.remainAmt" :isCustomAmount="ui.protocolSettledOne.isCustomAmount" @callback="init"
:planAmt="ui.protocolSettledOne.planAmt" :dialogVisible.sync="ui.protocolSettledOne.visible">
:bizType="ui.protocolSettledOne.bizType"
:clientNo="ui.protocolSettledOne.clientNo"
:loanSign="ui.protocolSettledOne.loanSign"
:isCustomAmount="ui.protocolSettledOne.isCustomAmount"
@callback="init"
:dialogVisible.sync="ui.protocolSettledOne.visible"
>
</protocol-settled-one> </protocol-settled-one>
<!-- 线下转账 --> <!-- 线下转账 -->
<offline-transfer <offline-transfer v-if="ui.offineTransfer.visible" :orderNo="ui.offineTransfer.orderNo"
v-if="ui.offineTransfer.visible" :loanNo="ui.offineTransfer.loanNo" :periodNo="ui.offineTransfer.periodNo" :planNo="ui.offineTransfer.planNo"
:orderNo="ui.offineTransfer.orderNo" :planAmt="ui.offineTransfer.planAmt" :planFu="ui.offineTransfer.planFu" :planBen="ui.offineTransfer.planBen"
:loanNo="ui.offineTransfer.loanNo" :planXi="ui.offineTransfer.planXi" :remainAmt="ui.offineTransfer.remainAmt"
:periodNo="ui.offineTransfer.periodNo" :accountAmt="ui.offineTransfer.accountAmt" @callback="init" :dialogVisible.sync="ui.offineTransfer.visible">
:planNo="ui.offineTransfer.planNo"
:planAmt="ui.offineTransfer.planAmt"
:planFu="ui.offineTransfer.planFu"
:planBen="ui.offineTransfer.planBen"
:planXi="ui.offineTransfer.planXi"
:remainAmt="ui.offineTransfer.remainAmt"
:accountAmt="ui.offineTransfer.accountAmt"
@callback="init"
:dialogVisible.sync="ui.offineTransfer.visible"
>
</offline-transfer> </offline-transfer>
<!--CF账单变更--> <!--CF账单变更-->
<el-dialog <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :append-to-body="true" title="CF账单变更" center
:close-on-click-modal="false" width="50%" :visible.sync="cf.visible" :before-close="handleChangeCFClose">
:close-on-press-escape="false"
:append-to-body="true"
title="CF账单变更"
center
width="50%"
:visible.sync="cf.visible"
:before-close="handleChangeCFClose"
>
<div class="box-agreement" style="height: 380px; overflow: auto"> <div class="box-agreement" style="height: 380px; overflow: auto">
<h3 style="color: crimson; text-align: center; margin-bottom: 20px">账单变更后,不可恢复,请谨慎操作</h3> <h3 style="color: crimson; text-align: center; margin-bottom: 20px">账单变更后,不可恢复,请谨慎操作</h3>
<block-header title="当前可变更信息"/> <block-header title="当前可变更信息" />
<el-form label-suffix=":" label-width="110px" :model="form" ref="form"> <el-form label-suffix=":" label-width="110px" :model="form" ref="form">
<el-form-item prop="isUploadProve" label="可变更期数"> <el-form-item prop="isUploadProve" label="可变更期数">
<div>{{ cf.form.splitPlanIndex }}期</div> <div>{{ cf.form.splitPlanIndex }}期</div>
...@@ -292,11 +138,11 @@ ...@@ -292,11 +138,11 @@
</el-form> </el-form>
<!--还款计划--> <!--还款计划-->
<block-header title="变更后还款计划"/> <block-header title="变更后还款计划" />
<div class="p-table"> <div class="p-table">
<el-table border :highlight-current-row="true" :header-row-class-name="headerStyle" size="small" <el-table border :highlight-current-row="true" :header-row-class-name="headerStyle" size="small"
:data="cf.list" stripe style="width: 100%;"> :data="cf.list" stripe style="width: 100%;">
<el-table-column align="center" prop="planIndex" label="期数"></el-table-column> <el-table-column align="center" prop="planIndex" label="期数"></el-table-column>
<el-table-column align="center" prop="planAmt" label="应还款金额"></el-table-column> <el-table-column align="center" prop="planAmt" label="应还款金额"></el-table-column>
<el-table-column align="center" prop="planBen" label="本金"></el-table-column> <el-table-column align="center" prop="planBen" label="本金"></el-table-column>
...@@ -350,8 +196,8 @@ export default { ...@@ -350,8 +196,8 @@ export default {
data() { data() {
return { return {
tableStatus: [ tableStatus: [
{text: "成功", value: "SUCCESS"}, { text: "成功", value: "SUCCESS" },
{text: "失败", value: "FAIL"}, { text: "失败", value: "FAIL" },
], ],
form: { form: {
total: 1, total: 1,
...@@ -423,7 +269,7 @@ export default { ...@@ -423,7 +269,7 @@ export default {
async created() { async created() {
if (this.params) { if (this.params) {
console.log(this.params, '参数') console.log(this.params, '参数')
const {loanNo} = this.params; const { loanNo } = this.params;
this.advanceLoanAmt.loanNo = loanNo; this.advanceLoanAmt.loanNo = loanNo;
await this.init(); await this.init();
} }
...@@ -435,12 +281,12 @@ export default { ...@@ -435,12 +281,12 @@ export default {
async init() { async init() {
const res = await this.$$get( const res = await this.$$get(
"/detail/customer/" + this.advanceLoanAmt.loanNo "/detail/customer/" + this.advanceLoanAmt.loanNo
); );
const {success, result} = res.data; const { success, result } = res.data;
// console.log(res.data.result,'888'); // console.log(res.data.result,'888');
if (success && result != null) { if (success && result != null) {
const {loanVo, applyVo, planVo, isChangePlan} = result; const { loanVo, applyVo, planVo, isChangePlan } = result;
this.advanceLoanAmt.loanNo = applyVo.loanNo; this.advanceLoanAmt.loanNo = applyVo.loanNo;
this.advanceLoanAmt.bizType = applyVo.bizType; this.advanceLoanAmt.bizType = applyVo.bizType;
this.advanceLoanAmt.clientNo = applyVo.clientNo; this.advanceLoanAmt.clientNo = applyVo.clientNo;
...@@ -482,19 +328,19 @@ export default { ...@@ -482,19 +328,19 @@ export default {
// 计算已还金额 // 计算已还金额
planMoneyFormat: function (row, column) { planMoneyFormat: function (row, column) {
return this.accAdd( return this.accAdd(
this.accAdd(
this.accAdd( this.accAdd(
this.accAdd( this.accAdd(this.accAdd(row.backedBen, row.backedFu), row.backedXi),
this.accAdd(this.accAdd(row.backedBen, row.backedFu), row.backedXi), row.backedFa
row.backedFa
),
row.backedBurden
), ),
row.backedSpeaccount row.backedBurden
),
row.backedSpeaccount
).toFixed(2); ).toFixed(2);
}, },
offlineTransfer(record) { offlineTransfer(record) {
const {applyVo, orderNo, loanNo} = this.params; const { applyVo, orderNo, loanNo } = this.params;
// console.log(this.params, "代扣"); // console.log(this.params, "代扣");
// 取当前用户的信息 // 取当前用户的信息
...@@ -524,7 +370,7 @@ export default { ...@@ -524,7 +370,7 @@ export default {
//代扣当期 //代扣当期
protocolOne(record) { protocolOne(record) {
console.log(record, 'record'); console.log(record, 'record');
const {applyVo, loanNo, loanSign} = this.params; const { applyVo, loanNo, loanSign } = this.params;
this.ui.protocolSettledOne = { this.ui.protocolSettledOne = {
visible: true, visible: true,
loanNo: loanNo, loanNo: loanNo,
...@@ -540,7 +386,7 @@ export default { ...@@ -540,7 +386,7 @@ export default {
}, },
//分笔代扣 //分笔代扣
handleDevicePayment() { handleDevicePayment() {
const {applyVo, loanNo, orderNo, clientNo} = this.params; const { applyVo, loanNo, orderNo, clientNo } = this.params;
// console.log(this.params,'params'); // console.log(this.params,'params');
this.ui.devicePayment = { this.ui.devicePayment = {
visible: true, visible: true,
...@@ -555,10 +401,10 @@ export default { ...@@ -555,10 +401,10 @@ export default {
try { try {
const loanNo = this.params.loanNo const loanNo = this.params.loanNo
const res = await this.$$get('/protocol/getCanChangePlan', {loanNo}) const res = await this.$$get('/protocol/getCanChangePlan', { loanNo })
if (res.status === 200 && res.data.success) { if (res.status === 200 && res.data.success) {
const result = res.data.result; const result = res.data.result;
const {debtPlanModels} = result const { debtPlanModels } = result
this.cf.visible = true; this.cf.visible = true;
this.cf.form = result; this.cf.form = result;
this.cf.list = debtPlanModels this.cf.list = debtPlanModels
...@@ -580,7 +426,7 @@ export default { ...@@ -580,7 +426,7 @@ export default {
const loanNo = this.params.loanNo const loanNo = this.params.loanNo
this.cf.form.applyUser = localStorage.getItem("loginName") this.cf.form.applyUser = localStorage.getItem("loginName")
this.cf.form.loanNo = loanNo this.cf.form.loanNo = loanNo
const res = await this.$$post('/protocol/changePlan', {...this.cf.form}) const res = await this.$$post('/protocol/changePlan', { ...this.cf.form })
if (res.status === 200 && res.data.success) { if (res.status === 200 && res.data.success) {
this.$message.success('操作成功'); this.$message.success('操作成功');
this.cf.visible = false; this.cf.visible = false;
......
let fs = require("fs"); // node , fs 文件流控制
let path = require("path"); // node 什么方法忘了,路径方法
let OSS = require("ali-oss"); // oss 引入
const dirBasePath = path.join(process.cwd(), "/dist/1.0.0"); // 路径引导
const { COMPILE_ENV = "staging" } = process.env; // 获取环境变量,node版本失效,可饮用env作为判断,也可以手动执行修改
let bucket = "customer-vue-test"; // 对应oss文件,默认为预发环境
let accessKeyId = "LTAI5tAhrEnqLFtnWPwZbDue",
accessKeySecret = "z3S6J1yrc4JoGtkMJkb75oTUsCxdOD";
if (COMPILE_ENV === "prod") {
bucket = "customer-vue";
} else if (COMPILE_ENV === "dr") {
bucket = "mmyx-h5-gray";
accessKeyId = "";
accessKeySecret = "";
} else if (COMPILE_ENV === "staging") {
bucket = "customer-vue-test";
}
// oss 账号密码,地址
let client = new OSS({
region: "oss-cn-hangzhou",
bucket,
accessKeyId,
accessKeySecret,
});
// 上传的方法
// node 日志进度输入
async function put(file, filePath) {
try {
let r1 = await client.put(file, filePath);
console.log("当前进度: %j", r1);
} catch (e) {
console.error("上传文件报错", e);
}
}
// 遍历本地上传的目录文件夹
// node本地文件遍历,fs文档流控制
const fileList = [];
function listFile(dir) {
let arr = fs.readdirSync(dir);
arr.forEach(function(item) {
const o = {};
let fullPath = path.join(dir, item);
let stats = fs.statSync(fullPath);
if (stats.isDirectory()) {
listFile(fullPath);
} else {
const fileDir = fullPath.replace(`${dirBasePath}/`, "");
console.log(fileDir + "处理后的内容");
o.file = fileDir;
o.filePath = fullPath;
fileList.push(o);
}
});
return fileList;
}
listFile(dirBasePath).forEach(function(item) {
const { file, filePath } = item;
put(file, filePath);
});
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment