1、首页公司级和分厂级看板中的问题列表接口完成与后端数据联调
2、问题反馈页面完成所有布局及相关功能
| | |
| | | getEquipmentOEEStatistics: productionCode => getAction('/mdc/home/equipmentOEEStatistics', { productionCode }), |
| | | // 设å¤OEEåå©ç¨çå¯¹æ¯ |
| | | getEquipmentMonthStatisticsApi: productionCode => getAction('/mdc/home/equipmentMonthStatistics', { productionCode }), |
| | | // é®é¢å表 |
| | | getWorkshopProblemListApi: productionCode => getAction('/mdc/home/feedbackList', { productionCode }), |
| | | // 工段级å7天å©ç¨çæçº¿å¾ |
| | | getEquipmentDayUtilizationStatisticsApi: productionCode => getAction('/mdc/home/equipmentDayUtilizationStatistics', { productionCode }), |
| | | // ä¸ä¸ªæå设å¤OEEç»è®¡ |
| | |
| | | thisMonthMaintenanceRealNum: 0, |
| | | nextMonthMaintenancePlanNum: 0, |
| | | nextNextMonthMaintenancePlanNum: 0, |
| | | twoMaintenanceChartData: [['-', '-', '-']], |
| | | twoMaintenanceChartData: [], |
| | | barChart: '', |
| | | barChartData: [], |
| | | doubleBarChart: '', |
| | | doubleBarChartData: {}, |
| | | workshopProblemChartData: [], |
| | | maintenanceConfig: {}, |
| | | problemConfig: {} |
| | | } |
| | |
| | | mounted() { |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | this.getChartDataByApi() |
| | | this.drawProblemChart() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | |
| | | this.getTwoMaintenanceChartDataByApi() |
| | | this.getBarChartDataByApi() |
| | | this.getDoubleBarChartDataByApi() |
| | | this.getWorkshopProblemChartDataByApi() |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·å设å¤è¿è¡ç¶æ */ |
| | |
| | | getTwoMaintenanceChartDataByApi() { |
| | | signageApi.getTwoMaintenancePlanListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content]) |
| | | if (res.success && res.result.length > 0) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content]) |
| | | this.drawMaintenanceChart() |
| | | }) |
| | | }, |
| | |
| | | this.drawDoubleBarChart() |
| | | }) |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·å车é´é®é¢å表*/ |
| | | getWorkshopProblemChartDataByApi() { |
| | | signageApi.getWorkshopProblemListApi(this.productionCode) |
| | | .then(res => { |
| | | if (res.success && res.result.length > 0) this.workshopProblemChartData = res.result.map(item => [item.content, item.createTime]) |
| | | this.drawWorkshopProblemChart() |
| | | }) |
| | | }, |
| | | |
| | | |
| | | /* ç»å¶è®¾å¤è¿è¡ç¶æç«ç°é¥¼å¾ */ |
| | | drawRunningStateChart(productionId) { |
| | |
| | | }, |
| | | |
| | | /* ç»å¶é®é¢æ»å¨è¡¨ */ |
| | | drawProblemChart() { |
| | | drawWorkshopProblemChart() { |
| | | this.problemConfig = { |
| | | indexHeader: 'åºå·', |
| | | header: ['æ¶é´', 'é®é¢å
容'], |
| | | header: ['é®é¢å
容', 'æ¶é´'], |
| | | headerBGC: '#86D186', |
| | | oddRowBGC: '#7CBF7C', |
| | | evenRowBGC: '#7CBF7C', |
| | | data: [ |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'] |
| | | ], |
| | | data: this.workshopProblemChartData, |
| | | index: true, |
| | | columnWidth: [100, 300, 300], |
| | | columnWidth: [100, 300, 150], |
| | | align: ['center'] |
| | | } |
| | | }, |
| | |
| | | barChartData: [], |
| | | doubleBarChart: '', |
| | | doubleBarChartData: {}, |
| | | workshopProblemChartData: [['-', '-', '-']], |
| | | efficiencyChartConfig: {}, |
| | | maintenanceConfig: {}, |
| | | problemConfig: {}, |
| | |
| | | mounted() { |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | this.getChartDataByApi() |
| | | this.drawProblemChart() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleWindowResize) |
| | |
| | | this.getTwoMaintenanceChartDataByApi() |
| | | this.getBarChartDataByApi() |
| | | this.getDoubleBarChartDataByApi() |
| | | this.getWorkshopProblemChartDataByApi() |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·å设å¤è¿è¡ç¶æ */ |
| | |
| | | getTwoMaintenanceChartDataByApi() { |
| | | signageApi.getTwoMaintenancePlanListApi() |
| | | .then(res => { |
| | | if (res.success && res.result) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content]) |
| | | if (res.success && res.result.length > 0) this.twoMaintenanceChartData = res.result.map(item => [item.centerName, item.maintenanceDate, item.content]) |
| | | this.drawMaintenanceChart() |
| | | }) |
| | | }, |
| | |
| | | .then(res => { |
| | | if (res.success) this.doubleBarChartData = res.result |
| | | this.drawDoubleBarChart() |
| | | }) |
| | | }, |
| | | |
| | | /* è°ç¨æ¥å£è·å车é´é®é¢å表*/ |
| | | getWorkshopProblemChartDataByApi() { |
| | | signageApi.getWorkshopProblemListApi() |
| | | .then(res => { |
| | | console.log('res', res.result) |
| | | if (res.success && res.result.length > 0) this.workshopProblemChartData = res.result.map(item => [item.content, item.createTime]) |
| | | this.drawWorkshopProblemChart() |
| | | }) |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | /* ç»å¶é®é¢æ»å¨è¡¨ */ |
| | | drawProblemChart() { |
| | | drawWorkshopProblemChart() { |
| | | this.problemConfig = { |
| | | indexHeader: 'åºå·', |
| | | header: ['æ¶é´', 'é®é¢å
容'], |
| | | header: [ 'é®é¢å
容', 'æ¶é´'], |
| | | headerBGC: '#86D186', |
| | | oddRowBGC: '#7CBF7C', |
| | | evenRowBGC: '#7CBF7C', |
| | | data: [ |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'], |
| | | // ['2024å¹´3æ23å·', '大家注æå®å
¨é®é¢'] |
| | | ], |
| | | data: this.workshopProblemChartData, |
| | | index: true, |
| | | columnWidth: [100, 300, 300], |
| | | columnWidth: [100, 300, 150], |
| | | align: ['center'] |
| | | } |
| | | }, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="车é´åç§°"> |
| | | <a-tree-select v-model="queryParam.productionId" :treeData="workshopTreeData" placeholder="è¯·éæ©è½¦é´" |
| | | :treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="2" :sm="2" :xs="2"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"> |
| | | <a-icon type="delete"/> |
| | | å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ |
| | | <a-icon type="down"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> |
| | | 已鿩 |
| | | <a style="font-weight: 600"> |
| | | {{selectedRowKeys.length }} |
| | | </a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:'max-content',y:465}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange" |
| | | > |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical"/> |
| | | |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <ProblemFeedbackModal ref="modalRef" :visible="modalVisible" :title="modalTitle" |
| | | :workshopTreeData="workshopTreeData" :treeDefaultExpandedKeys="treeDefaultExpandedKeys" |
| | | @handleCloseModal="handleCloseModal" @modalFormOk="modalFormOk"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { queryProductionTreeList } from '@/api/api' |
| | | import ProblemFeedbackModal from './modules/ProblemFeedbackList/ProblemFeedbackModal' |
| | | |
| | | export default { |
| | | name: 'ProblemFeedbackList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | ProblemFeedbackModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'é®é¢åé¦', |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 30, |
| | | pageSizeOptions: ['30', '50', '100'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '车é´', |
| | | align: 'center', |
| | | dataIndex: 'productionId_dictText', |
| | | width: 450 |
| | | }, |
| | | { |
| | | title: 'é®é¢å
容', |
| | | align: 'center', |
| | | dataIndex: 'content', |
| | | width: 660, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: 'æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'createTime', |
| | | width: 450 |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | width: 150, |
| | | fixed: 'right', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/mdc/mdcFeedback/list', |
| | | delete: '/mdc/mdcFeedback/delete', |
| | | deleteBatch: '/mdc/mdcFeedback/deleteBatch' |
| | | }, |
| | | workshopTreeData: [], |
| | | treeDefaultExpandedKeys: [], |
| | | modalVisible: false, |
| | | modalTitle: '' |
| | | } |
| | | }, |
| | | created() { |
| | | this.getWorkshopListByApi() |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è°ç¨æ¥å£è·åæ¥è¯¢åºåè½¦é´æ å表 |
| | | */ |
| | | getWorkshopListByApi() { |
| | | queryProductionTreeList().then(res => { |
| | | if (res.success) { |
| | | this.workshopTreeData = res.result |
| | | this.treeDefaultExpandedKeys = [...res.result].map(item => item.key) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleAdd() { |
| | | this.modalTitle = 'æ°å¢' |
| | | this.$refs.modalRef.model = {} |
| | | this.modalVisible = true |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»ç¼è¾æé®æå¼ç¼è¾çªå£ |
| | | * @param record ç¹å»è¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleEdit(record) { |
| | | this.modalTitle = 'ç¼è¾' |
| | | this.$refs.modalRef.model = Object.assign({}, record) |
| | | this.modalVisible = true |
| | | }, |
| | | |
| | | modalFormOk() { |
| | | // æ°å¢/ä¿®æ¹ æåæ¶ï¼éè½½å表 |
| | | this.loadData() |
| | | //æ¸
空å表éä¸ |
| | | this.onClearSelected() |
| | | this.handleCloseModal() |
| | | }, |
| | | |
| | | handleCloseModal() { |
| | | this.modalVisible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal :visible="visible" :title="title" @cancel="$emit('handleCloseModal')" @ok="handleSubmit"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="车é´" prop="productionId"> |
| | | <a-tree-select v-model="model.productionId" :treeData="workshopTreeData" placeholder="è¯·éæ©è½¦é´" |
| | | :treeDefaultExpandedKeys="treeDefaultExpandedKeys"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="é®é¢å
容" prop="content"> |
| | | <a-input v-model="model.content" placeholder="请è¾å
¥å
容"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'ProblemFeedbackModal', |
| | | components: {}, |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | title: { |
| | | type: String |
| | | }, |
| | | workshopTreeData: { |
| | | type: Array |
| | | }, |
| | | treeDefaultExpandedKeys: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | validatorRules: { |
| | | productionId: [ |
| | | { required: true, message: 'è¯·éæ©è½¦é´åç§°!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcFeedback/add', |
| | | edit: '/mdc/mdcFeedback/edit' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | handleSubmit() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | let apiUrl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | apiUrl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | apiUrl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(apiUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('modalFormOk') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |