¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="shift_info"> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button type="primary" v-if="Object.keys(shiftSystemRow).length>0" @click="handleAdd" icon="plus">é
ç½®</a-button> |
| | | </div> |
| | | <!-- tableåºå-begin --> |
| | | <div style="width: 100%;flex: 1;overflow: auto"> |
| | | <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" |
| | | :dataSource="dataSource" :pagination="false" :loading="loading"> |
| | | <span |
| | | slot="shiftSubStatus" |
| | | slot-scope="text, record" |
| | | > |
| | | <span v-if="text == 0" style="color:red;">åç¨</span> |
| | | <span v-if="text == 1" style="color:green;">å¯ç¨</span> |
| | | </span> |
| | | <span |
| | | slot="isDaySpan" |
| | | slot-scope="text, record" |
| | | > |
| | | <span v-if="text == 'true'">æ¯</span> |
| | | <span v-if="text == 'false'">å¦</span> |
| | | </span> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link"> |
| | | <a-icon type="down"/> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item v-if="record.shiftSubStatus == 1"> |
| | | <a key="1" @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.shiftSubStatus == 0"> |
| | | <a key="2" @click="handleStatus(record.id,1)">å¯ç¨</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.shiftSubStatus == 1"> |
| | | <a key="3" @click="handleStatus(record.id,0)">åç¨</a> |
| | | </a-menu-item> |
| | | <a-menu-item > |
| | | <a key="4" @click="handleDelete(record.id)">å é¤</a> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | |
| | | <shift-info-model ref="modalForm" @ok="modalFormOk"></shift-info-model> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | requestPut, putAction, deleteAction |
| | | } from '@/api/manage' |
| | | import { |
| | | JeecgListMixin |
| | | } from '@/mixins/JeecgListMixin' |
| | | import ShiftInfoModel from './ShiftInfoModel' |
| | | |
| | | export default { |
| | | name: 'ShiftInfo', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | ShiftInfoModel |
| | | }, |
| | | props: { |
| | | shiftSystemRow: { |
| | | type: Object, |
| | | required: true, |
| | | default: {} |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | statusName: '', |
| | | disabled: true, |
| | | disableMixinCreated: true, |
| | | url: { |
| | | list: '/mdc/mdcShiftSub/queryPageList', |
| | | changeStatus: '/mdc/mdcShiftSub/updateSubStatusById', |
| | | deleteBatch: '/mdc/mdcShiftSub/deleteMdcShiftSub' |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: 'çæ¬¡', |
| | | align: 'center', |
| | | dataIndex: 'shiftSubName' |
| | | }, |
| | | { |
| | | title: 'å¼å§æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'startDate' |
| | | }, |
| | | { |
| | | title: 'ç»ææ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'endDate' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦è·¨å¤©', |
| | | align: 'center', |
| | | dataIndex: 'isDaySpan', |
| | | scopedSlots: { customRender: 'isDaySpan' } |
| | | }, |
| | | { |
| | | title: 'å¼å§ä¼æ¯æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'sleepStartDate' |
| | | }, |
| | | { |
| | | title: 'ç»æä¼æ¯æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'sleepEndDate' |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'shiftSubStatus', |
| | | scopedSlots: { customRender: 'shiftSubStatus' } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | handleAdd() { |
| | | this.$refs.modalForm.add(this.shiftSystemRow) |
| | | this.$refs.modalForm.title = 'çæ¬¡é
ç½®' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | }, |
| | | handleEdit(record) { |
| | | record.shiftId = this.shiftSystemRow.id |
| | | record.shiftName = this.shiftSystemRow.shiftName |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'çæ¬¡é
ç½®' |
| | | this.$refs.modalForm.disableSubmit = true |
| | | }, |
| | | handleDelete: function(record){ |
| | | if(!this.url.deleteBatch){ |
| | | this.$message.error("请设置url.delete屿§!") |
| | | return |
| | | } |
| | | var that = this; |
| | | deleteAction(that.url.deleteBatch, {id: record}).then((res) => { |
| | | if (res.success) { |
| | | // that.$message.success(res.message); |
| | | that.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | that.loadData(); |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | handleStatus(id, status) { |
| | | let _this = this |
| | | putAction(this.url.changeStatus, { id: id, status: status }).then((res) => { |
| | | if (res.success) { |
| | | // _this.$message.success('æä½æåï¼') |
| | | _this.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:"æä½æå" |
| | | }); |
| | | _this.loadData() |
| | | } else { |
| | | // _this.$message.warning('æä½å¤±è´¥ï¼') |
| | | _this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:"æä½å¤±è´¥" |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | shiftSystemRow(val) { // çå¬currSelected ååï¼å°åååçæ°å¼ä¼ éç» getCurrSelected äºä»¶ |
| | | this.queryParam.shiftId = val.id |
| | | this.loadData() |
| | | } |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .shift_info{ |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | @media screen and (min-width: 1920px){ |
| | | .shift_info{ |
| | | height: 748px!important; |
| | | } |
| | | } |
| | | @media screen and (min-width: 1680px) and (max-width: 1920px){ |
| | | .shift_info{ |
| | | height: 748px!important; |
| | | } |
| | | } |
| | | @media screen and (min-width: 1400px) and (max-width: 1680px){ |
| | | .shift_info{ |
| | | height: 600px!important; |
| | | } |
| | | } |
| | | @media screen and (min-width: 1280px) and (max-width: 1400px){ |
| | | .shift_info{ |
| | | height: 501px!important; |
| | | } |
| | | } |
| | | @media screen and (max-width: 1280px){ |
| | | .shift_info{ |
| | | height: 501px!important; |
| | | } |
| | | } |
| | | </style> |