|
@@ -48,6 +48,7 @@
|
|
|
placeholder="选择演出厅"
|
|
|
clearable
|
|
|
style="width: 100%"
|
|
|
+ @change="getInventoryTemplate"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="dict in merchantList"
|
|
@@ -237,7 +238,7 @@ export default {
|
|
|
/** 获取票务 */
|
|
|
this.goodsPageList(); // 剧目列表
|
|
|
this.merchantPageList('') // 演出厅
|
|
|
- this.getInventoryTemplate()
|
|
|
+ //this.getInventoryTemplate()
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
@@ -342,16 +343,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/** 获取模板 */
|
|
|
- async getInventoryTemplate(){
|
|
|
+ async getInventoryTemplate(value){
|
|
|
try {
|
|
|
+ if(this.form.planSessionList && this.form.planSessionList.length > 0) {
|
|
|
+ let list = JSON.parse(JSON.stringify(this.form.planSessionList))
|
|
|
+ list.forEach((item,index)=>{
|
|
|
+ list[index].stockTmpId = null
|
|
|
+ })
|
|
|
+ this.$set(this.form,'planSessionList',list)
|
|
|
+ }
|
|
|
+ if(!value) {
|
|
|
+ this.inventoryTemplateList = []
|
|
|
+ return
|
|
|
+ }
|
|
|
let res = await getInventoryTemplateApi({
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 1000,
|
|
|
- })
|
|
|
+ auditoriumId: value,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ })
|
|
|
if(res.code == 200){
|
|
|
this.inventoryTemplateList = res.data.rows
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
+ } catch (error) {
|
|
|
+ console.error("error===",error)
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
@@ -369,6 +383,10 @@ export default {
|
|
|
postEdit.goodsIds = postEdit.goodsIds.join(',')
|
|
|
postEdit.weekDay = postEdit.weekDay.join(','),
|
|
|
delete postEdit.performDate
|
|
|
+ if(this.checkList(this.form.planSessionList)) {
|
|
|
+ this.$message.error("请完善场次信息!");
|
|
|
+ return
|
|
|
+ }
|
|
|
this.loading = true;
|
|
|
const { code } = await saveAndEdit({ ...postEdit });
|
|
|
if (code === 200) {
|
|
@@ -384,6 +402,25 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ checkList(list){
|
|
|
+ let flog = false
|
|
|
+ if(list&&list.length>0) {
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
+ let list2 = ['name', 'startInterval', 'endInterval', 'stockTmpId']
|
|
|
+ for (let i = 0; i < list2.length; i++) {
|
|
|
+ if(list[index].hasOwnProperty(list2[i]) && !list[index][list2[i]]) {
|
|
|
+ console.log(list[index].hasOwnProperty(list2[i]),list[index][list2[i]])
|
|
|
+ flog = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(flog) {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return flog
|
|
|
+ },
|
|
|
/**
|
|
|
* 重置
|
|
|
* @date 2023-11-22
|