addTemp.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="app-container">
  3. <div style="margin: 30px;" v-if="this.form.sendType == 1 "> sop规则【企微接口】模板</div>
  4. <div style="margin: 30px;" v-if="this.form.sendType == 2 "> sop规则【AI插件】模板</div>
  5. <div style="margin-top: 10px;margin-left: 50px;margin-right: 100px;margin-bottom: 60px;">
  6. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  7. <el-form-item label="名称" prop="name">
  8. <el-input v-model="form.name" placeholder="请输入模板标题" />
  9. </el-form-item>
  10. <el-form-item label="状态">
  11. <el-radio-group v-model="form.status">
  12. <el-radio
  13. v-for="dict in statusOptions"
  14. :key="dict.dictValue"
  15. :label="dict.dictValue"
  16. >{{dict.dictLabel}}</el-radio>
  17. </el-radio-group>
  18. </el-form-item>
  19. <el-form-item label="间隔天数" prop="gap">
  20. <el-input-number v-model="form.gap" :min="1" label="间隔天数"></el-input-number>
  21. </el-form-item>
  22. <el-form-item label="排序" prop="sort">
  23. <el-input-number v-model="form.sort" :min="0" label="排序"></el-input-number>
  24. </el-form-item>
  25. </el-form>
  26. <div slot="footer" class="dialog-footer" style="float: right;">
  27. <el-button type="primary" @click="submitForm">确 定</el-button>
  28. <el-button @click="cancel">取 消</el-button>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import {addTemp} from "@/api/qw/sopTemp";
  35. import ImageUpload from "@/views/qw/sop/ImageUpload";
  36. import FriendMaterial from "@/views/qw/friendMaterial/index.vue";
  37. import userVideo from "@/views/qw/userVideo/userVideo.vue";
  38. export default {
  39. name: "addSopTemp",
  40. components: { ImageUpload,FriendMaterial,userVideo},
  41. data() {
  42. return {
  43. //图片放大
  44. dialogVisible: false,
  45. dialogImageUrl:null,
  46. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS2",
  47. uploadUrlByVoice:process.env.VUE_APP_BASE_API+"/common/uploadOSSByHOOKVoice",
  48. //上传语音的遮罩层
  49. voiceLoading :false,
  50. // 遮罩层
  51. loading: true,
  52. // 导出遮罩层
  53. exportLoading: false,
  54. // 选中数组
  55. ids: [],
  56. sysFsSopWatchStatus: [],
  57. //消息内容类型 企微版
  58. sysQwSopContentType:[],
  59. //插件版
  60. sysQwSopAiContentType:[],
  61. //链接版类别
  62. sysQwSopSettingType:[],
  63. // 非单个禁用
  64. single: true,
  65. // 非多个禁用
  66. multiple: true,
  67. // 显示搜索条件
  68. showSearch: true,
  69. // 总条数
  70. total: 0,
  71. // sop模板表格数据
  72. setting: [],
  73. courseList:[],
  74. videoList:[],
  75. // 弹出层标题
  76. title: "",
  77. // 是否显示弹出层
  78. open: false,
  79. // 状态字典
  80. statusOptions: [],
  81. // 查询参数
  82. form: {
  83. name: null,
  84. setting: null,
  85. status: "1",
  86. sort: 1,
  87. companyId: null,
  88. gap:1,
  89. },
  90. videoNumOptions:{
  91. title:'选择视频号',
  92. open:false,
  93. content:null,
  94. contentIndex:null,
  95. setIndex:null,
  96. },
  97. // 表单校验
  98. rules: {
  99. name: [
  100. { required: true, message: '名称不能为空', trigger: 'blur' }
  101. ],
  102. status: [
  103. { required: true, message: '状态不能为空', trigger: 'blur' }
  104. ],
  105. sort: [
  106. { required: true, message: '排序不能为空', trigger: 'blur' }
  107. ],
  108. gap: [
  109. { required: true, message: '间隔天数不能为空', trigger: 'blur' }
  110. ],
  111. },
  112. contentRules:{
  113. time:[{ required: true, message: '时间不能为空', trigger: 'blur' }],
  114. }
  115. };
  116. },
  117. created() {
  118. this.getDicts("sys_company_status").then(response => {
  119. this.statusOptions = response.data;
  120. });
  121. this.form.sendType = this.$route.params && this.$route.params.command;
  122. setTimeout(() => {
  123. this.getList();
  124. }, 200);
  125. },
  126. methods: {
  127. // 取消按钮
  128. cancel() {
  129. this.$store.dispatch("tagsView/delView", this.$route);
  130. this.$router.replace('/qw/conversion/sopTemp')
  131. this.reset();
  132. },
  133. // 表单重置
  134. reset() {
  135. this.form = {
  136. id: null,
  137. name: null,
  138. setting: null,
  139. status: "0",
  140. sort: null,
  141. createTime: null,
  142. createBy: null,
  143. companyId: null,
  144. };
  145. this.resetForm("form");
  146. },
  147. /** 提交按钮 */
  148. submitForm() {
  149. this.$refs["form"].validate(valid => {
  150. if (valid) {
  151. if (this.form.id != null) {
  152. updateTemp(this.form).then(response => {
  153. this.msgSuccess("修改成功");
  154. this.$store.dispatch("tagsView/delView", this.$route);
  155. // this.$router.replace('/qw/conversion/sopTemp')
  156. window.location.replace('/qw/conversion/sopTemp')
  157. this.reset();
  158. });
  159. } else {
  160. addTemp(this.form).then(response => {
  161. this.msgSuccess("新增成功");
  162. this.$store.dispatch("tagsView/delView", this.$route);
  163. // this.$router.replace('/qw/conversion/sopTemp')
  164. window.location.replace('/qw/conversion/sopTemp')
  165. this.reset();
  166. });
  167. }
  168. }
  169. });
  170. },
  171. }
  172. };
  173. </script>
  174. <style scoped>
  175. .custom-input /deep/ .el-input__inner {
  176. height: 20px;
  177. text-align: center;
  178. }
  179. .custom-input /deep/ .el-input__icon {
  180. line-height: 10px;
  181. }
  182. </style>