Merge branch 'xiaozy_产品列表' of http://121.196.213.68:3000/xiaozhiyong/refinery-admin into lixuan

pull/1/head
lixuan 2 years ago
commit 12d6fb072f
  1. 40
      src/utils/dataType.js
  2. 173
      src/views/financialCenter/accountManagement/components/recharge.vue
  3. 5
      src/views/financialCenter/accountManagement/index.vue
  4. 1
      src/views/financialCenter/enterpriseRecharge/components/add.vue
  5. 60
      src/views/financialCenter/enterpriseRecharge/components/addTurn.vue
  6. 6
      src/views/financialCenter/enterpriseRecharge/components/examine.vue
  7. 2
      src/views/financialCenter/enterpriseRecharge/index.vue
  8. 21
      src/views/product/components/create.vue
  9. 3
      src/views/product/index.vue

@ -18,18 +18,42 @@ export const rechargeTypeEnum = [
label: "充值", label: "充值",
value: "RECHARGE", value: "RECHARGE",
}, },
// { {
// label: "销账", label: "销账",
// value: "REVOKE", value: "REVOKE",
// }, },
// { {
// label: "赊销", label: "赊销",
// value: "CHARGE_SALES", value: "CHARGE_SALES",
// }, },
{
label: "转账",
value: "TRANSFER",
},
{
label: "圈回",
value: "TURN",
},
{ {
label: "消费返利", label: "消费返利",
value: "CONSUME_REBATE", value: "CONSUME_REBATE",
}, },
{
label: "修正平账",
value: "CORRECTION",
},
{
label: "订单支付",
value: "PAYMENT",
},
{
label: "订单回退",
value: "RETURN",
},
{
label: "订单退款",
value: "REFUND",
},
]; ];
// 交易状态 // 交易状态
export const rechargeStatusEnum = [ export const rechargeStatusEnum = [

@ -2,25 +2,16 @@
<el-dialog <el-dialog
title="充值" title="充值"
:visible.sync="controlWindows.recharge" :visible.sync="controlWindows.recharge"
width="55%" width="45%"
:before-close="closeWindow" :before-close="closeWindow"
@opened="openDrawer" @opened="openDrawer"
> >
<div class="recharge"> <div class="recharge">
<el-form <el-form ref="form" :rules="rules" :model="form" label-width="130px">
ref="form" <el-row :gutter="2">
:rules="rules"
:model="oilCompanyAccountReverse"
label-width="130px"
>
<el-row :gutter="gridNum.row.gutter">
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="交易类型" prop="transactionType">
label="交易类型" <el-select v-model="form.transactionType">
prop="transactionType"
@click="transactionTypeChange"
>
<el-select v-model="oilCompanyAccountReverse.transactionType">
<el-option label="充值" value="RECHARGE" /> <el-option label="充值" value="RECHARGE" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -28,7 +19,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="交易金额" prop="transactionAmount"> <el-form-item label="交易金额" prop="transactionAmount">
<el-input <el-input
v-model="oilCompanyAccountReverse.transactionAmount" v-model="form.transactionAmount"
placeholder="交易金额" placeholder="交易金额"
clearable clearable
/> />
@ -36,91 +27,74 @@
</el-col> </el-col>
<el-col <el-col
v-if=" v-if="
(companyFinance.settlementModes === 1 || companyFinance.settlementModes === 1 ||
companyFinance.settlementModes === 3) && companyFinance.settlementModes === 3
oilCompanyAccountReverse.transactionType === 'RECHARGE'
" "
:span="12" :span="12"
> >
<el-form-item label="充值返利比例" prop="rechargeRebate"> <el-form-item label="充值返利比例" prop="rechargeRebate">
<el-input <el-input v-model="form.rechargeRebate" clearable />
v-model="oilCompanyAccountReverse.rechargeRebate"
clearable
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :span="12">
v-if="oilCompanyAccountReverse.transactionType !== 'REVOKE'"
:span="12"
>
<el-form-item label="线下汇款公司账户" prop="offlinePaymentCompany"> <el-form-item label="线下汇款公司账户" prop="offlinePaymentCompany">
<el-input <el-input
v-model="oilCompanyAccountReverse.offlinePaymentCompany" v-model="form.offlinePaymentCompany"
placeholder="线下汇款公司账户" placeholder="线下汇款公司账户"
clearable clearable
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :span="12">
v-if="oilCompanyAccountReverse.transactionType !== 'REVOKE'"
:span="12"
>
<el-form-item label="线下交易发起时间" prop="offlineStartTime"> <el-form-item label="线下交易发起时间" prop="offlineStartTime">
<el-date-picker <el-date-picker
v-model="oilCompanyAccountReverse.offlineStartTime" v-model="form.offlineStartTime"
clearable clearable
format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
default-time="00:00:00"
type="datetime" type="datetime"
placeholder="线下交易发起时间" placeholder="线下交易发起时间"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :span="12">
v-if="oilCompanyAccountReverse.transactionType !== 'REVOKE'"
:span="12"
>
<el-form-item label="线下交易完成时间" prop="offlineCompleteTime"> <el-form-item label="线下交易完成时间" prop="offlineCompleteTime">
<el-date-picker <el-date-picker
v-model="oilCompanyAccountReverse.offlineCompleteTime" v-model="form.offlineCompleteTime"
clearable clearable
format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
default-time="23:59:59"
type="datetime" type="datetime"
placeholder="线下交易完成时间" placeholder="线下交易完成时间"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col <el-col :span="12">
v-if="oilCompanyAccountReverse.transactionType !== 'REVOKE'"
:span="12"
>
<el-form-item label="线下交易凭证" prop="offlineTransactionProof"> <el-form-item label="线下交易凭证" prop="offlineTransactionProof">
<el-upload <el-upload
:action="uploadUrl" :action="uploadUrl"
list-type="picture-card"
:on-preview="offlineTransactionProofPreview" :on-preview="offlineTransactionProofPreview"
:on-success="offlineTransactionProofSuccess" :on-success="offlineTransactionProofSuccess"
:on-remove="offlineTransactionProofRemove" :on-remove="offlineTransactionProofRemove"
:headers="headers" :headers="headers"
:data="{ code: 'A003' }"
:limit="1" :limit="1"
:file-list="fileList"
:data="{
ossKey: 'xingyou',
pathKey: 'other',
encrypt: 'PUBLIC',
code: 'A003',
}"
list-type="picture-card"
> >
<i class="el-icon-plus" /> <i class="el-icon-plus" />
</el-upload> </el-upload>
</el-form-item> <el-dialog :visible.sync="imgeDialogVisible" :modal="false">
<el-dialog <img width="100%" :src="form.offlineTransactionProof" />
v-el-drag-dialog
:visible.sync="imgeDialogVisible"
title="线下交易凭证"
:modal="false"
>
<img
width="100%"
:src="oilCompanyAccountReverse.offlineTransactionProofImageShow"
alt=""
/>
</el-dialog> </el-dialog>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -134,15 +108,13 @@
<script> <script>
import serve from "api/financialCenter/accountManagement.js"; import serve from "api/financialCenter/accountManagement.js";
import utils from "utils/encode"; import utils from "utils/encode";
const JSESSIONID = utils.uuid(); const JSESSIONID = utils.uuid();
export default { export default {
props: { props: {
controlWindows: Object, controlWindows: Object,
oilCompanyAccount: {
type: Object,
default() {},
},
}, },
data() { data() {
return { return {
@ -157,33 +129,9 @@ export default {
JSESSIONID: JSESSIONID, JSESSIONID: JSESSIONID,
token: utils.bcrypt(JSESSIONID), token: utils.bcrypt(JSESSIONID),
}, },
oilCompanyAccountReverse: { fileList: [],
offlineTransactionProof: undefined, form: {},
offlineTransactionProofImageShow: undefined,
companyId: this.oilCompanyAccount.companyId,
transactionType: undefined,
transactionAmount: undefined,
rechargeRebate: undefined,
offlinePaymentCompany: undefined,
offlineStartTime: undefined,
offlineCompleteTime: undefined,
transactionState: 0,
auditMark: 0,
createSource: "WEBM",
},
imgeDialogVisible: false, // 线 imgeDialogVisible: false, // 线
gridNum: {
row: {
gutter: 2,
},
cols: {
xs: 24,
sm: 24,
md: 12,
lg: 12,
xl: 6,
},
},
rules: { rules: {
transactionType: [ transactionType: [
{ required: true, message: "请选择交易类型", trigger: "change" }, { required: true, message: "请选择交易类型", trigger: "change" },
@ -191,67 +139,44 @@ export default {
transactionAmount: [ transactionAmount: [
{ required: true, message: "请输入交易金额", trigger: "blur" }, { required: true, message: "请输入交易金额", trigger: "blur" },
], ],
rechargeRebate: [
{ required: true, message: "请输入交易金额", trigger: "blur" },
],
offlinePaymentCompany: [
{
min: 5,
max: 10,
message: "长度在 5 到 10 个字符",
trigger: "blur",
},
],
}, },
companyFinance: {}, // companyFinance: {}, //
}; };
}, },
methods: { methods: {
openDrawer() {}, openDrawer() {
transactionTypeChange(type) { let { id } = this.controlWindows.addInfo;
// if (id) {
if (
this.oilCompanyAccountReverse.transactionType === "CHARGE_SALES" ||
this.oilCompanyAccountReverse.transactionType === "REVOKE"
) {
this.oilCompanyAccountReverse.rechargeRebate = 0;
this.oilCompanyAccountReverse.rechargeRebateAmount = 0;
} }
}, },
offlineTransactionProofRemove() { offlineTransactionProofRemove() {
// 线 this.form.offlineTransactionProof = "";
this.oilCompanyAccountReverse.offlineTransactionProofImageShow =
undefined;
this.oilCompanyAccountReverse.offlineTransactionProof = undefined;
}, },
offlineTransactionProofSuccess(response, file) { offlineTransactionProofSuccess(response, file) {
// 线 if (response.code !== 20000) {
console.log("response", response); this.$message.error(response.msg);
if (response.code === 20000) { this.fileList = [];
this.oilCompanyAccountReverse.offlineTransactionProof = return;
response.data.path;
} }
this.form.offlineTransactionProof = response.data.path;
}, },
offlineTransactionProofPreview(file) { offlineTransactionProofPreview(file) {
// if (!this.form.offlineTransactionProof) return;
this.oilCompanyAccountReverse.offlineTransactionProofImageShow = file.url;
this.imgeDialogVisible = true; this.imgeDialogVisible = true;
}, },
submit() { submit() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.save(this.oilCompanyAccountReverse); serve.save(this.form).then((res) => {
}
});
},
save() {
//
serve.save(this.oilCompanyAccountReverse).then((res) => {
this.$message.success(res.msg); this.$message.success(res.msg);
this.$emit("closeDialog"); this.$emit("closeDialog");
this.$emit("getByPage"); this.$emit("getByPage");
}); });
}
});
}, },
closeWindow() { closeWindow() {
this.form = {}; this.form = {};
this.$emit("closeWindow"); this.$emit("closeWindow");
@ -270,7 +195,7 @@ export default {
.el-select, .el-select,
.el-textarea, .el-textarea,
.el-autocomplete { .el-autocomplete {
width: 300px; width: 200px;
} }
} }
</style> </style>

@ -144,10 +144,7 @@
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="toRecharge(row.id)"> <el-dropdown-item @click.native="toRecharge(row.id)">
<el-button type="text"> <el-button type="text"> 充值 </el-button>
<svg-icon icon-class="iconicon-" />
充值
</el-button>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>

@ -343,6 +343,7 @@ export default {
closeWindow() { closeWindow() {
this.$emit("closeWindow"); this.$emit("closeWindow");
this.form = {}; this.form = {};
this.fileList = [];
this.controlWindows.addInfo = {}; this.controlWindows.addInfo = {};
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();

@ -104,11 +104,21 @@ export default {
controlWindows: Object, controlWindows: Object,
}, },
data() { data() {
let validatorcompanyId = (rule, value, callback) => { // let validatorcompanyId = (rule, value, callback) => {
if (this.form.companyId) callback(); // if (this.form.companyId) callback();
else callback("请选择公司"); // else callback("");
// };
let validatortransactionAmount = (rule, value, callback) => {
let typeTarget = this.correspondTypeEnum.find(
(item) => item.value === this.form.turnType
);
let superiorLimit = this.companyInfo[typeTarget.valueKey];
if (value == "") callback("请输入圈回金额");
if (value > superiorLimit) {
callback(`圈回金额不可超过${typeTarget.label}`);
}
callback();
}; };
return { return {
companyFinance: {}, companyFinance: {},
companyInfo: {}, companyInfo: {},
@ -124,14 +134,18 @@ export default {
echoName: "", echoName: "",
}, },
rules: { rules: {
companyId: [ // companyId: [
{ required: true, validator: validatorcompanyId, trigger: "change" }, // { required: true, validator: validatorcompanyId, trigger: "change" },
], // ],
turnType: [ turnType: [
{ required: true, message: "请选择交易类型", trigger: "change" }, { required: true, message: "请选择交易类型", trigger: "change" },
], ],
transactionAmount: [ transactionAmount: [
{ required: true, message: "请输入圈回金额", trigger: "blur" }, {
required: true,
validator: validatortransactionAmount,
trigger: "change",
},
], ],
reverseRemark: [ reverseRemark: [
{ required: true, message: "请输入圈回说明", trigger: "blur" }, { required: true, message: "请输入圈回说明", trigger: "blur" },
@ -143,21 +157,21 @@ export default {
label: "充值余额", label: "充值余额",
valueKey: "rechargeBalance", valueKey: "rechargeBalance",
}, },
{ // {
value: 2, // value: 2,
label: "赊销余额", // label: "",
valueKey: "chargeRechargeBalance", // valueKey: "chargeRechargeBalance",
}, // },
{ // {
value: 3, // value: 3,
label: "充值返利余额", // label: "",
valueKey: "rechargeRebateBalance", // valueKey: "rechargeRebateBalance",
}, // },
{ // {
value: 4, // value: 4,
label: "消费返利余额", // label: "",
valueKey: "consumeRebateBalance", // valueKey: "consumeRebateBalance",
}, // },
], ],
}; };
}, },

@ -31,9 +31,9 @@ export default {
}, },
methods: { methods: {
closeWindow() { closeWindow() {
this.auditRemark = ""; // this.auditRemark = "";
this.controlWindows.addInfo = {}; // this.controlWindows.addInfo = {};
this.$emit("closeWindow"); // this.$emit("closeWindow");
this.controlWindows.examine = false; this.controlWindows.examine = false;
}, },
submit() { submit() {

@ -331,7 +331,7 @@
</template> </template>
<script> <script>
import serve from "api/financialCenter/enterpriseRechargeDetails.js"; import serve from "api/financialCenter/enterpriseRecharge.js";
import commonServe from "api/common.js"; import commonServe from "api/common.js";
import add from "./components/add.vue"; import add from "./components/add.vue";

@ -258,27 +258,6 @@ export default {
// else // else
return serve.orderSave(form); return serve.orderSave(form);
}, },
//list
// findByEntity() {
// refineryServe.findByEntity().then((res) => {
// this.refineryList = res.data;
// });
// },
//
// querySearchAsync(queryString, cb) {
// if (queryString) {
// refineryServe
// .findByEntity({ refineryName: queryString })
// .then((res) => {
// let timeInstance = setTimeout(() => {
// clearTimeout(timeInstance);
// if (res.data.length) {
// cb(res.data);
// } else cb([]);
// }, 1000 * Math.random());
// });
// } else cb([]);
// },
closeWindow() { closeWindow() {
this.$emit("closeWindow"); this.$emit("closeWindow");
this.form = {}; this.form = {};

@ -65,6 +65,9 @@
show-overflow-tooltip show-overflow-tooltip
> >
</el-table-column> </el-table-column>
<el-table-column prop="productType" label="产品类型"> </el-table-column>
<el-table-column <el-table-column
prop="refineryName" prop="refineryName"
label="炼厂名称" label="炼厂名称"

Loading…
Cancel
Save