Commit 34bee68a authored by caimeng's avatar caimeng

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

parent 98052e66
NODE_ENV=production
NODE_ENV=dr
VUE_APP_ENV=production
VUE_APP_SIGN_URL=https://sign.taimedias.com/dr/index.html
VUE_APP_API=https://drwater.dingrongxd.com
NODE_ENV=production
NODE_ENV=prod
VUE_APP_ENV=production
VUE_APP_SIGN_URL=https://sign.taimedias.com/index.html
VUE_APP_API=https://water.jqtianxia.com
NODE_ENV=production
NODE_ENV=staging
VUE_APP_ENV=test
VUE_APP_SIGN_URL=http://m.jqtianxia.cn/sign_agreement/index.html
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 @@
"private": true,
"scripts": {
"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:prod": "vue-cli-service build --mode production --modern"
},
"dependencies": {
"ali-oss": "^6.20.0",
"axios": "^0.21.1",
"element-ui": "^2.15.13",
"express": "^4.17.1",
......
......@@ -12,9 +12,7 @@
<tr>
<td>退款总金额</td>
<td>
<span v-if="loanVo.refundAmt !== 0"
>{{ loanVo.refundAmt }} ({{ loanVo.refundStatusDesc }})</span
>
<span v-if="loanVo.refundAmt !== 0">{{ loanVo.refundAmt }} ({{ loanVo.refundStatusDesc }})</span>
<span v-else>{{ loanVo.refundAmt }}</span>
</td>
<td>账单已还款</td>
......@@ -24,24 +22,15 @@
<td>操作</td>
<td>
<template v-if="!type">
<el-button
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 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' || params.capitalCode === 'YUANFENGBUSINESS'"
@click="handleDevicePayment">分笔代扣</el-button>
<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账单变更
</el-button>
</template>
......@@ -55,230 +44,87 @@
<div class="tables">
<!-- <block-header :title="title"></block-header> -->
<el-table
@filter-change="handleFilterChange"
border
size="mini"
:highlight-current-row="true"
:header-row-class-name="headerStyle"
:data="data"
stripe
style="width: 100%"
>
<el-table-column
align="center"
prop="planNo"
label="计划编号"
width="135px"
></el-table-column>
<el-table-column
align="center"
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 @filter-change="handleFilterChange" border size="mini" :highlight-current-row="true"
:header-row-class-name="headerStyle" :data="data" stripe style="width: 100%">
<el-table-column align="center" prop="planNo" label="计划编号" width="135px"></el-table-column>
<el-table-column align="center" 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="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
v-if="
scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
"
@click="protocolOne(scope.row)"
>代扣
<el-button type="text" size="small" v-if="scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
" @click="protocolOne(scope.row)">代扣
</el-button>
<el-button type="text" size="small" v-else disabled @click="protocolOne(scope.row)">代扣
</el-button>
<el-button
type="text"
size="small"
v-else
disabled
@click="protocolOne(scope.row)"
>代扣
</el-button
>
<el-button
type="text"
size="small"
v-if="
scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
"
@click="offlineTransfer(scope.row)"
>线下转账
<el-button type="text" size="small" v-if="scope.row.status != 'SETTLED' && scope.row.backedSign == 'YES'
" @click="offlineTransfer(scope.row)">线下转账
</el-button>
<el-button type="text" size="small" v-else disabled @click="offlineTransfer(scope.row)">线下转账
</el-button>
<el-button
type="text"
size="small"
v-else
disabled
@click="offlineTransfer(scope.row)"
>线下转账
</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<el-pagination
background
@current-change="handleCurrentChange"
@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 background @current-change="handleCurrentChange" @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>
</div>
<!--线下提前结清-->
<advance-loan-amt
v-if="ui.advanceLoanAmt.visible"
:loanNo="ui.advanceLoanAmt.loanNo"
:orderNo="ui.advanceLoanAmt.orderNo"
@callback="init"
:dialogVisible.sync="ui.advanceLoanAmt.visible"
>
<advance-loan-amt v-if="ui.advanceLoanAmt.visible" :loanNo="ui.advanceLoanAmt.loanNo"
:orderNo="ui.advanceLoanAmt.orderNo" @callback="init" :dialogVisible.sync="ui.advanceLoanAmt.visible">
</advance-loan-amt>
<!--代扣提前结清-->
<protocol-settled
v-if="ui.protocolSettled.visible"
:loanNo="ui.protocolSettled.loanNo"
:clientNo="ui.protocolSettled.clientNo"
:bizType="ui.protocolSettled.bizType"
@callback="init"
:dialogVisible.sync="ui.protocolSettled.visible"
>
<protocol-settled v-if="ui.protocolSettled.visible" :loanNo="ui.protocolSettled.loanNo"
:clientNo="ui.protocolSettled.clientNo" :bizType="ui.protocolSettled.bizType" @callback="init"
:dialogVisible.sync="ui.protocolSettled.visible">
</protocol-settled>
<!--分笔代扣-->
<device-payment
v-if="ui.devicePayment.visible"
:loanNo="ui.devicePayment.loanNo"
:orderNo="ui.devicePayment.orderNo"
:clientNo="ui.devicePayment.clientNo"
:bizType="ui.devicePayment.bizType"
@callback="init"
:dialogVisible.sync="ui.devicePayment.visible"
>
<device-payment v-if="ui.devicePayment.visible" :loanNo="ui.devicePayment.loanNo"
:orderNo="ui.devicePayment.orderNo" :clientNo="ui.devicePayment.clientNo" :bizType="ui.devicePayment.bizType"
@callback="init" :dialogVisible.sync="ui.devicePayment.visible">
</device-payment>
<protocol-settled-one
v-if="ui.protocolSettledOne.visible"
:loanNo="ui.protocolSettledOne.loanNo"
:periodNo="ui.protocolSettledOne.periodNo"
:remainAmt="ui.protocolSettledOne.remainAmt"
:planAmt="ui.protocolSettledOne.planAmt"
: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 v-if="ui.protocolSettledOne.visible" :loanNo="ui.protocolSettledOne.loanNo"
:periodNo="ui.protocolSettledOne.periodNo" :remainAmt="ui.protocolSettledOne.remainAmt"
:planAmt="ui.protocolSettledOne.planAmt" :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>
<!-- 线下转账 -->
<offline-transfer
v-if="ui.offineTransfer.visible"
:orderNo="ui.offineTransfer.orderNo"
:loanNo="ui.offineTransfer.loanNo"
:periodNo="ui.offineTransfer.periodNo"
: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 v-if="ui.offineTransfer.visible" :orderNo="ui.offineTransfer.orderNo"
:loanNo="ui.offineTransfer.loanNo" :periodNo="ui.offineTransfer.periodNo" :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>
<!--CF账单变更-->
<el-dialog
:close-on-click-modal="false"
:close-on-press-escape="false"
:append-to-body="true"
title="CF账单变更"
center
width="50%"
:visible.sync="cf.visible"
:before-close="handleChangeCFClose"
>
<el-dialog :close-on-click-modal="false" :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">
<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-item prop="isUploadProve" label="可变更期数">
<div>{{ cf.form.splitPlanIndex }}期</div>
......@@ -292,7 +138,7 @@
</el-form>
<!--还款计划-->
<block-header title="变更后还款计划"/>
<block-header title="变更后还款计划" />
<div class="p-table">
<el-table border :highlight-current-row="true" :header-row-class-name="headerStyle" size="small"
......@@ -350,8 +196,8 @@ export default {
data() {
return {
tableStatus: [
{text: "成功", value: "SUCCESS"},
{text: "失败", value: "FAIL"},
{ text: "成功", value: "SUCCESS" },
{ text: "失败", value: "FAIL" },
],
form: {
total: 1,
......@@ -423,7 +269,7 @@ export default {
async created() {
if (this.params) {
console.log(this.params, '参数')
const {loanNo} = this.params;
const { loanNo } = this.params;
this.advanceLoanAmt.loanNo = loanNo;
await this.init();
}
......@@ -437,10 +283,10 @@ export default {
const res = await this.$$get(
"/detail/customer/" + this.advanceLoanAmt.loanNo
);
const {success, result} = res.data;
const { success, result } = res.data;
// console.log(res.data.result,'888');
if (success && result != null) {
const {loanVo, applyVo, planVo, isChangePlan} = result;
const { loanVo, applyVo, planVo, isChangePlan } = result;
this.advanceLoanAmt.loanNo = applyVo.loanNo;
this.advanceLoanAmt.bizType = applyVo.bizType;
this.advanceLoanAmt.clientNo = applyVo.clientNo;
......@@ -494,7 +340,7 @@ export default {
},
offlineTransfer(record) {
const {applyVo, orderNo, loanNo} = this.params;
const { applyVo, orderNo, loanNo } = this.params;
// console.log(this.params, "代扣");
// 取当前用户的信息
......@@ -524,7 +370,7 @@ export default {
//代扣当期
protocolOne(record) {
console.log(record, 'record');
const {applyVo, loanNo, loanSign} = this.params;
const { applyVo, loanNo, loanSign } = this.params;
this.ui.protocolSettledOne = {
visible: true,
loanNo: loanNo,
......@@ -540,7 +386,7 @@ export default {
},
//分笔代扣
handleDevicePayment() {
const {applyVo, loanNo, orderNo, clientNo} = this.params;
const { applyVo, loanNo, orderNo, clientNo } = this.params;
// console.log(this.params,'params');
this.ui.devicePayment = {
visible: true,
......@@ -555,10 +401,10 @@ export default {
try {
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) {
const result = res.data.result;
const {debtPlanModels} = result
const { debtPlanModels } = result
this.cf.visible = true;
this.cf.form = result;
this.cf.list = debtPlanModels
......@@ -580,7 +426,7 @@ export default {
const loanNo = this.params.loanNo
this.cf.form.applyUser = localStorage.getItem("loginName")
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) {
this.$message.success('操作成功');
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