| | |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-show="record.status === '5' && record.isNotStoveCategoryFlag == true && (record.stoveExemptStatus == '0' ||record.stoveExemptStatus == '1' ||record.stoveExemptStatus == '2')" |
| | | @click="handleStoveReport(record)" |
| | | v-has="'daily3MaintenanceOrder:StoveCategoryReport'" |
| | | >çç±»æ¥å</a> |
| | | <a-divider |
| | | v-show="record.status === '5'&& record.isNotStoveCategoryFlag == true && (record.stoveExemptStatus == '0' ||record.stoveExemptStatus == '1' ||record.stoveExemptStatus == '2')" |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-show="record.status === '5' && record.isNotStoveCategoryFlag == false && record.precisionParameters != '1'" |
| | | @click="handleTechnologyStatus(record)" |
| | | v-has="'daily3MaintenanceOrder:TechnologyStatus'" |
| | |
| | | ref="StoveCategoryModal" |
| | | @ok="modalFormOk" |
| | | ></stove-category-modal> |
| | | <stove-category-report-modal |
| | | ref="StoveCategoryReportModal" |
| | | @ok="modalFormOk" |
| | | ></stove-category-report-modal> |
| | | <maintenance-order-assign-modal |
| | | ref="MaintenanceOrderAssignModal" |
| | | @ok="modalFormOk" |
| | |
| | | import MaintenanceOrderChangeModal from './modules/dailyMaintenanceOrder/MaintenanceOrderChangeModal' |
| | | import EquipmentPrecisionCheckOrderModal from './modules/daily3MaintenanceOrder/EquipmentPrecisionCheckOrderModal' |
| | | import StoveCategoryModal from './modules/daily3MaintenanceOrder/StoveCategoryModal' |
| | | import StoveCategoryReportModal from './modules/daily3MaintenanceOrder/StoveCategoryReportModal' |
| | | import MaintenanceOrderAssignModal from './modules/dailyMaintenanceOrder/MaintenanceOrderAssignModal' |
| | | import DailyMaintenanceOrderExeDrawer from './modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer' |
| | | import EquipmentTechnologyStatusModal from './modules/daily3MaintenanceOrder/EquipmentTechnologyStatusModal' |
| | |
| | | DailyMaintenanceOrderExeDrawer, |
| | | MaintenanceOrderChangeModal, |
| | | StoveCategoryModal, |
| | | StoveCategoryReportModal, |
| | | EquipmentTechnologyStatusModal, |
| | | TechnologyStatusAuthenticateModal, |
| | | Maintenance3ReceiptModal, |
| | |
| | | this.$refs.StoveCategoryModal.title = "温度ååæ§æ£æµæ¡ä»¶ç¡®è®¤è¡¨"; |
| | | this.$refs.StoveCategoryModal.disableSubmit = false; |
| | | }, |
| | | handleStoveReport: function (record) { |
| | | this.$refs.StoveCategoryReportModal.add(); |
| | | this.$refs.StoveCategoryReportModal.title = "çç±»è®¾å¤æ¥åä¸ä¼ "; |
| | | this.$refs.StoveCategoryReportModal.disableSubmit = false; |
| | | this.$refs.StoveCategoryReportModal.maintenanceStandardId = record.id |
| | | this.$refs.StoveCategoryReportModal.equipmentId = record.equipmentId |
| | | }, |
| | | |
| | | handleOrderChange: function (record) { |
| | | this.$refs.MaintenanceOrderChangeModal.edit(record); |
| | |
| | | ></actual-work-hours-edit-table> |
| | | </div> |
| | | </a-tab-pane> |
| | | <a-tab-pane |
| | | tab='çç±»æ¥å' |
| | | key="7" |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <stove-category-report-list :maintenanceStandardId='this.model.id' /> |
| | | </div> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-card> |
| | | </template> |
| | |
| | | import MaintenanceStandardWorkInstruction from '../dailyMaintenanceOrder/MaintenanceStandardWorkInstruction' |
| | | import ActualMaterialEditTable from '../dailyMaintenanceOrder/ActualMaterialEditTable.vue' |
| | | import ActualWorkHoursEditTable from '../dailyMaintenanceOrder/ActualWorkHoursEditTable.vue' |
| | | import StoveCategoryReportList from './StoveCategoryReportList.vue' |
| | | |
| | | export default { |
| | | name: 'DailyMaintenanceOrderExeDrawer', |
| | |
| | | MaintenanceStandardSafetyRequirement, |
| | | MaintenanceStandardWorkInstruction, |
| | | ActualMaterialEditTable, |
| | | ActualWorkHoursEditTable |
| | | ActualWorkHoursEditTable, |
| | | StoveCategoryReportList |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | revocationDistable: false, |
| | | currentNodeSelect: '', |
| | | maintenanceStandardId: '-1', |
| | | maintenanceOrderId: '-1', |
| | | loading: false, |
| | | dataSource: [], |
| | | model: {}, |
| | |
| | | handleShow(record) { |
| | | this.model = Object.assign({}, record); |
| | | this.maintenanceStandardId = record.maintenanceStandardId |
| | | this.maintenanceOrderId = record.id |
| | | this.dataSource = [] |
| | | this.visible = true; |
| | | this.queryParam.dailyMaintenanceOrderId = record.id |
| | |
| | | return "background-color:rgba(127, 127, 127,0.08)"; |
| | | }, |
| | | handleCancel() { |
| | | debugger |
| | | this.maintenanceOrderId = '-1' |
| | | this.$emit('ok'); |
| | | this.alterFlag = new Date(); |
| | | this.close() |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | :class="'cust-erp-sub-tab'" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | <span |
| | | slot="size" |
| | | slot-scope="text" |
| | | class="error" |
| | | > |
| | | {{sizeConvert(text)}} |
| | | </span> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | |
| | | <Tooltip |
| | | placement="top" |
| | | title="é¢è§å¾ç" |
| | | > |
| | | <img |
| | | v-if="record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif')" |
| | | width="30" |
| | | height="14" |
| | | border="1" |
| | | draggable="false" |
| | | preview="1" |
| | | :preview-text="''" |
| | | :src="record.upload.src" |
| | | /> |
| | | </Tooltip> |
| | | |
| | | <a |
| | | v-if="record.upload.path && record.upload.format.toLowerCase()=='pdf'" |
| | | href="javascript:;" |
| | | @click="view(record)" |
| | | > |
| | | é¢è§ |
| | | </a> |
| | | |
| | | <a-divider |
| | | v-if="record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif'||record.upload.format.toLowerCase()=='pdf')" |
| | | type="vertical" |
| | | /> |
| | | |
| | | <a |
| | | href="javascript:;" |
| | | @click="handleDownload(record)" |
| | | >ä¸è½½</a> |
| | | <!-- |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> --> |
| | | |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | <pdf-view ref="pdfview"></pdf-view> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction, deleteAction, downFile } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import JEllipsis from "@/components/jeecg/JEllipsis"; |
| | | |
| | | import { preview } from 'vue-photo-preview' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import Vue from 'vue' |
| | | import PdfView from '@views/common/PdfView' |
| | | import { getFileAccessHttpUrl } from '@/api/manage'; |
| | | import store from '@/store/' |
| | | |
| | | export default { |
| | | name: "MaintenanceStandardWorkInstruction", |
| | | components: { |
| | | Tooltip, |
| | | JInput, |
| | | JEllipsis, |
| | | PdfView, |
| | | preview, |
| | | }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | maintenanceStandardId: { |
| | | type: String, |
| | | default: '-1', |
| | | required: false |
| | | } |
| | | }, |
| | | watch: { |
| | | maintenanceStandardId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if (!this.maintenanceStandardId) { |
| | | this.clearList() |
| | | } else { |
| | | this.queryParam['maintenanceStandardId'] = val; |
| | | this.queryParam['delFlag'] = 0; |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 100, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'æ¥åç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'num' |
| | | }, |
| | | |
| | | { |
| | | title: 'æ¥ååç§°', |
| | | align: 'center', |
| | | dataIndex: 'name' |
| | | }, |
| | | // { |
| | | // title: 'æ¥åç±»å', |
| | | // align: 'center', |
| | | // dataIndex: 'typeName' |
| | | // }, |
| | | { |
| | | title: 'æ¥å大å°', |
| | | align: 'center', |
| | | dataIndex: 'size', |
| | | scopedSlots: { customRender: 'size' }, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action' |
| | | }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/maintenanceStandardWorkInstruction/getMaintenanceStandardWorkInstructionList", |
| | | urlDownload: window._CONFIG['staticDomainURL'], |
| | | download: '/sys/upload/downloadFile', |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | clearList() { |
| | | this.dataSource = [] |
| | | this.selectedRowKeys = [] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.records.length; i++) { |
| | | let r = res.result.records[i].upload; |
| | | r.src = this.getSrc(res.result.records[i].upload); |
| | | } |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | handleDownload(record) { |
| | | downFile(this.url.download, { id: record.upload.id }).then((res) => { |
| | | if (!res) { |
| | | this.$message.warning('æä»¶ä¸è½½å¤±è´¥') |
| | | return |
| | | } else { |
| | | let fileName = record.name; |
| | | if (typeof window.navigator.msSaveBlob !== 'undefined') { |
| | | window.navigator.msSaveBlob(new Blob([res]), fileName); |
| | | } else { |
| | | let url = window.URL.createObjectURL(new Blob([res])); |
| | | let link = document.createElement('a'); |
| | | link.style.display = 'none'; |
| | | link.href = url; |
| | | link.setAttribute('download', fileName); |
| | | document.body.appendChild(link); |
| | | link.click() |
| | | document.body.removeChild(link) //ä¸è½½å®æç§»é¤å
ç´ |
| | | window.URL.revokeObjectURL(url) //éæ¾æblob对象 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //æ¼è£
src |
| | | getSrc(record) { |
| | | |
| | | if (!record.path) { |
| | | return ''; |
| | | } |
| | | //æ¬å°ï¼local\Minioï¼minio\é¿éäºï¼alioss |
| | | if (record.uploadType == 'local') { |
| | | |
| | | let ssoLoginFlag = Vue.ls.get("ssoLoginFlag"); |
| | | let deployMode = Vue.ls.get("deployMode"); |
| | | |
| | | if (ssoLoginFlag && deployMode == "container") { |
| | | var baseProject = Vue.ls.get("baseProject"); |
| | | console.log("baseProject==>" + baseProject) |
| | | |
| | | var hostname = window.location.protocol + "//" + window.location.host; |
| | | var url = hostname + '/' + baseProject + '/sys/common/static'; |
| | | return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer']) |
| | | } else { |
| | | //æ ¹æ®åå¸ç¶æä¿®æ¹https æ http |
| | | return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer']) |
| | | } |
| | | |
| | | } else if (record.uploadType == 'alioss') { |
| | | |
| | | const OSS = require('ali-oss') |
| | | const client = new OSS({ |
| | | // region以æå·ä¸ºä¾ï¼oss-cn-hangzhouï¼ï¼å
¶ä»regionæå®é
æ
åµå¡«åã |
| | | region: window._CONFIG['region'], |
| | | // é¿éäºä¸»è´¦å·AccessKeyæ¥æææAPIçè®¿é®æéï¼é£é©å¾é«ã强ç建议æ¨å建并使ç¨RAMè´¦å·è¿è¡APIè®¿é®ææ¥å¸¸è¿ç»´ï¼è¯·ç»å½RAMæ§å¶å°å建RAMè´¦å·ã |
| | | accessKeyId: window._CONFIG['accessKeyId'], |
| | | accessKeySecret: window._CONFIG['accessKeySecret'], |
| | | bucket: window._CONFIG['bucket'], |
| | | }) |
| | | // object-key表示ä»OSSä¸è½½æä»¶æ¶éè¦æå®å
嫿件åç¼å¨å
ç宿´è·¯å¾ï¼ä¾å¦abc/efg/123.jpgã |
| | | return client.signatureUrl(record.path) |
| | | } |
| | | }, |
| | | |
| | | |
| | | sizeConvert(limit) { |
| | | var size = ""; |
| | | if (limit < 0.1 * 1024) { |
| | | size = parseFloat(limit).toFixed(2) + "B";//å°äº0.1KBï¼å转åæB |
| | | } else if (limit < 0.1 * 1024 * 1024) { |
| | | size = (parseFloat(limit) / 1024).toFixed(2) + "KB";//å°äº0.1MBï¼å转åæKB |
| | | } else if (limit < 0.1 * 1024 * 1024 * 1024) { |
| | | size = (parseFloat(limit) / (1024 * 1024)).toFixed(2) + "MB";//å°äº0.1GBï¼å转åæMB |
| | | } else { |
| | | size = (parseFloat(limit) / (1024 * 1024 * 1024)).toFixed(2) + "GB";//å
¶ä»è½¬åæGB |
| | | } |
| | | var sizeStr = size + "";//转æå符串 |
| | | var index = sizeStr.indexOf(".");//è·åå°æ°ç¹å¤çç´¢å¼ |
| | | var dou = sizeStr.substr(index + 1, 2);//è·åå°æ°ç¹å两ä½çå¼ |
| | | if (dou == "00") {//夿å䏤使¯å¦ä¸º00ï¼å¦ææ¯åå é¤00 |
| | | return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2); |
| | | } |
| | | return size; |
| | | }, |
| | | |
| | | view(record) { |
| | | this.$refs.pdfview.showPdf(record.src); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="850" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æ¥åç¼ç " |
| | | > |
| | | <a-input |
| | | :disabled="disableSubmit" |
| | | placeholder="请è¾å
¥æ¥åç¼ç " |
| | | v-decorator="['num', validatorRules.num ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <!-- <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æ¥åç±»å" |
| | | > |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©ææ¡£ç±»å" |
| | | :triggerChange="true" |
| | | dictCode="mom_eam_document_type,name,id, del_flag!='1'" |
| | | v-decorator="['fileType', validatorRules.fileType ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æä»¶ä¸ä¼ " |
| | | > |
| | | <a-upload-dragger |
| | | name="file" |
| | | :customRequest="customRequest" |
| | | @change="handleChange" |
| | | :file-list="fileList" |
| | | :multiple="false" |
| | | > |
| | | <p class="ant-upload-drag-icon"> |
| | | <a-icon type="inbox" /> |
| | | </p> |
| | | <p class="ant-upload-text"> |
| | | ç¹å»ä¸ä¼ æææ½æä»¶è³è¯¥åºåè¿è¡ä¸ä¼ |
| | | </p> |
| | | <p class="ant-upload-hint"> |
| | | ä»
æ¯æåæä»¶ä¸ä¼ |
| | | </p> |
| | | </a-upload-dragger> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æ¥ååç§°" |
| | | > |
| | | <a-input |
| | | :disabled="true " |
| | | placeholder="请è¾å
¥æ¥ååç§°" |
| | | v-decorator="['name', validatorRules.name ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="ææ¯ç¶æ" |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | > |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©ææ¯ç¶æ" |
| | | :triggerChange="true" |
| | | dictCode="technology_status_stove" |
| | | v-decorator="['technologyStatus', validatorRules.technologyStatus ]" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æ¥åæè¿°" |
| | | > |
| | | <a-textarea |
| | | :disabled="disableSubmit" |
| | | placeholder="请è¾å
¥æ¥åæè¿°" |
| | | allow-clear |
| | | v-decorator="['description', validatorRules.description]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | <template slot='footer'> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleCancel" |
| | | :loading='confirmLoading' |
| | | > |
| | | åæ¶ |
| | | </a-button> |
| | | <a-popconfirm |
| | | @confirm="() => handleOk()" |
| | | title="ç¡®è®¤æ¤æä½ï¼" |
| | | > |
| | | <a-button |
| | | type='primary' |
| | | :loading='confirmLoading' |
| | | :style="{marginRight: '8px'}" |
| | | > |
| | | ç¡®å® |
| | | </a-button> |
| | | </a-popconfirm> |
| | | </template> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, postAction, postFileAction } from '@/api/manage' |
| | | import Vue from 'vue' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import JEllipsis from "@/components/jeecg/JEllipsis"; |
| | | import { ajaxGetDictItems } from '@/api/api' |
| | | import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" |
| | | |
| | | export default { |
| | | name: "StoveCategoryReportModal", |
| | | components: { |
| | | JInput, |
| | | Tooltip, |
| | | JEllipsis, |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | headers: {}, |
| | | validatorRules: { |
| | | num: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥ç¼ç ï¼' }, |
| | | { min: 0, max: 150, message: 'æé¿ 30 个å符', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | fileType: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥éæ©ç±»åï¼' }, |
| | | ] |
| | | }, |
| | | name: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥åç§°ï¼' }, |
| | | ] |
| | | }, |
| | | technologyStatus: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©ææ¯ç¶æï¼' }, |
| | | ] |
| | | }, |
| | | }, |
| | | url: { |
| | | add: "/eam/maintenanceStandardWorkInstruction/addStoveCategoryReport", |
| | | edit: "/eam/maintenanceStandardWorkInstruction/edit", |
| | | listByBusIdAndBusType: "/system/sysUploadRela/listByBusIdAndBusType", |
| | | }, |
| | | //ç¨äºå±ç¤ºæä»¶ |
| | | fileList: [], |
| | | fileObject: {}, |
| | | fileTypes: [], |
| | | //ç¨äºå¤æéä»¶çç¶æ addï¼æ°å¢é¡µé¢çéä»¶ editï¼ç¼è¾é¡µé¢çé件为被修æ¹i editUpdateï¼ç¼è¾é¡µé¢çéä»¶è¢«ä¿®æ¹ |
| | | isFileChange: false, |
| | | uploadId: '', |
| | | maintenanceStandardId: '', |
| | | equipmentId: '', |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | customRequest(val) { |
| | | if (this.fileList.length == 0) { |
| | | this.fileObject = val; |
| | | } |
| | | }, |
| | | |
| | | handleChange(info) { |
| | | //é»è®¤ç»éä»¶ç¶æï¼ä»
æ§å¶æ ·å¼ |
| | | let file = info.file; |
| | | //æä»¶æ´æ¹ï¼æ è®°æ´æ° |
| | | if (this.model.id) { |
| | | this.isFileChange = true; |
| | | } |
| | | //å é¤ |
| | | if (file.status == "removed") { |
| | | this.fileList = []; |
| | | this.fileObject.file = {}; |
| | | this.form.setFieldsValue({ name: '' }); |
| | | return false; |
| | | } |
| | | //åæä»¶æ§å¶ |
| | | if (this.fileList.length > 0) { |
| | | this.$message.warning("å½åä»
å
许ä¸ä¼ ä¸ä¸ªæä»¶ï¼"); |
| | | return false; |
| | | } |
| | | file.status = 'done'; |
| | | //页é¢å±ç¤ºä¸ä¼ æä»¶ |
| | | this.fileList.push(file); |
| | | this.form.setFieldsValue({ name: file.name }); |
| | | }, |
| | | |
| | | add() { |
| | | this.edit({}) |
| | | }, |
| | | |
| | | edit(record) { |
| | | let that = this; |
| | | that.visible = true; |
| | | that.isFileChange = false; |
| | | that.model = Object.assign({}, record); |
| | | that.fileList = []; |
| | | that.form.resetFields(); |
| | | that.uploadId = '' |
| | | if (record.isNoPhotoFlag) { |
| | | //è·åå½åæä»¶å¯¹åºéä»¶ |
| | | getAction(that.url.listByBusIdAndBusType, { busId: record.id, busType: 'maintenance_standard_work_instruction' }).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | that.fileList.push({ |
| | | uid: res.result[i].upload.id, |
| | | name: res.result[i].upload.name, |
| | | status: "done", |
| | | }) |
| | | that.$nextTick(() => { |
| | | that.form.setFieldsValue({ name: res.result[i].upload.name }); |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | that.form.validateFields((err, values) => { |
| | | if (JSON.stringify(that.fileObject.file) == '{}' && that.uploadId == '' && that.fileList.length == 0) { |
| | | that.$message.warning("请ä¸ä¼ æä»¶"); |
| | | return false |
| | | } |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!that.model.id) { |
| | | httpurl += that.url.add; |
| | | method = 'post'; |
| | | } else { |
| | | httpurl += that.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(that.model, values); |
| | | |
| | | formData.type = "maintenance_standard_work_instruction"; |
| | | formData.uploadId = that.uploadId; |
| | | // formData.fileType = "7";//æä»¶ç±»å 7ï¼å¾ç |
| | | formData.maintenanceStandardId = this.maintenanceStandardId; |
| | | formData.equipmentId = this.equipmentId |
| | | var saveDate = new FormData(); |
| | | |
| | | formData.isFileChange = that.isFileChange; |
| | | |
| | | saveDate.append("file", that.fileObject.file); |
| | | saveDate.append('data', JSON.stringify(formData)); |
| | | |
| | | postFileAction(httpurl, saveDate, this.headers).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(); |
| | | }) |
| | | } |
| | | }).catch((e) => { }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close(); |
| | | }, |
| | | // initFileTypes() { |
| | | // ajaxGetDictItems("common_upload_type", null).then((res) => { |
| | | // if (res.success) { |
| | | // this.fileTypes = res.result; |
| | | // } |
| | | // }) |
| | | // }, |
| | | |
| | | }, |
| | | |
| | | created() { |
| | | // this.initFileTypes(); |
| | | const token = Vue.ls.get(ACCESS_TOKEN); |
| | | const tenantid = Vue.ls.get(TENANT_ID) |
| | | this.headers = { |
| | | 'Content-Type': 'multipart/form-data', |
| | | "X-Access-Token": token, |
| | | 'X-Access-Tenant': tenantid |
| | | }; |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |