| | |
| | | }).then((response) => { |
| | | resolve(response.data); |
| | | }).catch((error) => { |
| | | if (error.status == 400) { |
| | | if (error?.status == 400) { |
| | | ElMessage({ |
| | | message: error.data.msg, |
| | | type: 'warning', |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2024-05-04 16:37:48 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-04 17:14:15 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/Add.vue |
| | | --> |
| | | <template> |
| | | <el-container> |
| | | <el-form style="width: 100%;" :model="form" :rules="rules" ref="dialogForm" label-width="120px" |
| | | label-position="center"> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <el-form-item label="ç产æ¥åç¼å·" prop="code"> |
| | | <el-input v-model="form.code" placeholder="请è¾å
¥ç产æ¥åç¼å·" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="ç产æ¥ååç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥ç产æ¥ååç§°" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="åºç¨å¹´ä»½" prop="year"> |
| | | <el-select v-model="form.year" placeholder="" size="" @change="change"> |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" |
| | | :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="åºç¨æ¥æ" prop="date"> |
| | | <el-date-picker v-model="form.date" type="daterange" value-format="YYYY-MM-DD" |
| | | start-placeholder="å¼å§æ¥æ" end-placeholder="ç»ææ¥æ" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-row> |
| | | <el-col> |
| | | <el-button-group> |
| | | <el-button type="primary" :icon="ArrowLeft">Previous Page</el-button> |
| | | <el-button type="primary"> |
| | | Next Page<el-icon class="el-icon--right"> |
| | | <ArrowRight /> |
| | | </el-icon> |
| | | </el-button> |
| | | </el-button-group> |
| | | </el-col> |
| | | </el-row> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | export default { |
| | | data() { |
| | | return { |
| | | options: [], |
| | | form: {}, |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '' } |
| | | ], |
| | | code: [ |
| | | { required: true, message: '' } |
| | | ], |
| | | year: [ |
| | | { required: true, message: '' } |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | init() { |
| | | let len = 15 |
| | | let currentYear = moment().format('YYYY') - 0 |
| | | this.form.year = currentYear |
| | | |
| | | for (let i = 0; i < len; i++) { |
| | | this.options.push({ |
| | | label: currentYear + i, |
| | | value: currentYear + i |
| | | }) |
| | | } |
| | | this.form.date = [moment().format('YYYY-MM-DD'), moment(`${currentYear}-12-31`).format('YYYY-MM-DD')] |
| | | console.log(this.form) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |
| | |
| | | <!-- |
| | | * @Date: 2024-04-04 22:45:43 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-09 20:15:57 |
| | | * @LastEditTime: 2024-05-04 16:44:58 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/CalenderTab.vue |
| | | --> |
| | | <template> |
| | | <el-container> |
| | | <el-aside width="220px"> |
| | | <el-button type="primary" icon="el-icon-plus">æ°å»ºæ¥å</el-button> |
| | | <el-button type="primary" icon="el-icon-plus" @click="add">æ°å»ºæ¥å</el-button> |
| | | <div v-infinite-scroll="load"> |
| | | <el-card shadow="never" class="card" v-for="item in caleList" :key="item.id"> |
| | | <el-card shadow="never" class="card" v-for="item in caleList" :key="item.id" @click="select(item)"> |
| | | <h3>{{item.code}}</h3> |
| | | <p>æ¥ååç§°: {{item.name}}</p> |
| | | <p>åºç¨å¹´ä»½: {{item.year}}</p> |
| | |
| | | </el-aside> |
| | | <el-container> |
| | | <el-header> |
| | | <el-button type="primary">å
³èå·¥ä½</el-button> |
| | | <el-button type="primary">ç¼è¾æ¥å</el-button> |
| | | <el-button type="primary">å é¤</el-button> |
| | | <span>æ¥åã{{ selectInfo.code }}ã{{ selectInfo.name }}</span> |
| | | <el-button type="primary" style="margin-left: auto;" size="small">å
³èå·¥ä½</el-button> |
| | | <el-button type="primary" size="small">ç¼è¾æ¥å</el-button> |
| | | <el-popconfirm title="ç¡®å®å é¤åï¼" @confirm="table_del"> |
| | | <template #reference> |
| | | <el-button type="primary" size="small">å é¤</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </el-header> |
| | | <el-main> |
| | | <Calendar :min-date="minDate" :rows="1" disable-page-swipe :nav-visibility="''" :attributes='attributes'/> |
| | | <Calendar :min-date="minDate" :rows="1" disable-page-swipe :nav-visibility="''" |
| | | :attributes='attributes' /> |
| | | </el-main> |
| | | </el-container> |
| | | <el-drawer v-model="drawer" size="80%" title="ç产æ¥å" :direction="direction" :before-close="handleClose"> |
| | | <Add></Add> |
| | | </el-drawer> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { Calendar, DatePicker } from 'v-calendar'; |
| | | import 'v-calendar/style.css'; |
| | | |
| | | import Add from './Add.vue' |
| | | export default { |
| | | components: { |
| | | Calendar, |
| | | DatePicker |
| | | DatePicker, |
| | | Add |
| | | }, |
| | | data() { |
| | | return { |
| | | shiftList: [], |
| | | selectInfo: {}, |
| | | drawer: true, |
| | | attributes: [ |
| | | |
| | | ], |
| | |
| | | init () { |
| | | this.minDate = new Date('2024-01-01') |
| | | this.maxDate = new Date('2024-01-31') |
| | | this.$HTTP.post('/api/blade-cps/shift/list', { statusList: [1] }).then(res => { |
| | | if (res.code === 200) { |
| | | this.shiftList = res.data |
| | | } |
| | | }) |
| | | }, |
| | | load() { |
| | | select(row) { |
| | | this.selectInfo = { |
| | | ...row |
| | | } |
| | | }, |
| | | table_del() { |
| | | this.$HTTP.delete(`/api/blade-cps/calendar/${this.selectInfo.id}`).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success("æä½æå"); |
| | | this.load(true) |
| | | } |
| | | }) |
| | | }, |
| | | add() { |
| | | this.drawer = true |
| | | }, |
| | | load(flag) { |
| | | if (flag) this.current = 0; |
| | | if (this.current * 15 >= this.total) { |
| | | return |
| | | } |
| | |
| | | if (res?.data?.records) { |
| | | if (this.current === 1) { |
| | | this.caleList = res?.data?.records || [] |
| | | this.select(this.caleList[0]) |
| | | } else { |
| | | this.caleList.push( |
| | | ...res?.data?.records || [] |
| | | ) |
| | | } |
| | | |
| | | } |
| | | |
| | | }) |
| | | } |
| | | } |
| | |
| | | cursor: pointer; |
| | | margin: 12px 12px 12px 0; |
| | | } |
| | | |
| | | .vc-arrow { |
| | | display: none!important;; |
| | | display: none !important; |
| | | ; |
| | | } |
| | | </style> |
| | |
| | | this.shiftDetailDTOList = shiftDetailDTOList |
| | | |
| | | } |
| | | console.log(this.shiftDetailDTOList, '>>>?????s') |
| | | return this |
| | | }, |
| | | //表åæäº¤æ¹æ³ |
| | | submit() { |
| | | console.log(this.form, this.shiftDetailDTOList) |
| | | this.$refs.dialogForm.validate(async (valid) => { |
| | | if (valid) { |
| | | this.isSaveing = true; |
| | |
| | | |
| | | dayCharts() { |
| | | let { data = [], categories = [], startTime, end } = this.getData1() |
| | | console.log('>>>>>>', data) |
| | | return { |
| | | title: { |
| | | text: 'çå¶æ¦è§' |
| | |
| | | }) |
| | | let startTime = moment(moment().format('YYYY-MM-DD') + ' 00:00:00').add(base, 'm').unix() |
| | | let end = moment.unix(startTime).add(24, 'h').unix() |
| | | console.log(moment.unix(startTime).format('YYYY-MM-DD HH:mm:ss'), 'startTIme', moment.unix(end).format('YYYY-MM-DD HH:mm:ss')) |
| | | let data = []; |
| | | var types = [ |
| | | { name: 1, color: '#7b9ce1' }, |
| | |
| | | endTime.add(1, 'd') |
| | | } |
| | | let arrItem1 = endTime.diff(base) / 60000 |
| | | console.log('>>>>', arrItem1, arrItem0) |
| | | if (arrItem1 <= arrItem0) { |
| | | return this.$message.warning('å¼å§æ¶é´å¤§äºç»ææ¶é´ï¼è¯·éæ°è¾å
¥'); |
| | | } |
| | | console.log('>>>>', arrItem1, arrItem0) |
| | | // this.endDay = this.getDes(arrItem0) |
| | | arr.push(arrItem0, arrItem1) |
| | | this.value = arr |
| | |
| | | <!-- |
| | | * @Date: 2024-04-04 21:51:24 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-02 22:18:25 |
| | | * @LastEditTime: 2024-05-04 15:40:16 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/shift-calendar.vue |
| | | --> |
| | | <template> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | activeName: '2' |
| | | activeName: '1' |
| | | } |
| | | } |
| | | } |