|
|
@@ -145,7 +145,7 @@
|
|
|
show-word-limit></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button :loading="loading" :disabled="isFlag" type="danger"
|
|
|
+ <el-button :loading="loading" :disabled="isFlag || !isDisabled" type="danger"
|
|
|
style="width: 120px;height: 40px;font-size: 18px;" @click="submitForm('ruleForm11')">结 算</el-button>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -162,7 +162,13 @@
|
|
|
</span> -->
|
|
|
|
|
|
<!-- 添加 观影人员实名 -->
|
|
|
- <el-dialog title="观影人员实名" modal-append-to-body :close-on-click-modal="false" :visible.sync="isVisible" width="85%">
|
|
|
+ <el-dialog title="观影人员实名"
|
|
|
+ modal-append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :visible.sync="isVisible"
|
|
|
+ @close="closeVisible"
|
|
|
+ width="85%"
|
|
|
+ >
|
|
|
<el-form :model="ValidateForm" ref="validateForm" label-width="90px">
|
|
|
<el-form-item prop="type" label="证件类型:">
|
|
|
<el-select v-model="ValidateForm.type" placeholder="请选择活动区域">
|
|
|
@@ -253,7 +259,7 @@
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button :disabled="isFlag" type="primary" @click="handleSubmit">保 存</el-button>
|
|
|
- <el-button @click="isVisible = false">取 消</el-button>
|
|
|
+ <el-button @click="closeVisible">取 消</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -431,7 +437,8 @@ export default {
|
|
|
grantQuota: null, // 授信使用额度
|
|
|
|
|
|
code: '', // 支付code
|
|
|
- codeTime: null // 检测是websocket是否还在连接
|
|
|
+ codeTime: null, // 检测是websocket是否还在连接
|
|
|
+ isDisabled: true,
|
|
|
};
|
|
|
|
|
|
},
|
|
|
@@ -455,6 +462,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 控制 结算按钮
|
|
|
+ setFlag() {
|
|
|
+ this.isDisabled = false;
|
|
|
+ },
|
|
|
async initData(list, params) {
|
|
|
try {
|
|
|
this.code = ''
|
|
|
@@ -464,6 +475,7 @@ export default {
|
|
|
this.personnelNum = params.personnelNum // 人员要求:0-表示不限制 其他数字表示限制人数
|
|
|
this.websocketClear()
|
|
|
this.idcardLoading = false
|
|
|
+ this.isDisabled = true;
|
|
|
this.ruleForm = {
|
|
|
performId: params.performId, // 剧目ID
|
|
|
retailId: "", // 分销ID
|
|
|
@@ -487,16 +499,16 @@ export default {
|
|
|
remark: '', // 订单备注
|
|
|
sourceRemark: '', // 来源备注
|
|
|
}
|
|
|
- console.log(this.ruleForm, 'this.ruleForm');
|
|
|
+ // console.log(this.ruleForm, 'this.ruleForm');
|
|
|
this.payStatus = null
|
|
|
this.orderId = null
|
|
|
this.websocket_connected = false
|
|
|
// this.dialogVisible = true
|
|
|
// this.loading = true
|
|
|
this.actionIndex = null
|
|
|
- this.viewerList = []
|
|
|
+ // this.viewerList = []
|
|
|
let perform = await this.selectRegionFun(params, list[0].seatTypeId)
|
|
|
- // console.log("perform===", perform)
|
|
|
+ console.log("perform===", perform)
|
|
|
// let perform = {
|
|
|
// money: params.salePrice,
|
|
|
// //name: params.goodsName,
|
|
|
@@ -505,19 +517,21 @@ export default {
|
|
|
// }
|
|
|
let listCopy = []
|
|
|
if (list.length > 0) {
|
|
|
- console.log(list, 'list11');
|
|
|
-
|
|
|
+ // console.log(list, 'list11');
|
|
|
this.ifShow = true
|
|
|
list.forEach((item, index) => {
|
|
|
listCopy.push({
|
|
|
- id: index + 1,
|
|
|
+ // id: index + 1,
|
|
|
+ id: this.uniqueNumberId(),
|
|
|
name: '', // 姓名
|
|
|
mobile: '', // 电话
|
|
|
idcard: '', // 身份证
|
|
|
identity: '0', // 观影人身份
|
|
|
remark: '', // 备注信息
|
|
|
- salePrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0) ? index == 0 ? perform.money : 0 : perform.money, // 原价
|
|
|
- realPrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0) ? index == 0 ? perform.money : 0 : perform.money, // 实收金额
|
|
|
+ // salePrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0) ? index == 0 ? perform.money : 0 : perform.money, // 原价
|
|
|
+ // realPrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0) ? index == 0 ? perform.money : 0 : perform.money, // 实收金额
|
|
|
+ salePrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0) ? index == 0 ? item.salePrice : 0 : item.salePrice, // 原价
|
|
|
+ realPrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0) ? index == 0 ? item.salePrice : 0 : item.salePrice, // 实收金额
|
|
|
seatId: item.id, // 座位ID
|
|
|
seatName: item.name ? item.name : '暂无命名', // 座位名称
|
|
|
seatType: perform.seatTypeId, // 座位类型
|
|
|
@@ -525,19 +539,39 @@ export default {
|
|
|
seatTypeName: perform.seatTypeName,
|
|
|
})
|
|
|
})
|
|
|
+ if(this.viewerList.length > 0){
|
|
|
+ // 创建一个 Map 来存储 listCopy 的数据,以 seatId 为键
|
|
|
+ const map = new Map(listCopy.map(item => [item.seatId, item]));
|
|
|
+ // 遍历 this.viewerList,如果有相同的 seatId 就替换
|
|
|
+ this.viewerList.forEach(item => {
|
|
|
+ if (map.has(item.seatId)) {
|
|
|
+ const existing = map.get(item.seatId);
|
|
|
+ let obj1 = {
|
|
|
+ name: item.name, // 姓名
|
|
|
+ idcard: item.idcard, // 身份证
|
|
|
+ identity: item.identity, // 观影人身份
|
|
|
+ remark: item.remark, // 备注信息
|
|
|
+ }
|
|
|
+ map.set(item.seatId, {...existing, ...obj1}); // 替换
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.viewerList = Array.from(map.values());
|
|
|
+ } else {
|
|
|
+ this.viewerList = JSON.parse(JSON.stringify(listCopy))
|
|
|
+ }
|
|
|
} else {
|
|
|
- console.log(list, 'list12221');
|
|
|
this.ifShow = false
|
|
|
+ this.viewerList = []
|
|
|
}
|
|
|
//this.goodsList =
|
|
|
- this.viewerList = JSON.parse(JSON.stringify(listCopy))
|
|
|
+ // this.viewerList = JSON.parse(JSON.stringify(listCopy))
|
|
|
if (list.length > 0) {
|
|
|
this.setMoneyAll()
|
|
|
} else {
|
|
|
this.moneyAll = ''
|
|
|
this.$set(this.ruleForm, 'realPrice', this.moneyAll)
|
|
|
}
|
|
|
- // console.log(this.viewerList)
|
|
|
+ console.log(this.viewerList,'3333')
|
|
|
// this.loading = false
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
@@ -548,6 +582,10 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ // 随机数
|
|
|
+ uniqueNumberId() {
|
|
|
+ return Number(Date.now() + Math.floor(Math.random() * 1000));
|
|
|
+ },
|
|
|
/** 获取票务信息 */
|
|
|
async selectRegionFun(params, seatTypeId) {
|
|
|
try {
|
|
|
@@ -614,6 +652,11 @@ export default {
|
|
|
handleRealName() {
|
|
|
this.isVisible = true
|
|
|
},
|
|
|
+ // 关闭 实名信息弹框
|
|
|
+ closeVisible() {
|
|
|
+ this.isVisible = false
|
|
|
+ this.actionIndex = null
|
|
|
+ },
|
|
|
// 保存 观影人员实名信息
|
|
|
handleSubmit() {
|
|
|
this.isVisible = false
|
|
|
@@ -1333,7 +1376,7 @@ export default {
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
// 组件销毁前执行的代码
|
|
|
- console.log('组件即将销毁');
|
|
|
+ // console.log('组件即将销毁');
|
|
|
document.removeEventListener('keydown', this.keydownAdd);
|
|
|
},
|
|
|
}
|