modifyNotice.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. <template>
  2. <normal-dialog
  3. :show-dialog.sync="show"
  4. :title="title"
  5. :is-default-close="false"
  6. width="60%"
  7. :show-footer="!disabled"
  8. @confirm="confirmForm()"
  9. @cancel="cancel()"
  10. >
  11. <article>
  12. <h2 v-show="type==='require'" class="form-title">需求范围</h2>
  13. <h2 v-show="type==='task'" class="form-title">任务范围</h2>
  14. <el-form ref="form" :model="formData" label-width="100px" label-position="left">
  15. <el-form-item v-if="type === 'require'" label="需求方向">
  16. <el-cascader
  17. v-model="formData.requireOrientIdList"
  18. size="small"
  19. collapse-tags
  20. :props="requireProps"
  21. :options="directionList"
  22. placeholder="请选择"
  23. clearable
  24. :disabled="disabled"
  25. />
  26. </el-form-item>
  27. <el-form-item v-if="type === 'task'" label="技术模块">
  28. <el-cascader
  29. v-model="formData.techModuleIdList"
  30. size="small"
  31. collapse-tags
  32. :props="taskProps"
  33. :options="modulesList"
  34. placeholder="请选择"
  35. clearable
  36. :disabled="disabled"
  37. />
  38. </el-form-item>
  39. </el-form>
  40. <el-form ref="form" :model="formData" label-width="100px" label-position="left" :inline="true">
  41. <el-form-item label="跟版客户端">
  42. <el-select v-model="formData.clientId" placeholder="请选择" size="small" :disabled="disabled">
  43. <el-option v-for="item in appClientList" :key="'app'+item.code" :label="item.msg" :value="item.code" />
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-select v-model="formData.clientVersionId" placeholder="请选择" size="small" :disabled="disabled">
  48. <el-option v-for="item in clientList" :key="'client'+item.code" :label="item.msg" :value="item.code" />
  49. </el-select>
  50. </el-form-item>
  51. </el-form>
  52. <h2 class="form-title">通知条件(必选)</h2>
  53. <el-form ref="form" :model="formData" label-width="100px" label-position="left">
  54. <el-form-item v-for="(item,index) in formData.noticeConditionList" :key="'condition'+index" label="条件">
  55. <el-select v-model="item.type" placeholder="请选择类型" size="small" class="condition-select" :disabled="disabled" @change="changeNoticeItem(item)">
  56. <el-option v-for="key in typeList" :key="key.label" :label="key.label" :value="key.value" />
  57. </el-select>
  58. <el-select v-show="item.type === 1 || item.type === 3" v-model="item.status" placeholder="请选择状态" size="small" class="condition-select" :disabled="disabled">
  59. <el-option v-for="key in statusList" :key="'status'+key.code" :label="key.msg" :value="key.code" />
  60. </el-select>
  61. <el-select v-show="item.type === 1 || item.type === 3" v-model="item.triggerEvent" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  62. <el-option v-for="key in triggerList" :key="'trigger'+key.code" :label="key.name" :value="key.code" />
  63. </el-select>
  64. <el-select v-show="item.type === 2 || item.type === 4" v-model="item.triggerEvent" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  65. <el-option v-for="key in noticeEventList" :key="'event'+key.code" :label="key.name" :value="key.code" />
  66. </el-select>
  67. <el-select v-show="item.type === 1 || item.type === 3" v-model="item.greaterTime" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  68. <el-option v-for="key in rangDaysList" :key="'greaterTime'+key.value" :label="key.label" :value="key.value" />
  69. </el-select>
  70. <el-select v-show="item.type === 2 || item.type === 4" v-model="item.lessTime" placeholder="请选择" size="small" class="condition-select" :disabled="disabled">
  71. <el-option v-for="key in aheadDaysList" :key="'lessTime'+key.value" :label="key.label" :value="key.value" />
  72. </el-select>
  73. <i v-show="!disabled" class="el-icon-remove-outline" @click="removeItem(index)" />
  74. </el-form-item>
  75. <div v-show="!disabled" class="add-condition" @click="addCondition()"><i class="el-icon-circle-plus-outline" /> 添加条件</div>
  76. </el-form>
  77. <h2 class="form-title">通知方式(必选)</h2>
  78. <el-form ref="form" :model="formData" label-width="100px" label-position="left">
  79. <!-- 邮件方式 -->
  80. <el-checkbox v-model="noticeList.Email" class="notice-check" :disabled="disabled">邮件</el-checkbox>
  81. <el-form-item v-for="(item,index) in EmailList" :key="'email'+index" :label="index===0?'通知人群':''">
  82. <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" :disabled="disabled" @change="changeNoticeType(item)">
  83. <el-option v-for="key in noticeGroupList" :key="'email-type'+key.label" :label="key.label" :value="key.value" />
  84. </el-select>
  85. <el-select v-show="item.type===1" v-model="item.teams" placeholder="请选择" size="small" :multiple="true" :disabled="disabled">
  86. <el-option v-for="key in teamList" :key="'email-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
  87. </el-select>
  88. <search-people v-show="item.type===2" :value.sync="item.customStaffs" :clearable="false" :multiple="true" :disabled="disabled" />
  89. <i v-if="index!==0 && !disabled" class="el-icon-remove-outline" @click="removeMembers(EmailList,index)" />
  90. </el-form-item>
  91. <div v-show="noticeList.Email && !disabled" class="add-notice" @click="addMembers(EmailList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
  92. <!-- DChart系统方式 -->
  93. <el-checkbox v-model="noticeList.DChart" class="notice-check" :disabled="disabled">DChart系统通知</el-checkbox>
  94. <el-form-item v-for="(item,index) in DChartList" :key="'DChart'+index" :label="index===0?'通知人群':''">
  95. <el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" :disabled="disabled" @change="changeNoticeType(item)">
  96. <el-option v-for="key in noticeGroupList" :key="'DChart-type'+key.label" :label="key.label" :value="key.value" />
  97. </el-select>
  98. <el-select v-show="item.type===1" v-model="item.teams" placeholder="请选择" size="small" :multiple="true" :disabled="disabled">
  99. <el-option v-for="key in teamList" :key="'DChart-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
  100. </el-select>
  101. <search-people v-show="item.type===2" :value.sync="item.customStaffs" :clearable="false" :multiple="true" :disabled="disabled" />
  102. <i v-if="index!==0 && !disabled" class="el-icon-remove-outline" @click="removeMembers(DChartList,index)" />
  103. </el-form-item>
  104. <div v-show="noticeList.DChart && !disabled" class="add-notice" @click="addMembers(DChartList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
  105. <!-- DChart群方式 -->
  106. <el-checkbox v-model="noticeList.Group" class="notice-check" :disabled="disabled">DChart群通知</el-checkbox>
  107. <div v-show="noticeList.Group && !disabled" class="add-condition">
  108. <ul v-show="GroupList.length>0" class="group-list">
  109. <li v-for="(item,index) in GroupList" :key="'gourp-item'+ index" class="group-item">
  110. <div>{{ item.name }}</div>
  111. <div>{{ item.url }}</div>
  112. <span><i class="el-icon-delete" @click.stop="removeGroup(index)" /></span>
  113. </li>
  114. </ul>
  115. <span @click="showGroupForm = true"><i class="el-icon-circle-plus-outline" /> 添加DChart群</span>
  116. <section v-if="showGroupForm" class="group-form">
  117. <el-form ref="groupForm" :model="GroupItem" :rules="groupRules" label-width="200px" label-position="left">
  118. <el-form-item prop="name" label="群名称或群ID">
  119. <el-input
  120. v-model="GroupItem.name"
  121. type="textarea"
  122. maxlength="150"
  123. show-word-limit
  124. :autosize="{ minRows: 1, maxRows: 5 }"
  125. />
  126. </el-form-item>
  127. <el-form-item prop="url" label="机器人webhook地址">
  128. <el-input
  129. v-model="GroupItem.url"
  130. type="textarea"
  131. maxlength="200"
  132. show-word-limit
  133. :autosize="{ minRows: 3, maxRows: 6 }"
  134. />
  135. </el-form-item>
  136. </el-form>
  137. <div class="group-confirm">
  138. <el-button size="small" @click.stop="showGroupForm = false">取消</el-button>
  139. <el-button type="primary" size="small" @click.stop="addGroup()">确认</el-button>
  140. </div>
  141. </section>
  142. </div>
  143. </el-form>
  144. <h2 class="form-title">通知时刻</h2>
  145. <div class="notice-time">
  146. <el-time-select
  147. v-model="formData.noticeTime"
  148. placeholder="任意时间点"
  149. size="small"
  150. value-format="HH:mm"
  151. :picker-options="{
  152. start: '00:00',
  153. step: '00:15',
  154. end: '23:45',
  155. }"
  156. :disabled="disabled"
  157. />
  158. </div>
  159. </article>
  160. </normal-dialog>
  161. </template>
  162. <script>
  163. const _ = require('lodash')
  164. import {
  165. showRequireStatusEnum,
  166. showTaskStatusEnum,
  167. getBizNoticeSettingEnum,
  168. addBizNoticeSetting,
  169. updateBizNoticeSetting
  170. } from '@/api/configure'
  171. import { settingQueryBizRqmtOrntList } from '@/api/requirement.js'
  172. import { settingQueryBizModuleList } from '@/api/defectManage'
  173. import { queryTeamInfoList } from '@/api/workSchedule'
  174. import { showAppClientEnum } from '@/api/version.js'
  175. import normalDialog from '@/components/dialog/normalDialog'
  176. import searchPeople from '@/components/select/searchPeople'
  177. export default {
  178. components: { normalDialog, searchPeople },
  179. props: {
  180. data: {
  181. type: Object,
  182. default: () => null,
  183. required: false
  184. },
  185. visible: {
  186. type: Boolean,
  187. default: false,
  188. required: true
  189. },
  190. type: {
  191. type: String,
  192. default: 'require', // 需求:require,任务:task
  193. required: false
  194. },
  195. disabled: {// 查看状态,不可修改
  196. type: Boolean,
  197. default: false,
  198. required: false
  199. },
  200. copy: {// 复制
  201. type: Boolean,
  202. default: false,
  203. required: false
  204. }
  205. },
  206. data() {
  207. return {
  208. bizId: Number(localStorage.getItem('bizId')),
  209. title: this.type === 'require' ? '新建需求定时通知' : '新建任务定时通知',
  210. requireProps: {
  211. value: 'id',
  212. label: 'rqmtOrntName',
  213. children: 'childRqmtOrnts',
  214. multiple: true
  215. },
  216. taskProps: {
  217. value: 'id',
  218. label: 'moduleName',
  219. children: 'childModules',
  220. multiple: true
  221. },
  222. directionList: [], // 需求方面列表
  223. modulesList: [], // 任务模块列表
  224. formData: {
  225. bizId: Number(localStorage.getItem('bizId')),
  226. requireOrientIdList: [], // 需求方向
  227. techModuleIdList: [], // 技术模块
  228. clientId: null, // 客户端
  229. clientVersionId: null, // 版本
  230. noticeConditionList: [], // 条件列表
  231. noticeSetting: {}, // 通知方式
  232. noticeTime: null // 通知时刻
  233. },
  234. EmailList: [], // Email通知列表
  235. DChartList: [], // DChart系统通知列表
  236. GroupList: [], // DChart群通知列表
  237. GroupItem: { name: null, url: null }, // 当前群添加对象
  238. showGroupForm: false,
  239. groupRules: {// 群填写规则
  240. name: [{ required: true, message: '请填写群名称或群ID', trigger: 'change' }],
  241. url: [{ required: true, message: '请填写机器人webhook地址', trigger: 'change' }]
  242. },
  243. noticeList: {// 通知方式列表
  244. Email: false, // 邮件通知
  245. DChart: false, // DChart系统通知
  246. Group: false // DChart群通知
  247. },
  248. noticeGroupList: [], // 通知人群类型选择列表
  249. teamList: [], // 团队选择列表
  250. show: this.visible, // 显示弹框
  251. appClientList: [], // 客户端选择列表
  252. typeList: [], // 条件类型选择列表
  253. statusList: [], // 状态选择列表
  254. noticeEventList: [], // 事件列表
  255. triggerList: [], // 触发事件: 0 停留 1 交付 2 提测
  256. aheadDaysList: [
  257. { label: '3天前开始提醒', value: 3 },
  258. { label: '2天前开始提醒', value: 2 },
  259. { label: '1天前开始提醒', value: 1 },
  260. { label: '过期提醒', value: 0 }
  261. ], // 提前几天提醒
  262. rangDaysList: [] // 条件中大于天数列表
  263. }
  264. },
  265. computed: {
  266. clientList: { // 版本列表
  267. get() {
  268. if (this.formData.clientId !== null) {
  269. const obj = this.appClientList.find(item => item.code === this.formData.clientId)
  270. return (obj && obj.childEnumInfos) || []
  271. } else {
  272. return []
  273. }
  274. }
  275. }
  276. },
  277. watch: {
  278. data: {
  279. handler(newV) {
  280. if (newV) {
  281. this.initData(_.cloneDeep(newV))
  282. }
  283. },
  284. deep: true,
  285. immediate: true
  286. },
  287. type: {
  288. handler(newV) {
  289. this.type = newV
  290. },
  291. immediate: true
  292. },
  293. visible: {
  294. handler(newV) {
  295. this.show = newV
  296. },
  297. immediate: true
  298. },
  299. copy: {
  300. handler(newV) {
  301. this.copy = newV
  302. },
  303. immediate: true
  304. },
  305. disabled: {
  306. handler(newV) {
  307. this.disabled = newV
  308. },
  309. immediate: true
  310. },
  311. // 'formData.clientId': { // 客户端改变,版本默认取第一个版本
  312. // handler(newV) {
  313. // this.formData.clientVersionId = (this.clientList[0] && this.clientList[0].code) || null
  314. // }
  315. // },
  316. 'noticeList.Email': {
  317. handler(newV, oldV) {
  318. if (newV) {
  319. if (this.EmailList.length === 0) this.EmailList.push({ type: 0, member: true, teams: [], customStaffs: [] })
  320. } else {
  321. this.EmailList = []
  322. }
  323. }
  324. },
  325. 'noticeList.DChart': {
  326. handler(newV, oldV) {
  327. if (newV) {
  328. if (this.DChartList.length === 0) this.DChartList.push({ type: 0, member: true, teams: [], customStaffs: [] })
  329. } else {
  330. this.DChartList = []
  331. }
  332. }
  333. },
  334. 'noticeList.Group': {
  335. handler(newV, oldV) {
  336. if (!newV) {
  337. this.GroupList = []
  338. }
  339. }
  340. }
  341. },
  342. created() {
  343. this.getBizNoticeSettingEnum()
  344. this.getRequireDirection()
  345. this.settingQueryBizModuleList()
  346. this.showAppClientEnum()
  347. this.queryTeamInfoList()
  348. this.init()
  349. },
  350. methods: {
  351. initData(data) {
  352. this.formData = {
  353. id: data.id,
  354. bizId: data.bizId,
  355. requireOrientIdList: data.requireOrientIdList, // 需求方向
  356. techModuleIdList: data.techModuleIdList, // 技术模块
  357. clientId: data.clientId || null, // 客户端
  358. clientVersionId: data.clientVersionId, // 版本
  359. noticeConditionList: data.noticeConditionList || [], // 条件列表
  360. noticeSetting: {}, // 通知方式
  361. noticeTime: data.noticeTime // 通知时刻
  362. }
  363. if (data.noticeSetting.email && data.noticeSetting.email.length > 0) {
  364. this.EmailList = Array(data.noticeSetting.email.length).fill({ type: 0, member: true, teams: [], customStaffs: [] })
  365. this.$nextTick(() => {
  366. this.EmailList = data.noticeSetting.email
  367. })
  368. this.noticeList.Email = true
  369. }
  370. if (data.noticeSetting.dChat && data.noticeSetting.dChat.length > 0) {
  371. this.DChartList = Array(data.noticeSetting.dChat.length).fill({ type: 0, member: true, teams: [], customStaffs: [] })
  372. this.$nextTick(() => {
  373. this.DChartList = data.noticeSetting.dChat
  374. })
  375. this.noticeList.DChart = true
  376. }
  377. if (data.noticeSetting.dChatGroup && data.noticeSetting.dChatGroup.length > 0) {
  378. this.GroupList = data.noticeSetting.dChatGroup || []
  379. this.noticeList.Group = true
  380. }
  381. },
  382. async getBizNoticeSettingEnum() { // 任务需求事件列表
  383. const res = await getBizNoticeSettingEnum(this.bizId)
  384. if (res.code === 200) {
  385. this.triggerList = res.data.noticeConditionOpList
  386. this.type === 'require'
  387. ? this.noticeEventList = res.data.noticeEventRequireOpList
  388. : this.noticeEventList = res.data.noticeEventTaskOpList
  389. }
  390. },
  391. async getRequireDirection() { // 需求方向列表
  392. const res = await settingQueryBizRqmtOrntList(this.bizId)
  393. if (res.code === 200) {
  394. this.directionList = this.getRequireData(res.data)
  395. }
  396. },
  397. async settingQueryBizModuleList() { // 任务模块列表
  398. const res = await settingQueryBizModuleList(this.bizId)
  399. if (res.code === 200) {
  400. this.modulesList = this.getTaskData(res.data)
  401. }
  402. },
  403. getRequireData(data) {
  404. for (var i = 0; i < data.length; i++) {
  405. data[i].childRqmtOrnts.length < 1 ? delete data[i].childRqmtOrnts : this.getRequireData(data[i].childRqmtOrnts)
  406. }
  407. return data
  408. },
  409. getTaskData(data) {
  410. for (var i = 0; i < data.length; i++) {
  411. data[i].childModules.length < 1 ? delete data[i].childModules : this.getTaskData(data[i].childModules)
  412. }
  413. return data
  414. },
  415. async showAppClientEnum() { // 获取客户端列表
  416. const res = await showAppClientEnum()
  417. if (res.code === 200) {
  418. this.appClientList = res.data.appClient
  419. }
  420. },
  421. async showRequireStatusEnum() { // 获取需求状态列表
  422. const res = await showRequireStatusEnum(this.bizId)
  423. if (res.code === 200) {
  424. this.statusList = res.data.requirementStatus || []
  425. }
  426. },
  427. async showTaskStatusEnum() { // 获取任务状态列表
  428. const res = await showTaskStatusEnum(this.bizId)
  429. if (res.code === 200) {
  430. this.statusList = res.data.taskStatus || []
  431. }
  432. },
  433. async queryTeamInfoList() { // 获取用户团队列表
  434. const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999 })
  435. if (res.code === 200 && res.data) {
  436. this.teamList = res.data.list
  437. }
  438. },
  439. init() {
  440. if (this.type === 'require') {
  441. this.typeList = [{ label: '需求状态', value: 1 }, { label: '需求事件', value: 2 }]
  442. this.noticeGroupList = [{ label: '需求成员', value: 0 }, { label: '团队', value: 1 }, { label: '自定义人员', value: 2 }]
  443. this.showRequireStatusEnum()
  444. } else {
  445. this.typeList = [{ label: '任务状态', value: 3 }, { label: '任务事件', value: 4 }]
  446. this.noticeGroupList = [{ label: '任务成员', value: 0 }, { label: '团队', value: 1 }, { label: '自定义人员', value: 2 }]
  447. this.showTaskStatusEnum()
  448. }
  449. let i = 1
  450. while (i <= 100) {
  451. this.rangDaysList.push({ label: `大于${i}天`, value: i })
  452. i++
  453. }
  454. },
  455. changeNoticeItem(item) { // 修改条件
  456. if (item.type === 1 || item.type === 3) {
  457. item.triggerEvent = this.triggerList[0].code
  458. } else if (item.type === 2 || item.type === 4) {
  459. item.triggerEvent = this.noticeEventList[0].code
  460. }
  461. },
  462. addCondition() { // 添加条件
  463. this.formData.noticeConditionList.push({
  464. type: this.typeList[0].value, // 1 需求状态 2 需求事件 3 任务状态 4 任务事件
  465. status: 0,
  466. triggerEvent: this.triggerList[0].code, // 触发事件
  467. greaterTime: 1, // 大于的时间
  468. lessTime: 3 // 提前提醒的时间
  469. })
  470. },
  471. removeItem(index) { // 移除条件
  472. this.formData.noticeConditionList.splice(index, 1)
  473. },
  474. addMembers(list) { // 添加成员
  475. list.push({ type: 0, member: true, teams: [], customStaffs: [] })
  476. },
  477. removeMembers(list, index) { // 移除成员
  478. list.splice(index, 1)
  479. },
  480. changeNoticeType(item) { // 修改通知
  481. switch (item.type) {
  482. case 0:
  483. item.member = true
  484. item.teamList = []
  485. item.customStaffList = []
  486. break
  487. case 1:
  488. item.member = false
  489. item.customStaffList = []
  490. break
  491. case 2:
  492. item.member = false
  493. item.teamList = []
  494. break
  495. }
  496. },
  497. addGroup() { // 添加DChart群
  498. this.$refs['groupForm'].validate((valid) => {
  499. if (valid) {
  500. this.GroupList.push({
  501. type: 3,
  502. ...this.GroupItem
  503. })
  504. this.GroupItem = { name: null, url: null }
  505. this.showGroupForm = false
  506. }
  507. })
  508. },
  509. removeGroup(index) { // 移除DChart群
  510. this.GroupList.splice(index, 1)
  511. },
  512. validate() { // 校验入参
  513. if (this.formData.noticeConditionList.length < 1) {
  514. this.$message({ message: '请添加通知条件', type: 'error', duration: 1000, offset: 150 })
  515. return false
  516. }
  517. if (this.EmailList.length === 0 && this.DChartList.length === 0 && this.GroupList.length === 0) {
  518. this.$message({ message: '请选择一种通知方式', type: 'error', duration: 1000, offset: 150 })
  519. return false
  520. }
  521. if (!this.formData.noticeTime) {
  522. this.$message({ message: '请选择通知时刻', type: 'error', duration: 1000, offset: 150 })
  523. return false
  524. }
  525. this.formData.noticeSetting = {
  526. email: this.noticeList.Email ? this.EmailList : [],
  527. dChat: this.noticeList.DChart ? this.DChartList : [],
  528. dChatGroup: this.noticeList.Group ? this.GroupList : []
  529. }
  530. this.data && !this.copy ? this.updateBizNoticeSetting() : this.addBizNoticeSetting()
  531. },
  532. async addBizNoticeSetting() { // 新增通知
  533. if (this.formData.id) {
  534. delete this.formData.id
  535. }
  536. const res = await addBizNoticeSetting(this.formData)
  537. if (res.code === 200) {
  538. this.$message({ message: '添加成功', type: 'success', duration: 1000, offset: 150 })
  539. this.$emit('confirm')
  540. }
  541. },
  542. async updateBizNoticeSetting() { // 更新通知
  543. const res = await updateBizNoticeSetting(this.formData)
  544. if (res.code === 200) {
  545. this.$message({ message: '修改成功', type: 'success', duration: 1000, offset: 150 })
  546. this.$emit('confirm')
  547. }
  548. },
  549. confirmForm() {
  550. this.validate()
  551. },
  552. cancel() {
  553. this.show = false
  554. this.$emit('update:visible', this.show)
  555. this.$emit('cancel')
  556. }
  557. }
  558. }
  559. </script>
  560. <style lang="scss" scoped>
  561. article::-webkit-scrollbar{
  562. display: none;
  563. }
  564. article{
  565. max-height: 500px;
  566. overflow: scroll;
  567. padding: 0 45px;
  568. .form-title {
  569. margin: 0;
  570. padding: 0;
  571. font-size: 18px;
  572. color: #333333;
  573. margin: 20px 0;
  574. }
  575. .form-title:nth-child(1){
  576. margin-top: 0;
  577. }
  578. /deep/.el-form-item {
  579. font-size: 14px;
  580. margin-bottom: 10px;
  581. label {
  582. color: #666666;
  583. font-weight: 400;
  584. }
  585. }
  586. .condition-select {
  587. width: 22%;
  588. }
  589. .add-condition,.add-notice {
  590. cursor: pointer;
  591. color: #409EFF;
  592. position: relative;
  593. }
  594. .add-notice {
  595. margin-left: 100px;
  596. width: 150px;
  597. }
  598. .notice-check{
  599. margin: 15px 0;
  600. display: block;
  601. width: 150px;
  602. }
  603. .notice-check:nth-child(1){
  604. margin-top: 0;
  605. }
  606. .el-icon-remove-outline {
  607. cursor: pointer;
  608. color: #409EFF;
  609. font-size: 14px;
  610. margin-left: 5px;
  611. }
  612. }
  613. .group-form {
  614. width: 280px;
  615. position: absolute;
  616. bottom: 30px;
  617. left: 0;
  618. padding: 10px;
  619. z-index: 99;
  620. background:rgba(255,255,255,1);
  621. box-shadow:0px 0px 12px rgba(0,0,0,0.1);
  622. /deep/.el-form-item{
  623. display: flex;
  624. flex-direction: column;
  625. margin-bottom: 10px;
  626. .el-form-item__content {
  627. margin: 0 !important;
  628. width: 100%;
  629. line-height: 10px;
  630. }
  631. }
  632. .group-confirm {
  633. display: flex;
  634. justify-content: center;
  635. margin-top: 20px;
  636. button:nth-child(1) {
  637. margin-right: 10px;
  638. }
  639. }
  640. }
  641. .group-list{
  642. margin: 0;
  643. padding: 0;
  644. list-style: none;
  645. width: 100%;
  646. color: #333333;
  647. font-size: 14px;
  648. .group-item {
  649. margin: 0;
  650. padding: 0;
  651. list-style: none;
  652. width: 100%;
  653. display: grid;
  654. grid-template-columns: 30% 60% 10%;
  655. border:1px solid rgba(209,208,208,1);
  656. height:37px;
  657. border-radius: 4px;
  658. margin-bottom: 10px;
  659. align-items: center;
  660. div{
  661. border-right:1px solid rgba(209,208,208,1);
  662. overflow: hidden;
  663. text-overflow: ellipsis;
  664. white-space: nowrap;
  665. text-align: center;
  666. line-height: 37px;
  667. padding: 0 5px;
  668. }
  669. span {
  670. height: 100%;
  671. display: flex;
  672. align-items: center;
  673. justify-content: center;
  674. font-size: 18px;
  675. }
  676. }
  677. }
  678. </style>