src/views/eam/equipment/modules/EamEquipmentModal.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/eam/repair/EamReportRepairList.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/eam/repair/modules/EamReportRepairModal.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/eam/repair/modules/ImagesPreviewModal.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/views/eam/equipment/modules/EamEquipmentModal.vue
@@ -81,7 +81,7 @@ </a-row> </a-col> <a-col :span="6"> <j-image-upload text="设å¤å¾ç" biz="eam_equipment_image" v-model="model.equipmentImage"></j-image-upload> <j-image-upload text="设å¤å¾ç" bizPath="eam_equipment_image" v-model="model.equipmentImage"></j-image-upload> </a-col> </a-row> src/views/eam/repair/EamReportRepairList.vue
@@ -5,37 +5,59 @@ <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-input placeholder="请è¾å ¥æ éå¼å§æ¶é´" v-model="queryParam.faultStartTime"></a-input> <a-form-item label="设å¤ç¼å·"> <a-input placeholder="请è¾å ¥è®¾å¤ç¼å·" v-model="queryParam.equipmentId"/> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="åæ®ç¶æ"> <a-select placeholder="è¯·éæ©åæ®ç¶æ" v-model="queryParam.reportStatus" allow-clear> <a-select-option v-for="item in report_repair_status_list" :key="item.value">{{ item.label }} </a-select-option> </a-select> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="æ éç®ç§°"> <!-- <a-select placeholder="è¯·éæ©æ éç®ç§°" v-model="queryParam.faultName" allow-clear>--> <!-- <a-select-option v-for="item in faultReasonList" :key="item.faultName">--> <!-- {{ item.faultName }}--> <!-- </a-select-option>--> <!-- </a-select>--> <a-input placeholder="请è¾å ¥æ éç®ç§°" v-model="queryParam.faultName" allow-clear/> </a-form-item> </a-col> <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> <!-- <a-form-item label="æ éåç±»">--> <!-- <a-input placeholder="请è¾å ¥æ éåç±»" v-model="queryParam.faultType"></a-input>--> <!-- </a-form-item>--> <!-- </a-col>--> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="æ éæ¶é´"> <a-range-picker showTime v-model="faultTimeRange" value-format="YYYY-MM-DD HH:mm:ss" @change="handleTimeRangeChange" style="width: 100%"/> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="æ¯å¦åæº"> <a-radio-group v-model="queryParam.breakdownFlag"> <a-radio v-for="item in breakdown_flag_list" :value="item.value">{{ item.label }}</a-radio> </a-radio-group> </a-form-item> </a-col> <template v-if="toggleSearchStatus"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="æ¯å¦åæº"> <a-input placeholder="请è¾å ¥æ¯å¦åæº" v-model="queryParam.breakdownFlag"></a-input> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="设å¤ID"> <a-input placeholder="请è¾å ¥è®¾å¤ID" v-model="queryParam.equipmentId"></a-input> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="æ éåç±»"> <a-input placeholder="请è¾å ¥æ éåç±»" v-model="queryParam.faultType"></a-input> </a-form-item> </a-col> </template> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> <a @click="handleToggleSearch" style="margin-left: 8px"> {{ toggleSearchStatus ? 'æ¶èµ·' : 'å±å¼' }} <a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> </a> <a-button @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> <!-- <a @click="handleToggleSearch" style="margin-left: 8px">--> <!-- {{ toggleSearchStatus ? 'æ¶èµ·' : 'å±å¼' }}--> <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> <!-- </a>--> </span> </a-col> @@ -54,12 +76,12 @@ <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> <a-menu-item key="1" @click="batchDel"> <a-icon type="delete" /> å é¤ <a-icon type="delete"/> ä½åº </a-menu-item> </a-menu> <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /> <a-icon type="down"/> </a-button> </a-dropdown> </div> @@ -85,20 +107,28 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> <span slot="action" slot-scope="text, record"> <template slot="imageFiles" slot-scope="text, record" v-if="text"> <a @click="handlePreviewImages(record)">é¢è§</a> </template> <span slot="action" slot-scope="text, record" v-if="record.reportStatus=='WAIT_REPAIR'"> <a @click="handleEdit(record)">ç¼è¾</a> <a-divider type="vertical" /> <a-dropdown> <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> <a-menu slot="overlay"> <a-menu-item> <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> <a>å é¤</a> </a-popconfirm> </a-menu-item> </a-menu> </a-dropdown> <a-divider type="vertical"/> <a-popconfirm title="ç¡®å®ä½åºå?" @confirm="() => handleDelete(record.id)"> <a>ä½åº</a> </a-popconfirm> <!-- <a-dropdown>--> <!-- <a class="ant-dropdown-link">æ´å¤ <a-icon type="down"/></a>--> <!-- <a-menu slot="overlay">--> <!-- <a-menu-item>--> <!-- <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)">--> <!-- <a>å é¤</a>--> <!-- </a-popconfirm>--> <!-- </a-menu-item>--> <!-- </a-menu>--> <!-- </a-dropdown>--> </span> </a-table> @@ -106,7 +136,10 @@ <!-- tableåºå-end --> <!-- 表ååºå --> <eamReportRepair-modal ref="modalForm" @ok="modalFormOk"></eamReportRepair-modal> <eamReportRepair-modal ref="modalForm" :breakdownFlagList="breakdown_flag_list" :faultReasonList="faultReasonList" @ok="modalFormOk"/> <!-- å¾çé¢è§å¼¹çª --> <images-preview-modal ref="imagesPreviewModalRef" :imageListUrl="currentImageListUrl"/> </a-card> </template> @@ -114,11 +147,18 @@ import '@/assets/less/TableExpand.less' import EamReportRepairModal from './modules/EamReportRepairModal' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' import ImagesPreviewModal from '@views/eam/repair/modules/ImagesPreviewModal.vue' import { getAction } from '@/api/manage' export default { name: 'EamReportRepairList', mixins: [JeecgListMixin], components: { ImagesPreviewModal, LxSearchEquipmentSelect, EamReportRepairModal }, data() { @@ -137,39 +177,53 @@ } }, { title: 'æ éå¼å§æ¶é´', title: '设å¤ç¼å·', align: 'center', dataIndex: 'faultStartTime' dataIndex: 'equipmentId_dictText', width: 200 }, { title: 'æ¯å¦åæº', title: 'ç¶æ', align: 'center', dataIndex: 'breakdownFlag' dataIndex: 'reportStatus_dictText', width: 100 }, { title: '设å¤ID', title: 'æ éç®ç§°', align: 'center', dataIndex: 'equipmentId' dataIndex: 'faultName', width: 100 }, { title: 'æ éåç±»', align: 'center', dataIndex: 'faultType' dataIndex: 'faultType_dictText', width: 100 }, { title: 'æ éæè¿°', align: 'center', dataIndex: 'faultDescription' dataIndex: 'faultDescription', width: 200 }, { title: 'æ¥ä¿®ç¶æ', title: 'æ éå¼å§æ¶é´', align: 'center', dataIndex: 'reportStatus' dataIndex: 'faultStartTime', width: 200 }, { title: 'ç §çæä»¶ids;id以éå·åé', title: 'æ¯å¦åæº', align: 'center', dataIndex: 'imageFiles' dataIndex: 'breakdownFlag_dictText', width: 100 }, { title: 'æ¥ä¿®å¾ç', align: 'center', dataIndex: 'imageFiles', scopedSlots: { customRender: 'imageFiles' }, width: 100 }, { title: '夿³¨', @@ -180,15 +234,22 @@ title: 'æä½', dataIndex: 'action', align: 'center', scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }, width: 150 } ], breakdown_flag_list: [], report_repair_status_list: [], faultTimeRange: [], faultReasonList: [], currentImageListUrl: '', url: { list: '/eam/eamReportRepair/list', delete: '/eam/eamReportRepair/delete', deleteBatch: '/eam/eamReportRepair/deleteBatch', delete: '/eam/eamReportRepair/abolish', deleteBatch: '/eam/eamReportRepair/abolishBatch', exportXlsUrl: 'eam/eamReportRepair/exportXls', importExcelUrl: 'eam/eamReportRepair/importExcel' importExcelUrl: 'eam/eamReportRepair/importExcel', faultReasonList: '/eam/equipmentFaultReason/list' } } }, @@ -197,7 +258,65 @@ return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` } }, methods: {} created() { this.initDictData('breakdown_flag') this.initDictData('report_repair_status') this.getFaultReasonListByApi() }, methods: { /** * è·åæ°æ®åå ¸å¼ * @param dictCode æ°æ®åå ¸å¯¹åºè®°å½ç¼ç */ initDictData(dictCode) { // //ä¼å ä»ç¼åä¸è¯»ååå ¸é ç½® if (getDictItemsFromCache(dictCode)) { this[dictCode + '_list'] = getDictItemsFromCache(dictCode) return } //æ ¹æ®åå ¸Code, åå§ååå ¸æ°ç» ajaxGetDictItems(dictCode, null).then((res) => { if (res.success) { this[dictCode + '_list'] = res.result return } }) }, // è°ç¨æ¥å£è·åæ éåå å表 getFaultReasonListByApi() { const that = this getAction(this.url.faultReasonList) .then(res => { console.log('res', res) that.faultReasonList = res.result.records }) }, /** * æ éæ¶é´éæ©å¨ååæ¶è§¦å * @param valueArray */ handleTimeRangeChange(valueArray) { this.queryParam.startTime = valueArray[0] this.queryParam.endTime = valueArray[1] }, /** * é¢è§å¾ç * @param imageFiles è¡¨æ ¼è¡å¾çå°å */ handlePreviewImages({ imageFiles }) { this.currentImageListUrl = imageFiles this.$refs.imagesPreviewModalRef.visible = true }, searchReset() { this.queryParam = {} this.faultTimeRange = [] this.loadData(1) } } } </script> <style scoped> src/views/eam/repair/modules/EamReportRepairModal.vue
@@ -6,39 +6,78 @@ :confirmLoading="confirmLoading" switchFullscreen @ok="handleOk" @cancel="handleCancel" @cancel="close" :mask-closable="false" cancelText="å ³é"> <a-spin :spinning="confirmLoading"> <a-form-model ref="form" :model="model" :rules="validatorRules"> <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-row> <a-col :span="12"> <a-form-model-item prop="equipmentId" label="设å¤ç¼å·"> <lx-search-equipment-select placeholder="请è¾å ¥è®¾å¤ç¼å·æåç§°æç´¢" v-model="model.equipmentId"/> </a-form-model-item> </a-col> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag" label="å 餿 è®°"> <a-input-number v-model="model.delFlag"/> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultStartTime" label="æ éå¼å§æ¶é´"> <a-input placeholder="请è¾å ¥æ éå¼å§æ¶é´" v-model="model.faultStartTime" /> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="breakdownFlag" label="æ¯å¦åæº"> <a-input placeholder="请è¾å ¥æ¯å¦åæº" v-model="model.breakdownFlag" /> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设å¤ID"> <a-input placeholder="请è¾å ¥è®¾å¤ID" v-model="model.equipmentId" /> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultType" label="æ éåç±»"> <a-input placeholder="请è¾å ¥æ éåç±»" v-model="model.faultType" /> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultDescription" label="æ éæè¿°"> <a-input placeholder="请è¾å ¥æ éæè¿°" v-model="model.faultDescription" /> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reportStatus" label="æ¥ä¿®ç¶æ"> <a-input placeholder="请è¾å ¥æ¥ä¿®ç¶æ" v-model="model.reportStatus" /> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imageFiles" label="ç §çæä»¶ids;id以éå·åé"> <a-input placeholder="请è¾å ¥ç §çæä»¶ids;id以éå·åé" v-model="model.imageFiles" /> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="夿³¨"> <a-input placeholder="请è¾å ¥å¤æ³¨" v-model="model.remark" /> </a-form-model-item> <a-col :span="12"> <a-form-model-item prop="faultName" label="æ éç®ç§°"> <a-select placeholder="è¯·éæ©æ éç®ç§°" v-model="model.faultName" @change="handleFaultNameChange"> <a-select-option v-for="item in faultReasonList" :key="item.faultName"> {{ item.faultName }} </a-select-option> </a-select> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="12"> <a-form-model-item label="æ éåç±»"> <a-input placeholder="请è¾å ¥æ éåç±»" v-model="model.faultType_dictText" readOnly/> </a-form-model-item> </a-col> <a-col :span="12"> <a-form-model-item label="æ éæè¿°"> <a-input placeholder="请è¾å ¥æ éæè¿°" v-model="model.faultDescription" readOnly/> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="12"> <a-form-model-item prop="faultStartTime" label="æ éå¼å§æ¶é´"> <a-date-picker showTime placeholder="è¯·éæ©æ éå¼å§æ¶é´" v-model="model.faultStartTime" :allow-clear="false" value-format="YYYY-MM-DD HH:mm:ss"/> </a-form-model-item> </a-col> <a-col :span="12"> <a-form-model-item prop="breakdownFlag" label="æ¯å¦åæº"> <a-radio-group v-model="model.breakdownFlag"> <a-radio v-for="item in breakdownFlagList" :value="item.value">{{ item.label }}</a-radio> </a-radio-group> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="24"> <a-form-model-item prop="imageFiles" label="æ¥ä¿®å¾ç" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> <j-image-upload v-model="model.imageFiles" :is-multiple="true" :number="3"/> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="24"> <a-form-model-item prop="remark" label="夿³¨" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> <a-textarea placeholder="请è¾å ¥å¤æ³¨" v-model="model.remark"/> </a-form-model-item> </a-col> </a-row> <!-- <a-form-model-item prop="reportStatus" label="æ¥ä¿®ç¶æ">--> <!-- <a-input placeholder="请è¾å ¥æ¥ä¿®ç¶æ" v-model="model.reportStatus" />--> <!-- </a-form-model-item>--> </a-form-model> </a-spin> @@ -46,88 +85,122 @@ </template> <script> import { httpAction } from '@/api/manage' import moment from "moment" import { httpAction } from '@/api/manage' import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' export default { name: "EamReportRepairModal", data () { return { title:"æä½", visible: false, model: {}, labelCol: { xs: { span: 24 }, sm: { span: 5 }, }, wrapperCol: { xs: { span: 24 }, sm: { span: 16 }, }, confirmLoading: false, validatorRules:{ }, url: { add: "/eam/eamReportRepair/add", edit: "/eam/eamReportRepair/edit", }, export default { name: 'EamReportRepairModal', components: { LxSearchEquipmentSelect }, props: { breakdownFlagList: { type: Array }, faultReasonList: { type: Array } }, data() { return { title: 'æä½', visible: false, model: {}, labelCol: { xs: { span: 24 }, sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, sm: { span: 12 } }, labelColLong: { xs: { span: 24 }, sm: { span: 4 } }, wrapperColLong: { xs: { span: 24 }, sm: { span: 18 } }, confirmLoading: false, validatorRules: { faultStartTime: [ { required: true, message: 'è¯·éæ©æ éå¼å§æ¶é´' } ], breakdownFlag: [ { required: true, message: 'è¯·éæ©æ¯å¦åæº' } ], equipmentId: [ { required: true, message: '请è¾å ¥è®¾å¤ç¼å·æåç§°æç´¢' } ], faultName: [ { required: true, message: 'è¯·éæ©æ éç®ç§°' } ] }, url: { add: '/eam/eamReportRepair/add', edit: '/eam/eamReportRepair/edit' } } }, created() { }, methods: { add() { //åå§åé»è®¤å¼ this.edit({ breakdownFlag: this.breakdownFlagList.find(item => item.label === 'æ¯').value }) }, created () { edit(record) { this.model = Object.assign({}, record) this.visible = true }, methods: { add () { //åå§åé»è®¤å¼ this.edit({}); }, edit (record) { this.model = Object.assign({}, record); this.visible = true; }, close () { this.$emit('close'); this.visible = false; this.$refs.form.clearValidate(); }, handleOk () { const that = this; // 触å表åéªè¯ this.$refs.form.validate(valid => { if (valid) { that.confirmLoading = true; let httpurl = ''; let method = ''; if(!this.model.id){ httpurl+=this.url.add; method = 'post'; }else{ httpurl+=this.url.edit; method = 'put'; } httpAction(httpurl,this.model,method).then((res)=>{ if(res.success){ that.$message.success(res.message); that.$emit('ok'); }else{ that.$message.warning(res.message); } }).finally(() => { that.confirmLoading = false; that.close(); }) }else{ return false; handleFaultNameChange(value) { const faultReasonItem = this.faultReasonList.find(item => item.faultName === value) this.model.faultType = faultReasonItem.faultCategory this.model.faultType_dictText = faultReasonItem.faultCategory_dictText this.model.faultDescription = faultReasonItem.faultDescription }, handleOk() { const that = this // 触å表åéªè¯ console.log('model---------------', that.model) this.$refs.form.validate(valid => { if (valid) { that.confirmLoading = true let httpUrl = '' let method = '' if (!this.model.id) { httpUrl += this.url.add method = 'post' } else { httpUrl += this.url.edit method = 'put' } }) }, handleCancel () { this.close() }, httpAction(httpUrl, this.model, method).then((res) => { if (res.success) { that.$message.success(res.message) that.$emit('ok') } else { that.$message.warning(res.message) } }).finally(() => { that.confirmLoading = false that.close() }) } else { return false } }) }, close() { this.$emit('close') this.visible = false this.$refs.form.clearValidate() } } } </script> <style lang="less" scoped> src/views/eam/repair/modules/ImagesPreviewModal.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,56 @@ <template> <a-modal title="é¢è§" :visible="visible" width="50%" :footer="null" @cancel="visible=false"> <template v-for="(item,index) in imageListUrl.split(',')"> <img :src="getImageItemUrl(item)" width="100%;"/> <a-divider v-if="index+1<imageListUrl.split(',').length" style="margin:20px 0;background-color: #000"></a-divider> </template> </a-modal> </template> <script> export default { name: 'ImagesPreviewModal', props: { imageListUrl: { type: String, default: '' } }, data() { return { visible: false } }, methods: { getImageItemUrl(imageItemSrcSuffix) { return `${window._CONFIG['domianURL']}/${imageItemSrcSuffix}` } } } </script> <style scoped lang="less"> /deep/ .ant-modal { height: 70%; overflow: hidden; .ant-modal-content { height: 100%; display: flex; flex-direction: column; overflow: hidden; ::-webkit-scrollbar { width: 8px; height: 8px; } .ant-modal-body { flex: 1; overflow: auto; } } } </style>