fecDialog.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <template>
  2. <el-dialog
  3. :title="title+(isEdit===true?'--编辑':'--新增')"
  4. :visible.sync="dialogVisible"
  5. :close-on-click-modal="false"
  6. :close-on-press-escape="false"
  7. append-to-body
  8. class="dialog paper-detail-dialog"
  9. width="65%"
  10. top
  11. style="margin-top:5vh"
  12. :show-close="false"
  13. >
  14. <div class="contain">
  15. <div class="main">
  16. <el-form ref="form" :model="form" label-width="120px">
  17. <el-row>
  18. <el-col :span="12">
  19. <el-form-item label="部门:">
  20. <ibps-user-selector
  21. v-model="form.bu_men_"
  22. size="mini"
  23. type="position"
  24. readonly-text="text"
  25. :disabled="false"
  26. :multiple="false"
  27. style="width:80%"
  28. />
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="12">
  32. <el-form-item label="监测岗位:">
  33. <el-select v-model="form.jian_ce_gang_wei_" placeholder="请选择" size="mini" style="width:80%">
  34. <el-option
  35. v-for="item in jianCeGangWeiList"
  36. :key="item.id_"
  37. :label="item.wei_hu_gang_wei_"
  38. :value="item.wei_hu_gang_wei_"
  39. />
  40. </el-select>
  41. </el-form-item>
  42. </el-col>
  43. </el-row>
  44. <el-row>
  45. <el-col :span="12">
  46. <el-form-item label="区域:">
  47. <el-select v-model="form.qu_yu_" placeholder="请选择" size="mini" style="width:80%">
  48. <el-option
  49. v-for="item in quYuList"
  50. :key="item.id_"
  51. :label="item.qu_yu_ming_cheng_"
  52. :value="item.qu_yu_ming_cheng_"
  53. />
  54. </el-select>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="12">
  58. <el-form-item label="房间:">
  59. <el-select v-model="form.fang_jian_" placeholder="请选择" size="mini" style="width:80%">
  60. <el-option
  61. v-for="item in fangJianList"
  62. :key="item.id_"
  63. :label="item.fang_jian_ming_ha"
  64. :value="item.fang_jian_ming_ha"
  65. />
  66. </el-select>
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. <el-row>
  71. <el-col :span="12">
  72. <el-form-item label="监控设备:">
  73. <ibps-link-data
  74. v-model="form.deviceno2_"
  75. style="width:80%"
  76. size="mini"
  77. template-key="jksbxz"
  78. :multiple="false"
  79. :temp-search="true"
  80. />
  81. </el-form-item>
  82. </el-col>
  83. </el-row>
  84. <el-row v-if="isShowDevice">
  85. <el-col :span="12">
  86. <el-form-item label="被控设备编号:">
  87. <el-input v-model="form.deviceno1_" size="mini" style="width:80%" />
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="12">
  91. <el-form-item label="被控设备名称:">
  92. <el-input v-model="form.devicename1_" size="mini" style="width:80%" />
  93. </el-form-item>
  94. </el-col>
  95. </el-row>
  96. <el-row>
  97. <el-col :span="12">
  98. <el-form-item label="监测周期:">
  99. <el-select v-model="form.jian_ce_zhou_qi_" placeholder="请选择" size="mini" style="width:80%">
  100. <el-option
  101. v-for="item in period"
  102. :key="item.value"
  103. :label="item.label"
  104. :value="item.value"
  105. />
  106. </el-select>
  107. </el-form-item>
  108. </el-col>
  109. <el-col :span="12">
  110. <el-form-item label="是否启用:">
  111. <el-switch
  112. v-model="form.shi_fou_qi_yong_"
  113. active-color="#13ce66"
  114. inactive-color="#ff4949"
  115. active-text="启用"
  116. inactive-text="停用"
  117. active-value="1"
  118. inactive-value="0"
  119. />
  120. </el-form-item>
  121. </el-col>
  122. </el-row>
  123. <el-row v-if="form.jian_ce_zhou_qi_!==''">
  124. <el-col :span="12">
  125. <el-form-item :label="labelShow">
  126. <el-checkbox-group v-if="form.jian_ce_zhou_qi_==='每日'" v-model="dayCheck" size="mini">
  127. <el-checkbox :label="1" size="mini">周一</el-checkbox>
  128. <el-checkbox :label="2" size="mini">周二</el-checkbox>
  129. <el-checkbox :label="3" size="mini">周三</el-checkbox>
  130. <el-checkbox :label="4" size="mini">周四</el-checkbox>
  131. <el-checkbox :label="5" size="mini">周五</el-checkbox>
  132. <el-checkbox :label="6" size="mini">周六</el-checkbox>
  133. <el-checkbox :label="7" size="mini">周日</el-checkbox>
  134. </el-checkbox-group>
  135. <template v-if="form.jian_ce_zhou_qi_==='每周'">
  136. <el-radio v-model="weekCheck" :label="1" size="mini">周一</el-radio>
  137. <el-radio v-model="weekCheck" :label="2" size="mini">周二</el-radio>
  138. <el-radio v-model="weekCheck" :label="3" size="mini">周三</el-radio>
  139. <el-radio v-model="weekCheck" :label="4" size="mini">周四</el-radio>
  140. <el-radio v-model="weekCheck" :label="5" size="mini">周五</el-radio>
  141. <el-radio v-model="weekCheck" :label="6" size="mini">周六</el-radio>
  142. <el-radio v-model="weekCheck" :label="7" size="mini">周日</el-radio>
  143. </template>
  144. <el-select v-if="form.jian_ce_zhou_qi_==='每月'" v-model="monthCheck" placeholder="请选择" size="mini" style="width:80%">
  145. <el-option
  146. v-for="item in 28"
  147. :key="item"
  148. :label="`第${item}天`"
  149. :value="item"
  150. />
  151. </el-select>
  152. <el-select v-if="form.jian_ce_zhou_qi_==='每季度'" v-model="quarterCheck" placeholder="请选择" size="mini" style="width:80%">
  153. <el-option
  154. v-for="item in 3"
  155. :key="item"
  156. :label="`第${item}个月`"
  157. :value="item"
  158. />
  159. </el-select>
  160. <el-select v-if="form.jian_ce_zhou_qi_==='每半年'" v-model="halfYearCheck" placeholder="请选择" size="mini" style="width:80%">
  161. <el-option
  162. v-for="item in 6"
  163. :key="item"
  164. :label="`第${item}个月`"
  165. :value="item"
  166. />
  167. </el-select>
  168. <el-select v-if="form.jian_ce_zhou_qi_==='每年'" v-model="yearCheck" placeholder="请选择" size="mini" style="width:80%">
  169. <el-option
  170. v-for="item in 12"
  171. :key="item"
  172. :label="`第${item}个月`"
  173. :value="item"
  174. />
  175. </el-select>
  176. </el-form-item>
  177. </el-col>
  178. <el-col v-if="nextDate" :span="12">
  179. <el-form-item label="下次监测日期为:">
  180. <el-tag size="mini">{{ nextDate }}</el-tag>
  181. </el-form-item>
  182. </el-col>
  183. </el-row>
  184. <el-row>
  185. <el-col :span="22">
  186. <el-form-item label="控制条件:">
  187. <el-input v-model="form.kong_zhi_tiao_jia" type="textarea" :rows="2" size="mini" />
  188. </el-form-item>
  189. </el-col>
  190. </el-row>
  191. <el-row>
  192. <el-col :span="24">
  193. <FacilityData v-if="form.lie_biao_shu_ju_" :is-cul="false" :form-data="{lieBiaoShuJu:form.lie_biao_shu_ju_}" @change-data="onFacilityData" />
  194. </el-col>
  195. </el-row>
  196. </el-form>
  197. </div>
  198. </div>
  199. <span slot="footer" class="dialog-footer">
  200. <el-button type="primary" @click="submit">确 定</el-button>
  201. <el-button @click="close">取 消</el-button>
  202. </span>
  203. </el-dialog>
  204. </template>
  205. <script>
  206. import ibpsUserSelector from '@/business/platform/org/selector'
  207. import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
  208. import FacilityData from '@/views/component/facility/facilityData.vue'
  209. export default {
  210. components: {
  211. FacilityData,
  212. ibpsUserSelector,
  213. IbpsLinkData
  214. },
  215. data () {
  216. return {
  217. dialogVisible: true,
  218. title: '配置详情',
  219. jianCeGangWeiList: [],
  220. lei_xing_: '',
  221. form: {
  222. qu_yu_: '',
  223. fang_jian_: '',
  224. bu_men_: '',
  225. deviceno1_: '',
  226. devicename1_: '',
  227. deviceno2_: '', // 监控设备
  228. jian_ce_zhou_qi_: '',
  229. jian_ce_gang_wei_: '',
  230. shi_fou_qi_yong_: '1',
  231. kong_zhi_tiao_jia: '',
  232. jian_ce_ri_qi_: '',
  233. ri_qi_lie_biao_: '',
  234. zi_wai_deng_wai_j: '', // 紫外灯外键
  235. lie_biao_shu_ju_: ''
  236. },
  237. isEdit: false,
  238. quYuList: [],
  239. fangJianList: [],
  240. nextDate: '',
  241. dayCheck: [],
  242. weekCheck: '',
  243. monthCheck: '',
  244. quarterCheck: '',
  245. halfYearCheck: '',
  246. yearCheck: '',
  247. period: [
  248. { label: '日监测', value: '每日' },
  249. { label: '周监测', value: '每周' },
  250. { label: '月监测', value: '每月' },
  251. { label: '季度监测', value: '每季度' },
  252. { label: '半年监测', value: '每半年' },
  253. { label: '年监测', value: '每年' }
  254. ]
  255. }
  256. },
  257. computed: {
  258. isShowDevice () {
  259. return this.lei_xing_ !== '01-室内温湿度监控' && this.lei_xing_ !== '06-每日安全检查' && this.lei_xing_ !== '08-含氯有效性监测'
  260. },
  261. labelShow () {
  262. if (this.form.jian_ce_zhou_qi_) {
  263. return this.form.jian_ce_zhou_qi_.split('每')[1] + '监测日期:'
  264. }
  265. return ''
  266. }
  267. },
  268. watch: {
  269. 'form.jian_ce_zhou_qi_' (val) {
  270. this.dayCheck = []
  271. this.weekCheck = ''
  272. this.monthCheck = ''
  273. this.quarterCheck = ''
  274. this.halfYearCheck = ''
  275. this.yearCheck = ''
  276. this.nextDate = ''
  277. },
  278. dayCheck: {
  279. handler: function (val, oldVal) {
  280. if (val.length === 0) {
  281. this.nextDate = ''
  282. return
  283. }
  284. const temp_val = JSON.parse(JSON.stringify(val))
  285. const today = new Date()
  286. temp_val.sort(function (a, b) {
  287. return a - b
  288. })
  289. const num = temp_val.findIndex(e => e > today.getDay())
  290. if (temp_val.length > 0 && num !== -1) {
  291. this.nextDate = this.getDayDate(temp_val[num], 0)
  292. } else if (temp_val.length > 0 && num === -1) {
  293. this.nextDate = this.getDayDate(temp_val[0], 1)
  294. } else {
  295. this.nextDate = ''
  296. }
  297. },
  298. immediate: true
  299. },
  300. weekCheck: {
  301. handler: function (val, oldVal) {
  302. if (val === '') {
  303. this.nextDate = ''
  304. return
  305. }
  306. const today = new Date()
  307. const weekNum = []
  308. weekNum.push(val)
  309. const num = weekNum.findIndex(e => e > today.getDay())
  310. if (val !== '' && num !== -1) {
  311. this.nextDate = this.getDayDate(weekNum[0], 0)
  312. } else if (val !== '' && num === -1) {
  313. this.nextDate = this.getDayDate(weekNum[0], 1)
  314. } else {
  315. this.nextDate = ''
  316. }
  317. },
  318. immediate: true
  319. },
  320. monthCheck: {
  321. handler: function (val, oldVal) {
  322. if (val === '') {
  323. this.nextDate = ''
  324. return
  325. }
  326. const today = new Date()
  327. const day = today.getDate()
  328. const nextMonth = this.getNextMonthDate(today, val, 1)
  329. const currentMonth = this.getNextMonthDate(today, val, 0)
  330. this.nextDate = val > day ? currentMonth : nextMonth
  331. }
  332. // immediate: true
  333. },
  334. quarterCheck: {
  335. handler: function (val, oldVal) {
  336. if (val === '') {
  337. this.nextDate = ''
  338. return
  339. }
  340. const quarterList = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
  341. const today = new Date()
  342. const month = today.getMonth() + 1
  343. const qu = this.getQuarter(today)
  344. const nowM = quarterList[qu - 1][val - 1]
  345. const nextM = quarterList[qu % 4][val - 1]
  346. const endMonth = month >= nowM ? nextM : nowM
  347. const yearPJ = today.getFullYear()
  348. const monthPJ = endMonth > 9 ? endMonth : '0' + endMonth
  349. this.nextDate = yearPJ + '-' + monthPJ + '-01'
  350. }
  351. // immediate: true
  352. },
  353. halfYearCheck: {
  354. handler: function (val, oldVal) {
  355. if (val === '') {
  356. this.nextDate = ''
  357. return
  358. }
  359. const midList = [[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12]]
  360. const today = new Date()
  361. const month = today.getMonth() + 1
  362. const qu = month > 6 ? 2 : 1
  363. const nowM = midList[qu - 1][val - 1]
  364. const nextM = midList[qu % 2][val - 1]
  365. const endMonth = month >= nowM ? nextM : nowM
  366. const yearPJ = today.getFullYear()
  367. const monthPJ = endMonth > 9 ? endMonth : '0' + endMonth
  368. this.nextDate = yearPJ + '-' + monthPJ + '-01'
  369. }
  370. // immediate: true
  371. },
  372. yearCheck: {
  373. handler: function (val, oldVal) {
  374. if (val === '') {
  375. this.nextDate = ''
  376. return
  377. }
  378. const today = new Date()
  379. const month = today.getMonth() + 1
  380. const year = today.getFullYear()
  381. const qu = month >= val ? year + 1 : year
  382. const monthPJ = val > 9 ? val : '0' + val
  383. this.nextDate = qu + '-' + monthPJ + '-01'
  384. }
  385. // immediate: true
  386. }
  387. },
  388. mounted () {
  389. this.init()
  390. },
  391. methods: {
  392. // 接收自定义组件数据
  393. onFacilityData (...arg) {
  394. if (arg.length > 1) {
  395. this.form.lie_biao_shu_ju_ = arg[1]
  396. }
  397. },
  398. init () {
  399. const pos = this.$store.getters.level.second ? this.$store.getters.level.second : this.$store.getters.level.first
  400. const sql1 = `select * from t_qypzb where di_dian_='${pos}'`
  401. this.$common.request('sql', sql1).then(res => {
  402. const { data = [] } = res.variables || {}
  403. this.quYuList = data
  404. })
  405. const sql2 = `select * from t_jjqfjb where di_dian_='${pos}'`
  406. this.$common.request('sql', sql2).then(res => {
  407. const { data = [] } = res.variables || {}
  408. this.fangJianList = data.filter(item => item.fang_jian_ming_ha)
  409. })
  410. },
  411. // 格式化数据
  412. formatForm () {
  413. // 监测日期格式化
  414. switch (this.form.jian_ce_zhou_qi_) {
  415. case '每日':
  416. if (!this.dayCheck || this.dayCheck.length === 0) {
  417. this.form.jian_ce_ri_qi_ = ''
  418. this.form.ri_qi_lie_biao_ = ''
  419. } else if (this.dayCheck.length === 7) {
  420. this.form.jian_ce_ri_qi_ = '每天'
  421. this.form.ri_qi_lie_biao_ = '1,2,3,4,5,6,7'
  422. } else {
  423. this.dayCheck.sort(function (a, b) {
  424. return a - b
  425. })
  426. this.form.jian_ce_ri_qi_ = '每周' + this.dayCheck.join(',')
  427. this.form.ri_qi_lie_biao_ = this.dayCheck.join(',')
  428. }
  429. break
  430. case '每周':
  431. if (this.weekCheck) {
  432. this.form.jian_ce_ri_qi_ = '每周' + this.weekCheck
  433. this.form.ri_qi_lie_biao_ = this.weekCheck + ''
  434. } else {
  435. this.form.jian_ce_ri_qi_ = ''
  436. this.form.ri_qi_lie_biao_ = ''
  437. }
  438. break
  439. case '每月':
  440. if (this.monthCheck) {
  441. this.form.jian_ce_ri_qi_ = '每个月第' + this.monthCheck + '天'
  442. this.form.ri_qi_lie_biao_ = this.monthCheck + ''
  443. } else {
  444. this.form.jian_ce_ri_qi_ = ''
  445. this.form.ri_qi_lie_biao_ = ''
  446. }
  447. break
  448. case '每季度':
  449. if (this.quarterCheck) {
  450. this.form.jian_ce_ri_qi_ = '每季度第' + [this.quarterCheck] + '个月'
  451. this.form.ri_qi_lie_biao_ = this.quarterCheck + ''
  452. } else {
  453. this.form.jian_ce_ri_qi_ = ''
  454. this.form.ri_qi_lie_biao_ = ''
  455. }
  456. break
  457. case '每半年':
  458. if (this.halfYearCheck) {
  459. this.form.jian_ce_ri_qi_ = '每半年第' + [this.halfYearCheck] + '个月'
  460. this.form.ri_qi_lie_biao_ = this.halfYearCheck + ''
  461. } else {
  462. this.form.jian_ce_ri_qi_ = ''
  463. this.form.ri_qi_lie_biao_ = ''
  464. }
  465. break
  466. case '每年':
  467. if (this.yearCheck) {
  468. this.form.jian_ce_ri_qi_ = '每年第' + [this.yearCheck] + '个月'
  469. this.form.ri_qi_lie_biao_ = this.yearCheck + ''
  470. } else {
  471. this.form.jian_ce_ri_qi_ = ''
  472. this.form.ri_qi_lie_biao_ = ''
  473. }
  474. break
  475. default:
  476. break
  477. }
  478. },
  479. checkForm () {
  480. if (this.form.bu_men_ === '') {
  481. throw new Error('部门信息缺失!')
  482. }
  483. if (this.form.jian_ce_ri_qi_ === '') {
  484. throw new Error('监测日期信息缺失!')
  485. }
  486. if (this.form.jian_ce_gang_wei_ === '') {
  487. throw new Error('监测岗位信息缺失!')
  488. }
  489. if (this.form.lie_biao_shu_ju_) {
  490. const lie_biao_shu_ju_ = JSON.parse(this.form.lie_biao_shu_ju_)
  491. for (let i = 0; i < lie_biao_shu_ju_.length; i++) {
  492. const item = lie_biao_shu_ju_[i]
  493. if (!item.label && (item.range.length !== 2 || item.range[0] === null || item.range[1] === null) && (!item.fixValue)) {
  494. throw new Error(`第${i + 1}行数据非法!`)
  495. }
  496. }
  497. }
  498. },
  499. submit () {
  500. try {
  501. this.formatForm()
  502. this.checkForm()
  503. this.$emit('onSubmit', { form: this.form, isEdit: this.isEdit })
  504. } catch (error) {
  505. this.$message.warning(error.message)
  506. }
  507. },
  508. close () {
  509. this.$emit('onClose')
  510. },
  511. // 格式化监测日期
  512. formatData () {
  513. if (this.form.jian_ce_ri_qi_) {
  514. this.$nextTick(() => {
  515. switch (this.form.jian_ce_zhou_qi_) {
  516. case '每日':
  517. if (this.form.jian_ce_ri_qi_ === '每天') {
  518. this.dayCheck = [1, 2, 3, 4, 5, 6, 7]
  519. } else {
  520. this.dayCheck = this.form.jian_ce_ri_qi_.split('每周')[1].split(',').map(item => +item)
  521. }
  522. break
  523. case '每周':
  524. this.weekCheck = +this.form.jian_ce_ri_qi_.split('每周')[1]
  525. break
  526. case '每月':
  527. this.monthCheck = +this.form.jian_ce_ri_qi_.split('每个月第')[1].split('天')[0]
  528. break
  529. case '每季度':
  530. this.quarterCheck = +this.form.jian_ce_ri_qi_.split('每季度第')[1].split('个月')[0]
  531. break
  532. case '每半年':
  533. this.halfYearCheck = +this.form.jian_ce_ri_qi_.split('每半年第')[1].split('个月')[0]
  534. break
  535. case '每年':
  536. this.yearCheck = +this.form.jian_ce_ri_qi_.split('每年第')[1].split('个月')[0]
  537. break
  538. default:
  539. break
  540. }
  541. })
  542. }
  543. },
  544. open (row, jianCeGangWeiList, parentForm) {
  545. this.dialogVisible = true
  546. this.jianCeGangWeiList = jianCeGangWeiList
  547. this.lei_xing_ = parentForm.lei_xing_
  548. this.isEdit = !!(row && row.zi_wai_deng_wai_j)
  549. // 编辑
  550. if (this.isEdit) {
  551. this.form = JSON.parse(JSON.stringify(row))
  552. } else {
  553. this.form.zi_wai_deng_wai_j = this.$utils.guid()
  554. this.form.bu_men_ = parentForm.bian_zhi_bu_men_
  555. this.form.jian_ce_gang_wei_ = parentForm.gang_wei_
  556. this.form.jian_ce_ri_qi_ = parentForm.jian_ce_ri_qi_
  557. this.form.kong_zhi_tiao_jia = parentForm.tiao_jian_
  558. this.form.jian_ce_zhou_qi_ = parentForm.zhou_qi_
  559. this.form.ri_qi_lie_biao_ = parentForm.ri_qi_lie_biao_
  560. this.form.lie_biao_shu_ju_ = parentForm.lie_biao_shu_ju_
  561. }
  562. this.formatData()
  563. },
  564. getDayDate (type, dates) {
  565. const now = new Date()
  566. const nowTime = now.getTime()
  567. const day = now.getDay()
  568. const longTime = 24 * 60 * 60 * 1000
  569. const n = longTime * 7 * (dates || 0)
  570. let dd = nowTime - (day - type) * longTime + n
  571. dd = new Date(dd)
  572. const y = dd.getFullYear()
  573. let m = dd.getMonth() + 1
  574. let d = dd.getDate()
  575. m = m < 10 ? '0' + m : m
  576. d = d < 10 ? '0' + d : d
  577. const daynow = y + '-' + m + '-' + d
  578. return daynow
  579. },
  580. // 获取往后几个月相应的日期
  581. // currentDate:当前日期
  582. // dayOfMonth:获取几号
  583. // val:往后几个月
  584. getNextMonthDate (currentDate, dayOfMonth, val) {
  585. const currentYear = currentDate.getFullYear()
  586. const currentMonth = currentDate.getMonth()
  587. const nextMonth = currentMonth + val
  588. const nextMonthDate = new Date(currentYear, nextMonth, dayOfMonth)
  589. const formattedDate = nextMonthDate.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '-')
  590. return formattedDate
  591. },
  592. // 获取当前季度
  593. getQuarter (date) {
  594. return Math.floor(date.getMonth() / 3) + 1
  595. }
  596. }
  597. }
  598. </script>
  599. <style lang="scss">
  600. .contain{
  601. .main{
  602. padding: 20px;
  603. height: 60vh;
  604. .el-row{
  605. margin: 10px 0;
  606. }
  607. }
  608. .el-row{
  609. margin: 0 !important;
  610. }
  611. }
  612. .dialog-footer{
  613. display: flex;
  614. justify-content: center;
  615. }
  616. ::v-deep {
  617. .el-form-item__label{
  618. text-align: left
  619. }
  620. }
  621. </style>