|
|
@@ -545,8 +545,8 @@
|
|
|
arrow-control
|
|
|
style="width: 95%"
|
|
|
v-model="scope.row.startTime"
|
|
|
- format="HH:mm"
|
|
|
- value-format="HH:mm"
|
|
|
+ format="HH:mm:ss"
|
|
|
+ value-format="HH:mm:ss"
|
|
|
placeholder="开始时间">
|
|
|
</el-time-picker>
|
|
|
</template>
|
|
|
@@ -558,8 +558,8 @@
|
|
|
arrow-control
|
|
|
v-model="scope.row.endTime"
|
|
|
style="width: 95%"
|
|
|
- format="HH:mm"
|
|
|
- value-format="HH:mm"
|
|
|
+ format="HH:mm:ss"
|
|
|
+ value-format="HH:mm:ss"
|
|
|
placeholder="结束时间">
|
|
|
</el-time-picker>
|
|
|
</template>
|
|
|
@@ -816,7 +816,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { addTicket, updateTicket, queueList } from '@/api/ticketType'
|
|
|
+import { addTicket, updateTicket, queueList, addTicketBatch, updateTicketBatch, deleteTicketBatch } from '@/api/ticketType'
|
|
|
import { getLabelName, cloneDeep } from '@/utils'
|
|
|
import moment from 'moment'
|
|
|
|
|
|
@@ -1101,8 +1101,33 @@ export default {
|
|
|
deleteBachConfig (index, row) {
|
|
|
this.form.batchConfigList.splice(index, 1)
|
|
|
console.log(row)
|
|
|
+ if (row.id) {
|
|
|
+ deleteTicketBatch([row.id]).then(res => {
|
|
|
+ if (res.code !== '200') {
|
|
|
+ this.$message.error(res.msg || '删除失败')
|
|
|
+ } else {
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async saveAllBatchConfig () {
|
|
|
+ const ticketTypeId = this.form.id
|
|
|
+ const updateBatchList = this.form.batchConfigList.map(item => {
|
|
|
+ if (item.id) {
|
|
|
+ return updateTicketBatch(item)
|
|
|
+ } else {
|
|
|
+ return addTicketBatch(ticketTypeId, item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ return Promise.all(updateBatchList).then(res => {
|
|
|
+ if (res.some(item => item.code !== '200')) {
|
|
|
+ this.$message.error('时间场次保存失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- submit () {
|
|
|
+ async submit () {
|
|
|
this.$refs.form.validate(valid => {
|
|
|
// 会员不检查景点
|
|
|
|
|
|
@@ -1132,10 +1157,34 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ if (this.form.category === 'batch') {
|
|
|
+ if (this.form.batchConfigList.length === 0) {
|
|
|
+ this.$message.error('请添加场次时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.form.batchConfigList.some(item => !item.name)) {
|
|
|
+ this.$message.error('场次名称不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.form.batchConfigList.some(item => !item.startTime)) {
|
|
|
+ this.$message.error('场次开始时间不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.form.batchConfigList.some(item => !item.endTime)) {
|
|
|
+ this.$message.error('场次结束时间不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!this.isScenicValid()) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ this.saveAllBatchConfig()
|
|
|
+
|
|
|
// if (moment('2019-01-21 ' + this.form.useDateStart).isAfter('2019-01-21 ' + this.form.useDateEnd)) {
|
|
|
// this.$message.error('当日游玩开始时间不可晚于结束时间')
|
|
|
// return
|