dataEdit.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. <!--
  2. * @Description: 新增/编辑弹框
  3. * @Author: Sugar.
  4. * @Date: 2023-11-24 13:55:00
  5. * @LastEditors: Sugar.
  6. * @LastEditTime: 2023-11-24 13:55:00
  7. * @FilePath: \cattle_webui\src\views\otaMr\dialog\dataEdit.vue
  8. * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
  9. -->
  10. <template>
  11. <el-dialog
  12. :title="title"
  13. :visible.sync="open"
  14. width="80vw"
  15. append-to-body
  16. :close-on-click-modal="false"
  17. @close="cancel"
  18. >
  19. <div class="dialog">
  20. <div>
  21. <el-form :model="form" ref="form" size="small" :rules="rules" :inline="true" label-width="100px">
  22. </el-form>
  23. </div>
  24. <el-table
  25. row-key="tableId"
  26. ref="tables"
  27. v-loading="loading"
  28. :data="goodsList"
  29. border
  30. @selection-change="handleSelectionChange">
  31. <el-table-column type="selection" width="55"></el-table-column>
  32. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  33. <el-table-column label="票务价格ID" align="center" prop="id" />
  34. <el-table-column label="票档名称" align="center" prop="priceName" />
  35. <el-table-column label="场次开始时间" align="center" prop="timeStart" />
  36. <el-table-column label="场次结束时间" align="center" prop="timeEnd" />
  37. <el-table-column label="携程排期状态" align="center" prop="status">
  38. <template slot-scope="scope">
  39. <dict-tag :options="dict.type.tiktok_scheduling_status" :value="scope.row.status"/>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  43. <template slot-scope="scope">
  44. <el-button
  45. size="mini"
  46. type="text"
  47. v-if="scope.row.status"
  48. @click="openCalendarFun(scope.row)"
  49. >日历价格配置</el-button>
  50. <!-- <el-button
  51. size="mini"
  52. type="text"
  53. @click="submitForm1(scope.row)"
  54. >{{ scope.row.status == 1 ? '下架':'上架' }}</el-button> -->
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. </div>
  59. <span slot="footer" class="dialog-footer">
  60. <el-button @click="cancel">取消</el-button>
  61. <el-button
  62. type="primary"
  63. @click="submitForm"
  64. :disabled="!multipleSelection || multipleSelection.length == 0"
  65. :loading="loading"
  66. >
  67. <span v-if="loading">提交中...</span>
  68. <span v-else>推送已选</span>
  69. </el-button>
  70. </span>
  71. <!-- 选择日期 价格 -->
  72. <el-dialog
  73. :visible.sync="openCalendar"
  74. width="70%"
  75. class="text-dia-log-class"
  76. append-to-body
  77. :close-on-click-modal="false"
  78. @close="openPrice = false"
  79. >
  80. <div class="dialog calendar-dialog" v-loading="calendarLoading">
  81. <div>
  82. <el-button type="primary" @click="openCalendarPrice()">价格设置</el-button>
  83. <el-button type="primary" @click="checkIsClear()">一键清空</el-button>
  84. </div>
  85. <el-calendar v-model="timeValue">
  86. <template
  87. slot="dateCell"
  88. slot-scope="{date, data}">
  89. <div :class="['calendar_box', selectTime(data)]" @mouseover="mouseoverFun(data)" @click.stop="clickTimeFun(data)">
  90. <span>{{ data.day.split('-').slice(1).join('-') }}</span>
  91. <div style="width: 100%; display: flex;flex-wrap: wrap;" >
  92. <div
  93. :key="index"
  94. v-for="(item,index) in getPerFormList(data)"
  95. >
  96. {{ item.title }}:{{ item.money }}
  97. </div>
  98. </div>
  99. </div>
  100. </template>
  101. </el-calendar>
  102. </div>
  103. <span slot="footer" class="dialog-footer">
  104. <el-button @click="openCalendar = false">返回</el-button>
  105. </span>
  106. </el-dialog>
  107. <!-- 设置价格 -->
  108. <el-dialog
  109. title="价格设置"
  110. :visible.sync="openPrice"
  111. width="400px"
  112. class="text-dia-log-class"
  113. append-to-body
  114. :close-on-click-modal="false"
  115. @close="openPrice = false"
  116. >
  117. <div v-loading="priceLoading">
  118. <el-form :model="formPrice" ref="formPrice" size="small" :rules="rulesPrice" label-width="100px">
  119. <el-form-item label="日期区间">
  120. {{ showDate() }}
  121. </el-form-item>
  122. <el-form-item label="市场价" prop="originalAmount">
  123. <el-input-number v-model="formPrice.originalAmount" controls-position="right" :min="0"></el-input-number>
  124. </el-form-item>
  125. <el-form-item label="销售价" prop="saleAmount">
  126. <el-input-number v-model="formPrice.saleAmount" controls-position="right" :min="0"></el-input-number>
  127. </el-form-item>
  128. <el-form-item label="结算价" prop="costAmount">
  129. <el-input-number v-model="formPrice.costAmount" controls-position="right" :min="0"></el-input-number>
  130. </el-form-item>
  131. </el-form>
  132. </div>
  133. <span slot="footer" class="dialog-footer">
  134. <el-button @click="openPrice = false">返回</el-button>
  135. <el-button @click="submitFormPrice('formPrice','calendarPrice')">提交</el-button>
  136. </span>
  137. </el-dialog>
  138. </el-dialog>
  139. </template>
  140. <script>
  141. import {
  142. pushById,
  143. getCalendarPriceApi,
  144. setCalendarPriceApi,
  145. getPushListApi,
  146. deleteCalendarPriceApi } from "@/api/otaMr/ctrip";
  147. import moment from "moment"
  148. export default {
  149. name: "dataEdit",
  150. dicts: ['tiktok_category','tiktok_scheduling_status'],
  151. data() {
  152. return {
  153. title: "排期推送设置",
  154. model: "EDIT",
  155. open: false,
  156. loading: false,
  157. goodsList: [],
  158. form: {},
  159. rules: {
  160. poiId: [{ required: true, message: "请输入门店POIID", trigger: ["change","blur"] }],
  161. categoryId: [{ required: true, message: "请选择商品类目ID", trigger: ["change","blur"] }],
  162. },
  163. multipleSelection: [],
  164. openCalendar: false,
  165. timeValue: new Date(),
  166. timeValueObj: {
  167. prev: null,
  168. next: null,
  169. hover: null
  170. },
  171. calendarLoading: false,
  172. perFormList: [],
  173. openPrice: false,
  174. priceLoading: false,
  175. formPrice: {},
  176. rulesPrice: {
  177. originalAmount: [{ required: true, message: "请输入市场价", trigger: ["change","blur"] }],
  178. saleAmount: [{ required: true, message: "请输入销售价", trigger: ["change","blur"] }],
  179. costAmount: [{ required: true, message: "请输入结算价", trigger: ["change","blur"] }],
  180. },
  181. seatTypeId: null,
  182. calendarId: null,
  183. };
  184. },
  185. methods: {
  186. /**
  187. * 打开弹框
  188. * @date 2023-11-22
  189. * @param {any} obj
  190. * @returns {any}
  191. */
  192. async openDialog(title, obj, type) {
  193. this.loading = true
  194. this.open = true;
  195. this.goodsList = []
  196. this.multipleSelection = []
  197. this.timeValueObj = {}
  198. this.form = JSON.parse(JSON.stringify(obj))
  199. if(type == 'yesPush') {
  200. await this.getPushListFun(obj,type)
  201. } else {
  202. let list1 = []
  203. if(obj.sku?.length > 0) {
  204. obj.sku.forEach((item,index)=>{
  205. list1.push({
  206. ...item,
  207. tableId: "id_" + index
  208. })
  209. })
  210. }
  211. this.goodsList = JSON.parse(JSON.stringify(list1));
  212. }
  213. this.loading = false
  214. this.$nextTick(()=>{
  215. this.goodsList.forEach((item)=>{
  216. if(item.checkFlag == 1) {
  217. this.$refs.tables.toggleRowSelection(item,true)
  218. }
  219. })
  220. this.$refs["form"].clearValidate()
  221. })
  222. },
  223. /** 获取设置的日历价格 */
  224. async getPushListFun(obj,type) {
  225. try {
  226. let res = await getPushListApi({
  227. id: obj.id
  228. })
  229. if(res.code == 200) {
  230. let list = []
  231. if(type == 'yesPush') {
  232. list = res.data
  233. } else {
  234. // if( res.data && res.data.length > 0){
  235. // obj.sku.forEach((item,index)=>{
  236. // let obj1 = JSON.parse(JSON.stringify(item))
  237. // res.data.forEach((item1,index1)=>{
  238. // if(item1.id == obj1.id){
  239. // obj1 = JSON.parse(JSON.stringify(item1))
  240. // }
  241. // })
  242. // list.push({
  243. // ...obj1,
  244. // tableId: "id_" + index
  245. // })
  246. // })
  247. // this.goodsList = res.data
  248. // }else {
  249. // obj.sku.forEach((item,index)=>{
  250. // list.push({
  251. // ...item,
  252. // tableId: "id_" + index
  253. // })
  254. // })
  255. // }
  256. // 修改 取list中sku数据 2025.06/23
  257. if(obj.sku?.length > 0) {
  258. obj.sku.forEach((item,index)=>{
  259. list.push({
  260. ...item,
  261. tableId: "id_" + index
  262. })
  263. })
  264. }
  265. }
  266. this.goodsList = JSON.parse(JSON.stringify(list))
  267. }
  268. } catch (error) {
  269. this.loading = false
  270. }
  271. },
  272. /**
  273. * 保存
  274. * @date 2023-11-22
  275. * @returns {any}
  276. */
  277. submitForm() {
  278. this.$refs["form"].validate(async (valid) => {
  279. if (valid) {
  280. try {
  281. if(!this.multipleSelection && this.multipleSelection.length <= 0) {
  282. this.$message.error("请选择上推送的数据!!!");
  283. return
  284. }
  285. let flog = false
  286. let list = []
  287. this.multipleSelection.forEach((item)=>{
  288. list.push({
  289. ...item,
  290. status: 0,//item.status === 0 || item.status === -1 ? 1 : -1,
  291. checkFlag: 1
  292. })
  293. // if((!item.actualAmount && item.actualAmount !=0) || (!item.originAmount && item.originAmount !=0)) {
  294. // flog = true
  295. // }
  296. })
  297. if(flog) {
  298. this.$message.error("请输入销售价和结算价!!!");
  299. return
  300. }
  301. this.loading = true;
  302. const { code } = await pushById({
  303. ...this.form,
  304. sku: list
  305. });
  306. if (code === 200) {
  307. this.$message.success("操作成功!");
  308. this.$emit("getList");
  309. this.cancel();
  310. }
  311. } catch (error) {
  312. console.error("error====",error)
  313. } finally {
  314. this.loading = false;
  315. }
  316. }else {
  317. }
  318. })
  319. },
  320. /**
  321. * 单个保存
  322. * @date 2023-11-22
  323. * @returns {any}
  324. */
  325. async submitForm1(row) {
  326. try {
  327. console.log("row====",row)
  328. let flog = false
  329. let list = []
  330. let list1 = [{...row}]
  331. let list2 = []
  332. let flog1 = -1
  333. this.multipleSelection.forEach((item,index)=>{
  334. if(row.id == item.id) {
  335. flog1 = index
  336. }
  337. list2.push({
  338. ...item,
  339. status: 0,
  340. checkFlag: 1
  341. })
  342. })
  343. if(flog1 != -1 ) {
  344. }
  345. list1.forEach((item)=>{
  346. list.push({
  347. ...item,
  348. status: 0,
  349. checkFlag: 1
  350. })
  351. })
  352. if(flog) {
  353. this.$message.error("请输入销售价和结算价!!!");
  354. return
  355. }
  356. this.loading = true;
  357. const { code } = await pushById({
  358. ...this.form,
  359. sku: list
  360. });
  361. if (code === 200) {
  362. this.$message.success("操作成功!");
  363. this.$emit("getList");
  364. this.cancel();
  365. }
  366. } catch (error) {
  367. console.error("error====",error)
  368. } finally {
  369. this.loading = false;
  370. }
  371. },
  372. /**
  373. * 重置
  374. * @date 2023-11-22
  375. * @returns {any}
  376. */
  377. reset() {
  378. this.$refs["form"].clearValidate()
  379. },
  380. /**
  381. * 关闭弹框
  382. * @date 2023-11-22
  383. * @returns {any}
  384. */
  385. cancel() {
  386. this.reset();
  387. this.open = false;
  388. },
  389. isCheck(row){
  390. let flog = false
  391. this.multipleSelection.forEach((item,index)=>{
  392. if(item.tableId == row.tableId) {
  393. flog = true
  394. }
  395. })
  396. return flog
  397. },
  398. handleSelectionChange(val) {
  399. console.log("选中了====", val)
  400. this.multipleSelection = val;
  401. },
  402. getPerFormList(data) {
  403. let list = []
  404. this.perFormList.forEach((item,index)=>{
  405. if(item.priceDate && item.priceDate.indexOf(data.day) != -1) {
  406. list = [
  407. { title: '市场价', money: item.originalAmount + '元' },
  408. { title: '销售价', money: item.saleAmount + '元' },
  409. { title: '结算价', money: item.costAmount + '元' },
  410. ]
  411. }
  412. })
  413. return list
  414. },
  415. /** 打开价格设置 */
  416. openCalendarPrice(){
  417. if( this.timeValueObj.prev && this.timeValueObj.next ) {
  418. this.openPrice = true
  419. this.formPrice = {}
  420. this.$nextTick(()=>{
  421. this.$refs.formPrice.clearValidate()
  422. })
  423. }else {
  424. this.$message.error("请选择时间区间!!!");
  425. }
  426. },
  427. checkIsClear(){
  428. if (this.timeValueObj.prev && this.timeValueObj.next) {
  429. let minTime = moment(this.timeValueObj.prev).valueOf()
  430. let maxTime = moment(this.timeValueObj.next).valueOf()
  431. let startDate = null
  432. let endDate = null
  433. if (minTime > maxTime) {
  434. startDate = this.timeValueObj.next
  435. endDate = this.timeValueObj.prev
  436. } else {
  437. startDate = this.timeValueObj.prev
  438. endDate = this.timeValueObj.next
  439. }
  440. this.$modal.confirm('确定要清空勾选"' + startDate + '——' + endDate + '"的日期范围内的数据吗?').then(()=> {
  441. this.clearCalendarPrice()
  442. }).catch(() => {});
  443. } else {
  444. this.$message.error("请选择时间区间!!!");
  445. }
  446. },
  447. /** 一键清除 */
  448. async clearCalendarPrice() {
  449. try {
  450. if( this.timeValueObj.prev && this.timeValueObj.next ) {
  451. let minTime = moment(this.timeValueObj.prev).valueOf()
  452. let maxTime = moment(this.timeValueObj.next).valueOf()
  453. let startDate = null
  454. let endDate = null
  455. if(minTime > maxTime){
  456. startDate = this.timeValueObj.next
  457. endDate = this.timeValueObj.prev
  458. }else {
  459. startDate = this.timeValueObj.prev
  460. endDate = this.timeValueObj.next
  461. }
  462. let daysList = [];
  463. let SDate = moment(startDate);
  464. let EDate = moment(endDate);
  465. daysList.push({
  466. "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
  467. });
  468. while (SDate.add(1, "days").isBefore(EDate)) { // 注意这里add方法处理后SDate对象已经改变。
  469. daysList.push({
  470. "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
  471. });
  472. }
  473. if(this.timeValueObj.next != this.timeValueObj.prev){
  474. daysList.push({
  475. "priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
  476. });
  477. }
  478. let res = await deleteCalendarPriceApi({
  479. "id": this.form.id,
  480. "goodsId": this.form.goodsId,
  481. "seatTypeId": this.seatTypeId,
  482. "data": daysList
  483. })
  484. if(res.code == 200) {
  485. this.openPrice = false
  486. this.$modal.msgSuccess(res.msg);
  487. this.getCalendarPrice()
  488. }
  489. }else {
  490. this.$message.error("请选择时间区间!!!");
  491. }
  492. } catch (error) {
  493. }
  494. },
  495. submitFormPrice(formName,funName) {
  496. this.$refs[formName].validate((valid) => {
  497. if (valid) {
  498. this[funName]()
  499. } else {
  500. console.log('error submit!!');
  501. return false;
  502. }
  503. });
  504. },
  505. openCalendarFun(row){
  506. this.seatTypeId = row.seatTypeId
  507. this.calendarId = row.id
  508. this.$set(this,'timeValue',new Date())
  509. this.getCalendarPrice()
  510. },
  511. /** 获取设置的日历价格 */
  512. async getCalendarPrice() {
  513. try {
  514. this.timeValueObj = {}
  515. let res = await getCalendarPriceApi({
  516. "goodsId": this.form.goodsId,
  517. "seatTypeId": this.seatTypeId
  518. })
  519. if(res.code == 200) {
  520. this.openCalendar = true
  521. this.perFormList = res.data
  522. }
  523. } catch (error) {
  524. }
  525. },
  526. /** 设置价格 */
  527. async calendarPrice(type){
  528. try {
  529. if( this.timeValueObj.prev && this.timeValueObj.next ) {
  530. let minTime = moment(this.timeValueObj.prev).valueOf()
  531. let maxTime = moment(this.timeValueObj.next).valueOf()
  532. let startDate = null
  533. let endDate = null
  534. if(minTime > maxTime){
  535. startDate = this.timeValueObj.next
  536. endDate = this.timeValueObj.prev
  537. }else {
  538. startDate = this.timeValueObj.prev
  539. endDate = this.timeValueObj.next
  540. }
  541. let daysList = [];
  542. let SDate = moment(startDate);
  543. let EDate = moment(endDate);
  544. daysList.push({
  545. "id": null,
  546. "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
  547. "originalAmount": this.formPrice.originalAmount,
  548. "saleAmount": this.formPrice.saleAmount,
  549. "costAmount": this.formPrice.costAmount
  550. });
  551. while (SDate.add(1, "days").isBefore(EDate)) { // 注意这里add方法处理后SDate对象已经改变。
  552. daysList.push({
  553. "id": null,
  554. "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
  555. "originalAmount": this.formPrice.originalAmount,
  556. "saleAmount": this.formPrice.saleAmount,
  557. "costAmount": this.formPrice.costAmount
  558. });
  559. }
  560. if(this.timeValueObj.next != this.timeValueObj.prev){
  561. daysList.push({
  562. "id": null,
  563. "priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
  564. "originalAmount": this.formPrice.originalAmount,
  565. "saleAmount": this.formPrice.saleAmount,
  566. "costAmount": this.formPrice.costAmount
  567. });
  568. }
  569. console.log("daysList===",daysList)
  570. daysList.forEach((item,index)=>{
  571. this.perFormList.forEach((item1,index1)=>{
  572. if(moment(item.priceDate).format("YYYY-MM-DD") == moment(item1.priceDate).format("YYYY-MM-DD") ) {
  573. daysList[index].id = item1.id
  574. }
  575. })
  576. })
  577. let res = await setCalendarPriceApi({
  578. "id": this.calendarId,
  579. "goodsId": this.form.goodsId,
  580. "seatTypeId": this.seatTypeId,
  581. "data": daysList
  582. })
  583. if(res.code == 200) {
  584. this.openPrice = false
  585. this.getCalendarPrice()
  586. }
  587. }else {
  588. this.$message.error("请选择时间区间!!!");
  589. }
  590. } catch (error) {
  591. }
  592. },
  593. /** 选中得时间 */
  594. selectTime(data) {
  595. let srt = ''
  596. let newTime = moment(data.day).startOf('day').valueOf()
  597. let newTime1 = moment().startOf('day').valueOf()
  598. if(newTime < newTime1 ) {
  599. return "disable_time"
  600. }
  601. if( this.timeValueObj ) {
  602. if( this.timeValueObj.prev && this.timeValueObj.next ) {
  603. let minTime = moment(this.timeValueObj.prev).valueOf()
  604. let maxTime = moment(this.timeValueObj.next).valueOf()
  605. if(minTime > maxTime){
  606. if(minTime >= newTime && maxTime <= newTime){
  607. srt = 'is-select_time'
  608. }
  609. }else {
  610. if(minTime <= newTime && maxTime >= newTime){
  611. srt = 'is-select_time'
  612. }
  613. }
  614. }else if( this.timeValueObj.prev && !this.timeValueObj.next && this.timeValueObj.hover ){
  615. let minTime = moment(this.timeValueObj.prev).valueOf()
  616. let maxTime = moment(this.timeValueObj.hover).valueOf()
  617. if(minTime > maxTime){
  618. if(minTime >= newTime && maxTime <= newTime){
  619. srt = 'is-select_time_hover'
  620. }
  621. }else {
  622. if(minTime <= newTime && maxTime >= newTime){
  623. srt = 'is-select_time_hover'
  624. }
  625. }
  626. }
  627. }
  628. return srt
  629. },
  630. clickTimeFun(data) {
  631. let newTime1 = moment(data.day).startOf('day').valueOf()
  632. let newTime = moment().startOf('day').valueOf()
  633. if(newTime1 < newTime ) {
  634. return
  635. }
  636. if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
  637. return
  638. }
  639. if( !this.timeValueObj || !this.timeValueObj.prev ) {
  640. this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
  641. }else if( this.timeValueObj.prev && !this.timeValueObj.next ){
  642. this.timeValueObj.next = moment(data.day).format("YYYY-MM-DD")
  643. }else if( this.timeValueObj.prev && this.timeValueObj.next ) {
  644. this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
  645. this.timeValueObj.next = null
  646. }
  647. },
  648. mouseoverFun(data) {
  649. if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
  650. return
  651. }
  652. if( this.timeValueObj.prev && !this.timeValueObj.next ){
  653. this.timeValueObj.hover = moment(data.day).format("YYYY-MM-DD")
  654. this.timeValue = new Date(this.timeValueObj.hover)
  655. }
  656. },
  657. showDate(){
  658. let srt = ''
  659. let minTime = moment(this.timeValueObj.prev).valueOf()
  660. let maxTime = moment(this.timeValueObj.next).valueOf()
  661. let startDate = null
  662. let endDate = null
  663. if (minTime > maxTime) {
  664. startDate = this.timeValueObj.next
  665. endDate = this.timeValueObj.prev
  666. } else {
  667. startDate = this.timeValueObj.prev
  668. endDate = this.timeValueObj.next
  669. }
  670. return startDate + "至" + endDate
  671. }
  672. },
  673. watch:{
  674. timeValue(newValue,oldValue){
  675. }
  676. }
  677. };
  678. </script>
  679. <style lang="scss" scoped>
  680. .dialog {
  681. padding: 0 30px;
  682. max-height: 65vh;
  683. overflow-y: auto;
  684. }
  685. .dialog {
  686. padding: 0 30px;
  687. .upload-btn {
  688. width: 100px;
  689. height: 100px;
  690. background-color: #fbfdff;
  691. border: dashed 1px #c0ccda;
  692. border-radius: 5px;
  693. i {
  694. font-size: 30px;
  695. margin-top: 20px;
  696. }
  697. &-text {
  698. margin-top: -10px;
  699. }
  700. }
  701. .avatar {
  702. cursor: pointer;
  703. }
  704. }
  705. .calendar-dialog ::v-deep .el-calendar-table .el-calendar-day {
  706. padding: none !important;
  707. height: auto;
  708. }
  709. .calendar_box {
  710. width: 100%;
  711. min-height: 86px;
  712. }
  713. .disable_time {
  714. user-select: none;
  715. cursor: not-allowed;
  716. }
  717. .is-select_time {
  718. background-color: rgba(30,144,255,0.8);
  719. }
  720. .is-select_time_hover {
  721. background-color: rgba(30,144,255,0.4);
  722. }
  723. </style>