|
@@ -16,6 +16,7 @@
|
|
|
border
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
+ label="序号"
|
|
|
type="index"
|
|
|
width="50">
|
|
|
</el-table-column>
|
|
@@ -25,22 +26,23 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<span v-if="actionIndex != scope.row.id">{{ scope.row.name }}</span>
|
|
|
- <el-input v-else v-model="tableForm.name" placeholder="请输入姓名"></el-input>
|
|
|
+ <el-input size="mini" v-else v-model="tableForm.name" placeholder="请输入姓名"></el-input>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="身份证号"
|
|
|
- width="240">
|
|
|
+ width="250">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<span v-if="actionIndex != scope.row.id">{{ scope.row.idcard }}</span>
|
|
|
<el-input
|
|
|
+ size="mini"
|
|
|
v-else
|
|
|
v-model="tableForm.idcard"
|
|
|
placeholder="请输入身份证号"
|
|
|
clearable
|
|
|
- style="width: 240px;"
|
|
|
+ style="width: 230px;"
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
>
|
|
|
<el-button slot="append" :loading="idcardLoading" size="mini" type="primary" @click="readCert">{{ idcardLoading ? '识别中':'识别' }}</el-button>
|
|
@@ -70,11 +72,17 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="人员类别"
|
|
|
- width="180">
|
|
|
+ width="130">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <span v-if="actionIndex != scope.row.id">{{ scope.row.identity }}</span>
|
|
|
+ <span v-if="actionIndex != scope.row.id">{{
|
|
|
+ scope.row.identity?
|
|
|
+ personnelType.find((item)=>{
|
|
|
+ return item.id == scope.row.identity
|
|
|
+ }).name : ''
|
|
|
+ }}</span>
|
|
|
<el-select
|
|
|
+ size="mini"
|
|
|
v-else
|
|
|
v-model="tableForm.identity"
|
|
|
placeholder="请选择人员类别"
|
|
@@ -94,11 +102,11 @@
|
|
|
<el-table-column
|
|
|
label="应付金额(元)">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.realPrice }}</span>
|
|
|
- <!-- <div>
|
|
|
+ <!-- <span>{{ scope.row.realPrice }}</span> -->
|
|
|
+ <div>
|
|
|
<span v-if="actionIndex != scope.row.id">{{ scope.row.realPrice }}</span>
|
|
|
- <el-input v-else v-model="tableForm.realPrice" placeholder="请输入应付金额(元)"></el-input>
|
|
|
- </div> -->
|
|
|
+ <el-input-number size="mini" style="width: 120px;" v-else v-model="tableForm.realPrice" controls-position="right" label="请输入应付金额(元)"></el-input-number>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -107,27 +115,30 @@
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<span v-if="actionIndex != scope.row.id">{{ scope.row.remark }}</span>
|
|
|
- <el-input v-else v-model="tableForm.remark" placeholder="请输入备注"></el-input>
|
|
|
+ <el-input size="mini" v-else v-model="tableForm.remark" placeholder="请输入备注"></el-input>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
- width="180">
|
|
|
+ width="80"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
+ type="success"
|
|
|
v-if="actionIndex == scope.row.id"
|
|
|
@click="handleSeva(scope.$index, scope.row)">保存</el-button>
|
|
|
<el-button
|
|
|
:disabled="!!actionIndex"
|
|
|
size="mini"
|
|
|
+ type="primary"
|
|
|
v-if="actionIndex != scope.row.id"
|
|
|
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
size="mini"
|
|
|
type="danger"
|
|
|
- @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
|
|
+ @click="handleDelete(scope.$index, scope.row)">删除</el-button> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -138,34 +149,34 @@
|
|
|
:model="ruleForm"
|
|
|
:rules="rules"
|
|
|
ref="ruleForm11"
|
|
|
- label-width="100px"
|
|
|
+ label-width="120px"
|
|
|
class="demo-ruleForm"
|
|
|
size="mini"
|
|
|
>
|
|
|
|
|
|
- <el-form-item label="用户来源:" prop="source">
|
|
|
+ <el-form-item label="用户来源 :" prop="source">
|
|
|
<el-radio-group v-model="ruleForm.source">
|
|
|
<el-radio label="7">窗口</el-radio>
|
|
|
<el-radio label="2">美团</el-radio>
|
|
|
<el-radio label="3">携程</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="ruleForm.resource && ruleForm.resource != 1" label="核销码/订单码" prop="orderIdOrQrCode">
|
|
|
- <el-input style="width: 200px;" v-model="ruleForm.orderIdOrQrCode"></el-input>
|
|
|
+ <el-form-item v-if="ruleForm.source && ruleForm.source != 7" label="核销码/订单码" prop="orderIdOrQrCode">
|
|
|
+ <el-input style="width: 400px;" v-model="ruleForm.orderIdOrQrCode"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="支付方式:" prop="paymentType">
|
|
|
+ <el-form-item label="支付方式 :" prop="paymentType">
|
|
|
<el-radio-group v-model="ruleForm.paymentType">
|
|
|
<el-radio label="1">扫码</el-radio>
|
|
|
<el-radio label="2">现金</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="应付金额:">
|
|
|
+ <el-form-item label="应付金额 :">
|
|
|
¥{{ moneyAll }}元
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="ruleForm.paymentType == 2" label="实付金额:" prop="realPrice">
|
|
|
+ <el-form-item v-if="ruleForm.paymentType == 2" label="实付金额 :" prop="realPrice">
|
|
|
<el-input @input="setRealPrice" style="width: 200px;" v-model="ruleForm.realPrice"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="找零金额:" v-if="ruleForm.paymentType == 2">
|
|
|
+ <el-form-item label="找零金额 :" v-if="ruleForm.paymentType == 2">
|
|
|
¥{{ ruleForm.small }}元
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -173,8 +184,8 @@
|
|
|
<!-- 支付过程 控制 -->
|
|
|
<div v-if="payStatus" class="increase-viewers-pay-status">
|
|
|
<div class="increase-viewers-pay-status-info">
|
|
|
- <span>提示</span>
|
|
|
- <span>
|
|
|
+ <span style="font-weight: 600;font-size: 20px;">提示</span>
|
|
|
+ <span style="padding: 10px 0;">
|
|
|
{{ payStatus==1 ? '生成订单失败!!!' :
|
|
|
payStatus==2 ? '生成订单生成成功,请点击调取扫码盒子' :
|
|
|
payStatus==4 ? '扫码支付失败!!!' :
|
|
@@ -182,7 +193,7 @@
|
|
|
payStatus==6 ? '连接扫码器失败!!!' :
|
|
|
payStatus==7 ? '用户支付失败或未支付,请重新连接支付!!!' :
|
|
|
payStatus==8 ? '用户支付成功,请点击打印票!!!' :
|
|
|
- payStatus==3 ? '' : '未知状态' }}
|
|
|
+ payStatus==3 ? '现金支付记录入库失败,请重新提交' : '未知状态' }}
|
|
|
</span>
|
|
|
<!-- 重新生成订单 1 -->
|
|
|
<el-button v-if="payStatus==1" @click="orderInfoSubmitFun()" type="primary">重新生成订单</el-button>
|
|
@@ -191,7 +202,7 @@
|
|
|
<!-- 扫码支付 4 -->
|
|
|
<el-button v-if="payStatus==4" @click="vbar_open(orderId)" type="success">重新扫码支付</el-button>
|
|
|
<!-- 重新支付 3 -->
|
|
|
- <el-button v-if="payStatus==3" @click="gotoCashPayFun(orderId)" type="success">重新支付</el-button>
|
|
|
+ <el-button v-if="payStatus==3" @click="gotoCashPayFun(orderId)" type="success">重新提交入库</el-button>
|
|
|
<!-- 重新支付 6 7 -->
|
|
|
<el-button v-if="payStatus==6 || payStatus==7" @click="vbar_open(orderId)" type="success">重新连接扫码支付</el-button>
|
|
|
<!-- 打印 8 -->
|
|
@@ -207,7 +218,7 @@
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="handleClose()">取 消</el-button>
|
|
|
- <el-button v-if="!orderId" :loading="loading" type="primary" @click="submitForm('ruleForm11')">确定支付</el-button>
|
|
|
+ <el-button v-if="!orderId&&!payStatus" :loading="loading" type="primary" @click="submitForm('ruleForm11')">确定支付</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
@@ -226,6 +237,7 @@ import {
|
|
|
} from '@/api/windowTicketSales/ticketingSales'
|
|
|
import { pageList as getPrintListApi } from "@/api/device/pda";
|
|
|
import { printApi } from '@/api/windowTicketSales/ticketingCollection'
|
|
|
+ const mathM = require('mathjs')
|
|
|
const https = require('https');
|
|
|
const axios = require('axios');
|
|
|
export default {
|
|
@@ -273,7 +285,7 @@ import {
|
|
|
{ required: true, message: '请选择支付方式', trigger: ['blur','change']},
|
|
|
],
|
|
|
realPrice: [
|
|
|
- { required: true, message: '请输入核销码/订单码', trigger: ['blur','change']},
|
|
|
+ { required: true, message: '请输入实付金额', trigger: ['blur','change']},
|
|
|
],
|
|
|
},
|
|
|
moneyAll: '',
|
|
@@ -442,7 +454,7 @@ import {
|
|
|
this.$message.error('请输入身份证号!!!');
|
|
|
return
|
|
|
}
|
|
|
- if(this.tableForm.identity){
|
|
|
+ if(this.tableForm.identity && this.tableForm.identity != 0){
|
|
|
if(!this.tableForm.remark){
|
|
|
this.$message.error('请输入备注!!!');
|
|
|
return
|
|
@@ -466,7 +478,7 @@ import {
|
|
|
this.viewerList.forEach((item,index) => {
|
|
|
console.log("item.realPrice====",item.realPrice)
|
|
|
if(item.realPrice && !isNaN(Number(item.realPrice))) {
|
|
|
- moneyAll = moneyAll + Number(item.realPrice)
|
|
|
+ moneyAll = mathM.format(Number(moneyAll) + Number(item.realPrice),10)
|
|
|
}
|
|
|
})
|
|
|
console.log("dsfsfdsf",moneyAll)
|
|
@@ -474,13 +486,40 @@ import {
|
|
|
},
|
|
|
setRealPrice(value) {
|
|
|
if(value && !isNaN(value)) {
|
|
|
- this.$set(this.ruleForm,'small',Number(value) - this.moneyAll )
|
|
|
+ this.$set(this.ruleForm,'small',mathM.format(Number(value) - Number(this.moneyAll),10) )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 检查是否存在空值 */
|
|
|
+ checkViewerList() {
|
|
|
+ let flog = false
|
|
|
+ for(let i = 0; i < this.viewerList.length; i++){
|
|
|
+ let obj = this.viewerList[i]
|
|
|
+ if(!this.tableForm.name){
|
|
|
+ this.$message.error('请填写观影人姓名!!!');
|
|
|
+ flog = true
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if(!this.tableForm.idcard){
|
|
|
+ this.$message.error('请填写观影人身份证号!!!');
|
|
|
+ flog = true
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if(this.tableForm.identity && this.tableForm.identity != 0){
|
|
|
+ if(!this.tableForm.remark){
|
|
|
+ this.$message.error('请填写观影人备注!!!');
|
|
|
+ flog = true
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ return flog
|
|
|
},
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.orderInfoSubmitFun()
|
|
|
+ if(!this.checkViewerList()){
|
|
|
+ this.orderInfoSubmitFun()
|
|
|
+ }
|
|
|
} else {
|
|
|
console.log('error submit!!');
|
|
|
return false;
|
|
@@ -503,8 +542,9 @@ import {
|
|
|
if(res.code == 200){
|
|
|
this.orderId = res.data.orderId
|
|
|
if(this.ruleForm.paymentType == 2) {
|
|
|
- this.gotoCashPayFun()
|
|
|
+ this.gotoCashPayFun(this.orderId)
|
|
|
}else {
|
|
|
+ // 扫码支付
|
|
|
this.loading = false
|
|
|
this.payStatus = 2
|
|
|
}
|
|
@@ -555,7 +595,7 @@ import {
|
|
|
async gotoCashPayFun(orderId){
|
|
|
this.loading = true
|
|
|
try {
|
|
|
- this.loadingText = "订单支付中..."
|
|
|
+ this.loadingText = "订单入库中..."
|
|
|
let res = await gotoCashPay({
|
|
|
"orderId": orderId // 订单编号-提交订单返回
|
|
|
})
|
|
@@ -567,12 +607,12 @@ import {
|
|
|
this.payQueryFun(this.orderId)
|
|
|
},1500)
|
|
|
}else{
|
|
|
- this.$message.error('支付失败!!!');
|
|
|
+ this.$message.error('订单入库中失败!!!');
|
|
|
this.loading = false
|
|
|
this.payStatus = 3
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- this.$message.error('支付失败!!!');
|
|
|
+ this.$message.error('订单入库中失败!!!');
|
|
|
this.loading = false
|
|
|
this.payStatus = 3
|
|
|
}
|
|
@@ -582,7 +622,11 @@ import {
|
|
|
async payQueryFun(orderId){
|
|
|
this.loading = true
|
|
|
try {
|
|
|
- this.loadingText = "订单支付中..."
|
|
|
+ if(this.ruleForm.paymentType == 2){
|
|
|
+ this.loadingText = "订单入库中..."
|
|
|
+ }else {
|
|
|
+ this.loadingText = "订单支付中..."
|
|
|
+ }
|
|
|
this.payStatus = ''
|
|
|
let res = await payQuery({
|
|
|
orderId: orderId
|
|
@@ -593,34 +637,64 @@ import {
|
|
|
if(this.payTime){
|
|
|
clearInterval(this.payTime)
|
|
|
}
|
|
|
- this.$message.error('用户未支付!!!');
|
|
|
- this.loading = false
|
|
|
- this.payStatus = 7
|
|
|
+ if(this.ruleForm.paymentType == 2){
|
|
|
+ this.$message.error('"订单入库中失败"');
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 3
|
|
|
+ }else {
|
|
|
+ this.$message.error('用户未支付!!!');
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 7
|
|
|
+ }
|
|
|
+
|
|
|
}else if(res.data.payStatus == 1) {
|
|
|
if(this.payTime){
|
|
|
clearInterval(this.payTime)
|
|
|
}
|
|
|
- this.$message('用户已支付!!!');
|
|
|
- // 开始 打印
|
|
|
- this.loading = false
|
|
|
- this.payStatus = 8
|
|
|
- this.getPrintListApi()
|
|
|
+ if(this.ruleForm.paymentType == 2){
|
|
|
+ this.$message.error('"订单入库中成功"');
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 8
|
|
|
+ this.getPrintListApi()
|
|
|
+ }else {
|
|
|
+ this.$message('用户已支付!!!');
|
|
|
+ // 开始 打印
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 8
|
|
|
+ this.getPrintListApi()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}else if(res.data.payStatus == 2) {
|
|
|
|
|
|
}else if(res.data.payStatus == 3) {
|
|
|
if(this.payTime){
|
|
|
clearInterval(this.payTime)
|
|
|
}
|
|
|
- this.$message.error('用户支付失败!!!');
|
|
|
- this.loading = false
|
|
|
- this.payStatus = 7
|
|
|
+ if(this.ruleForm.paymentType == 2){
|
|
|
+ this.$message.error('"订单入库中失败"');
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 3
|
|
|
+ }else {
|
|
|
+ this.$message.error('用户支付失败!!!');
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 7
|
|
|
+ }
|
|
|
}else if(res.data.payStatus == 4) {
|
|
|
if(this.payTime){
|
|
|
clearInterval(this.payTime)
|
|
|
}
|
|
|
- this.$message.error('支付退款!!!');
|
|
|
- this.loading = false
|
|
|
- this.payStatus = 7
|
|
|
+
|
|
|
+ if(this.ruleForm.paymentType == 2){
|
|
|
+ this.$message.error('"订单入库中失败"');
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 3
|
|
|
+ }else {
|
|
|
+ this.$message.error('支付退款!!!');
|
|
|
+ this.loading = false
|
|
|
+ this.payStatus = 7
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|