|
@@ -1,23 +1,26 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="90px">
|
|
|
- <el-row v-for="(item,index) in ruleForm.formList" :key="index" style="border-bottom: 1px solid #f0f0f0;padding: 10px;">
|
|
|
- <el-form-item label="支付模板" style="width: 110px;" :prop="'formList.' + index + '.payMode'">
|
|
|
+ <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="110px">
|
|
|
+ <el-form-item label="支付模板" prop="payMode">
|
|
|
<el-upload
|
|
|
- action="上传地址"
|
|
|
+ action="http://localhost:8080/img"
|
|
|
+ ref="upload"
|
|
|
+ multiple
|
|
|
list-type="picture-card"
|
|
|
+ :auto-upload="false"
|
|
|
+ accept=".jpeg,.jpg,.png,"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
- :on-remove="handleRemove">
|
|
|
- <i class="el-icon-plus"></i>
|
|
|
+ :limit="5"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ >
|
|
|
+ <i slot="default" class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
<el-dialog :visible.sync="dialogVisible">
|
|
|
<img width="100%" :src="dialogImageUrl" alt="">
|
|
|
</el-dialog>
|
|
|
</el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row v-for="(item,index) in ruleForm.formList" :key="index" style="border-bottom: 1px solid #f0f0f0;padding: 10px;">
|
|
|
- <el-form-item label="支付页面形象照" style="width: 110px;" prop="'formList.' + index + '.imagePhotosFlag'">
|
|
|
- <el-radio-group v-model="item.imagePhotosFlag">
|
|
|
+ <el-form-item label="支付页面形象照" >
|
|
|
+ <el-radio-group v-model="ruleForm.imagePhotosFlag">
|
|
|
<el-radio
|
|
|
v-for="dict in imagePhotosFlagOptions"
|
|
|
:key="dict.dictValue"
|
|
@@ -25,10 +28,8 @@
|
|
|
>{{dict.dictLabel}}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row v-for="(item,index) in ruleForm.formList" :key="index" style="border-bottom: 1px solid #f0f0f0;padding: 10px;">
|
|
|
- <el-form-item label="电子会员卡" style="width: 110px;" prop="'formList.' + index + '.cardEnabledFlag'">
|
|
|
- <el-radio-group v-model="item.cardEnabledFlag">
|
|
|
+ <el-form-item label="电子会员卡">
|
|
|
+ <el-radio-group v-model="ruleForm.cardEnabledFlag">
|
|
|
<el-radio
|
|
|
v-for="dict in cardEnabledFlagOptions"
|
|
|
:key="dict.dictValue"
|
|
@@ -36,20 +37,16 @@
|
|
|
>{{dict.dictLabel}}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row v-for="(item,index) in ruleForm.formList" :key="index" style="border-bottom: 1px solid #f0f0f0;padding: 10px;" >
|
|
|
- <el-form-item label="支付回调页面" style="width: 110px;" :prop="'formList.' + index + '.payCallbackPage'">
|
|
|
- <el-input v-model="item.payCallbackPage" placeholder="请输入支付回调页面配置" />
|
|
|
+ <el-form-item label="支付回调" prop="payCallbackPage">
|
|
|
+ <el-input v-model="ruleForm.payCallbackPage" placeholder="请输入支付回调页面配置" style="width: 200px"/>
|
|
|
+ <el-button>前往配置</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row v-for="(item,index) in ruleForm.formList" :key="index" style="border-bottom: 1px solid #f0f0f0;padding: 10px;">
|
|
|
- <el-form-item label="打印张数" style="width: 110px;" :prop="'formList.' + index + '.payPrintNum'">
|
|
|
- <el-input v-model="item.payPrintNum" placeholder="请输入支付小票打印张数" />
|
|
|
+ <el-form-item label="打印张数" prop="payPrintNum">
|
|
|
+ <el-input-number size="small" :min="0" v-model="ruleForm.payPrintNum" />
|
|
|
+ <span> 张 </span>
|
|
|
</el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row v-for="(item,index) in ruleForm.formList" :key="index" style="border-bottom: 1px solid #f0f0f0;padding: 10px;">
|
|
|
- <el-form-item label="班结是否打印" style="width: 110px;" :prop="'formList.' + index + '.wsPrintFlag'">
|
|
|
- <el-radio-group v-model="item.wsPrintFlag">
|
|
|
+ <el-form-item label="班结是否打印" >
|
|
|
+ <el-radio-group v-model="ruleForm.wsPrintFlag">
|
|
|
<el-radio
|
|
|
v-for="dict in wsPrintFlagOptions"
|
|
|
:key="dict.dictValue"
|
|
@@ -57,46 +54,36 @@
|
|
|
>{{dict.dictLabel}}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- </el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {addPay, updatePay,getStationPay} from "@/api/station/pay";
|
|
|
-
|
|
|
export default {
|
|
|
name: "Pay",
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
- loading: true,
|
|
|
imagePhotosFlagOptions:[],
|
|
|
wsPrintFlagOptions:[],
|
|
|
cardEnabledFlagOptions:[],
|
|
|
dialogImageUrl: '',
|
|
|
dialogVisible: false,
|
|
|
- ruleForm: {
|
|
|
- formList: [
|
|
|
- {
|
|
|
- payMode: "",
|
|
|
- imagePhotosFlag: "",
|
|
|
- cardEnabledFlag: "",
|
|
|
- payPrintNum: "",
|
|
|
- payCallbackPage: "",
|
|
|
- wsPrintFlag: ""
|
|
|
- }
|
|
|
- ]
|
|
|
+ ruleForm:{
|
|
|
+
|
|
|
},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.handleUpdate();
|
|
|
+ this.look();
|
|
|
this.getDicts("image_photos_flag").then(response => {
|
|
|
this.imagePhotosFlagOptions = response.data;
|
|
|
});
|
|
@@ -106,7 +93,6 @@ export default {
|
|
|
this.getDicts("card_enabled_flag").then(response => {
|
|
|
this.cardEnabledFlagOptions = response.data;
|
|
|
});
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
handleRemove(file, fileList) {
|
|
@@ -116,29 +102,29 @@ export default {
|
|
|
this.dialogImageUrl = file.url;
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate() {
|
|
|
+ /** 进入信息 */
|
|
|
+ look() {
|
|
|
getStationPay().then(response => {
|
|
|
- this.ruleForm.formList = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "油站支付设置";
|
|
|
+ this.ruleForm = response.data;
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["ruleForm"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.payId != null) {
|
|
|
- updatePay(this.form).then(response => {
|
|
|
+ if (this.ruleForm.payId != null) {
|
|
|
+ updatePay(this.ruleForm).then(response => {
|
|
|
this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
+ getStationPay().then(response => {
|
|
|
+ this.ruleForm = response.data;
|
|
|
+ });
|
|
|
});
|
|
|
} else {
|
|
|
- addPay(this.form).then(response => {
|
|
|
+ addPay(this.ruleForm).then(response => {
|
|
|
this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
+ getStationPay().then(response => {
|
|
|
+ this.ruleForm = response.data;
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|