邹畅 3 years ago
parent
commit
f258da0ef0
1 changed files with 192 additions and 120 deletions
  1. 312
      src/views/sce/sceInfo/index.vue

312
src/views/sce/sceInfo/index.vue

@ -98,6 +98,7 @@
:title="dialog.title"
:visible.sync="dialog.Visible"
width="1000px"
:before-close="handleClose"
>
<el-form
ref="ruleForm"
@ -153,7 +154,12 @@
</el-upload>
</el-form-item>
<el-form-item label="其它图片" style="width:100%">
<div v-for="(item, l) in dataImg" :key="l" class="imgdata" style="margin-left:10px;">
<div
v-for="(item, l) in dataImg"
:key="l"
class="imgdata"
style="margin-left:10px;"
>
<el-image
style="width: 146px; height: 146px"
:src="item"
@ -235,74 +241,113 @@
/>
</el-form-item>
<h3 class="form-title">开本流程</h3>
<el-table
v-if="type == 'add' || type == 'edit'"
:header-cell-style="{ background: '#eee', color: '#606266' }"
:data="ruleForm.processesList"
border
style="width: 90%;margin-left:30px;"
>
<el-table-column
align="center"
type="index"
label="序号"
width="50"
/>
<el-table-column align="center" property="title" label="流程标题" width="130">
<template slot-scope="scope">
<el-input v-model="ruleForm.processesList[scope.$index].title" />
</template>
</el-table-column>
<el-table-column align="center" property="code" label="流程编号" width="100">
<template slot-scope="scope">
<el-input
@input="changCode"
v-model="ruleForm.processesList[scope.$index].code"
/>
</template>
</el-table-column>
<el-table-column align="center" property="introduction" label="简介">
<template slot-scope="scope">
<el-input
v-model="ruleForm.processesList[scope.$index].introduction"
/>
</template>
</el-table-column>
<el-table-column align="center" property="sort" label="排序" width="100">
<template slot-scope="scope">
<el-input type="number" @mousewheel.native.prevent @keyup.native="prevent($event)" v-model="ruleForm.processesList[scope.$index].sort" />
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="Del(scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<el-table
v-if="type == 'view'"
:header-cell-style="{ background: '#eee', color: '#606266' }"
:data="ruleForm.processesList"
border
style="width: 90%;margin-left:30px;"
>
<el-table-column
align="center"
type="index"
label="序号"
width="50"
/>
<el-table-column align="center" property="title" label="流程标题">
</el-table-column>
<el-table-column align="center" property="code" label="流程编号">
</el-table-column>
<el-table-column align="center" property="introduction" label="简介">
</el-table-column>
<el-table-column align="center" property="sort" label="排序" width="50">
</el-table-column>
</el-table>
<div v-if="type == 'add' || type == 'edit'">
<el-table
:header-cell-style="{ background: '#eee', color: '#606266' }"
:data="ruleForm.processesList"
border
style="width: 90%;margin-left:30px;"
>
<el-table-column
align="center"
type="index"
label="序号"
width="50"
/>
<el-table-column
align="center"
property="title"
label="流程标题"
width="130"
>
<template slot-scope="scope">
<el-input
v-model="ruleForm.processesList[scope.$index].title"
/>
</template>
</el-table-column>
<el-table-column
align="center"
property="code"
label="流程编号"
width="100"
>
<template slot-scope="scope">
<el-input
@input="changCode"
v-model="ruleForm.processesList[scope.$index].code"
/>
</template>
</el-table-column>
<el-table-column
align="center"
property="introduction"
label="简介"
>
<template slot-scope="scope">
<el-input
v-model="ruleForm.processesList[scope.$index].introduction"
/>
</template>
</el-table-column>
<el-table-column
align="center"
property="sort"
label="排序"
width="100"
>
<template slot-scope="scope">
<el-input
type="number"
@input="changSort"
@mousewheel.native.prevent
@keyup.native="prevent($event)"
v-model="ruleForm.processesList[scope.$index].sort"
/>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="Del(scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div v-if="type == 'view'">
<el-table
:header-cell-style="{ background: '#eee', color: '#606266' }"
:data="ruleForm.processesList"
border
style="width: 90%;margin-left:30px;"
>
<el-table-column
align="center"
type="index"
label="序号"
width="50"
/>
<el-table-column align="center" property="title" label="流程标题">
</el-table-column>
<el-table-column align="center" property="code" label="流程编号">
</el-table-column>
<el-table-column
align="center"
property="introduction"
label="简介"
>
</el-table-column>
<el-table-column
align="center"
property="sort"
label="排序"
width="50"
>
</el-table-column>
</el-table>
</div>
<div style="margin-top:15px;" v-if="type == 'add' || type == 'edit'">
<el-button
type="success"
@ -884,7 +929,7 @@ export default {
radioImg: "1",
radioMusic: "1",
radioVideo: "1",
type: "add",
type: "",
imgData: [],
musicData: [],
videoData: [],
@ -929,7 +974,41 @@ export default {
}
}
},
changCode() {
handleClose(done) {
this.$confirm("确认关闭?")
.then(_ => {
done();
this.type = ''
})
.catch(_ => {});
},
changSort(val) {
if (this.ruleForm.processesList.length > 1) {
for (var i = 0; i < this.ruleForm.processesList.length; i++) {
let s = i + 1;
if (
s < this.ruleForm.processesList.length ||
s == this.ruleForm.processesList.length
) {
if (
this.ruleForm.processesList[i].sort ==
this.ruleForm.processesList[s].sort
) {
this.$message({
message: "输入的流程排序有重复,请重新输入",
type: "error"
});
this.ruleForm.processesList[s].sort = "";
console.log(val);
this.disabledButton = true;
} else {
this.disabledButton = false;
}
}
}
}
},
changCode(val) {
if (this.ruleForm.processesList.length > 1) {
for (var i = 0; i < this.ruleForm.processesList.length; i++) {
let s = i + 1;
@ -945,6 +1024,8 @@ export default {
message: "输入的流程编号有重复,请重新输入",
type: "error"
});
this.ruleForm.processesList[s].code = "";
console.log(val);
this.disabledButton = true;
} else {
this.disabledButton = false;
@ -961,9 +1042,7 @@ export default {
this.tableData = res.data.rows;
this.total = res.data.total;
this.loading = false;
} catch (err) {
}
} catch (err) {}
},
//
search() {
@ -994,9 +1073,7 @@ export default {
try {
let res = await queryFindList({});
this.lcData = res.data;
} catch (err) {
}
} catch (err) {}
},
//
async queryListDetail(id) {
@ -1164,12 +1241,11 @@ export default {
// this.radioVideo = 2;
// }
// });
} catch (err) {
}
} catch (err) {}
},
//
handleAdd() {
this.type = "add";
this.ruleForm = {
studioName: "",
title: "",
@ -1184,7 +1260,7 @@ export default {
radioVideo: [],
resourcesList: []
};
this.dataImg = []
this.dataImg = [];
this.imgData = [];
this.musicData = [];
this.videoData = [];
@ -1192,34 +1268,33 @@ export default {
this.radioVideo = 1;
this.radioImg = 1;
this.disabled = false;
this.type = "add";
this.dialog.title = "新增剧本";
setTimeout(() => {
this.dialog.Visible = true;
}, 500);
},
async subMit() {
if (this.imgType == true && this.radioImg == 1) {
this.$message({
message: "请绑定图片相关流程",
type: "error"
});
return false;
}
if (this.musicType == true && this.radioMusic == 1) {
this.$message({
message: "请绑定音频相关流程",
type: "error"
});
return false;
}
if (this.videoType == true && this.radioVideo == 1) {
this.$message({
message: "请绑定视频相关流程",
type: "error"
});
return false;
}
// if (this.imgType == true && this.radioImg == 1) {
// this.$message({
// message: "",
// type: "error"
// });
// return false;
// }
// if (this.musicType == true && this.radioMusic == 1) {
// this.$message({
// message: "",
// type: "error"
// });
// return false;
// }
// if (this.videoType == true && this.radioVideo == 1) {
// this.$message({
// message: "",
// type: "error"
// });
// return false;
// }
this.ruleForm.imgUrl = this.dataImg.join(",");
if (this.radioImg == 1) {
this.ruleForm.radioImg = this.imgData;
@ -1299,11 +1374,10 @@ export default {
}
}
});
} catch (err) {
}
} catch (err) {}
},
subEsc() {
this.type = ''
this.ruleForm = {
studioName: "",
title: "",
@ -1348,8 +1422,10 @@ export default {
},
//
handleView(row) {
this.queryListDetail(row.id);
console.log(this.type, 41231);
this.type = "view";
console.log(this.type, 41231222);
this.queryListDetail(row.id);
this.disabled = true;
setTimeout(() => {
this.dialog.Visible = true;
@ -1373,9 +1449,7 @@ export default {
type: "error"
});
}
} catch (err) {
}
} catch (err) {}
},
handleAvatar(res, file, fileList) {
// console.log(res, file, "");
@ -1393,11 +1467,9 @@ export default {
let res = await uploadFile(formData);
// this.ruleForm.cover = res.data.wjUrl;
this.$set(this.ruleForm, "cover", res.data.wjUrl);
} catch (err) {
}
} catch (err) {}
},
changeImgs({file}) {
changeImgs({ file }) {
let formData = new FormData();
formData.append("file", file);
formData.append("type", "product");
@ -1531,7 +1603,7 @@ export default {
processNames: "",
title: res.data.wjDx,
mediaType: 1,
sourceType:1
sourceType: 1
});
this.imgType = true;
});
@ -1546,7 +1618,7 @@ export default {
processNames: "",
title: res.data.wjDx,
mediaType: 1,
sourceType:2
sourceType: 2
});
this.musicType = true;
});
@ -1561,13 +1633,13 @@ export default {
processNames: "",
title: res.data.wjDx,
mediaType: 1,
sourceType:3
sourceType: 3
});
this.radioType = true;
});
},
delDataImg(item,index){
this.dataImg.splice(index,1)
delDataImg(item, index) {
this.dataImg.splice(index, 1);
delFile({ wjUrl: item }).then(res => {
if (res.code == 200) {
this.$message.success("删除成功");
@ -1666,7 +1738,7 @@ export default {
this.$message.warning("禁止输入小数以及负数");
e.target.value = "";
}
},
}
}
};
</script>

Loading…
Cancel
Save