¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ææ¡£ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> |
| | | <a-input |
| | | placeholder="请è¾å
¥ææ¡£ç¼å·" |
| | | v-model="model.num" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ææ¡£ç±»å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileType"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©ææ¡£ç±»å" |
| | | :triggerChange="true" |
| | | dictCode="common_upload_type" |
| | | v-model="model.fileType" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ææ¡£ä¸ä¼ " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileType"> |
| | | <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-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="æä»¶åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> |
| | | <a-input |
| | | placeholder="请è¾å
¥æä»¶åç§°" |
| | | v-model="model.name" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-textarea |
| | | placeholder="请è¾å
¥å¤æ³¨" |
| | | allow-clear |
| | | v-model="model.remark" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import { getAction, postFileAction } from '../../../../api/manage' |
| | | import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" |
| | | import Vue from 'vue' |
| | | |
| | | export default { |
| | | name: "EquipmentDocumentModal", |
| | | components: { |
| | | }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | required:false, |
| | | default:'' |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | headers: {}, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | num:[ |
| | | { required: true, message: '请è¾å
¥ææ¡£ç¼å·ï¼' }, |
| | | ], |
| | | fileType:[ |
| | | { required: true, message: '请è¾å
¥éæ©ç±»åï¼' }, |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/equipmentDocument/add", |
| | | edit: "/eam/equipmentDocument/edit", |
| | | listByBusIdAndBusType: "/system/sysUploadRela/listByBusIdAndBusType", |
| | | }, |
| | | fileList: [], |
| | | fileObject: {}, |
| | | isFileChange: false, |
| | | uploadId: '', |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | // 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 |
| | | }; |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | 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.model.name='' |
| | | return false; |
| | | } |
| | | //åæä»¶æ§å¶ |
| | | if (this.fileList.length > 0) { |
| | | this.$message.warning("å½åä»
å
许ä¸ä¼ ä¸ä¸ªæä»¶ï¼"); |
| | | return false; |
| | | } |
| | | file.status = 'done'; |
| | | //页é¢å±ç¤ºä¸ä¼ æä»¶ |
| | | this.fileList.push(file); |
| | | this.model.name = file.name; |
| | | this.model = Object.assign({}, this.model); |
| | | |
| | | }, |
| | | edit (record) { |
| | | this.fileList = []; |
| | | this.uploadId = '' |
| | | this.model = Object.assign({}, record); |
| | | var that = this; |
| | | getAction(that.url.listByBusIdAndBusType, { busId: record.id, busType: 'equipment_file' }).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.model.name = res.result[i].upload.name |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | this.visible = true; |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (JSON.stringify(that.fileObject.file) == '{}' && that.uploadId == '' && that.fileList.length == 0) { |
| | | that.$message.warning("请ä¸ä¼ æä»¶"); |
| | | return false |
| | | } |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let formData = Object.assign({}, that.model); |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!that.model.id) { |
| | | httpurl += that.url.add; |
| | | method = 'post'; |
| | | formData.equipmentId = that.mainId; |
| | | } else { |
| | | httpurl += that.url.edit; |
| | | method = 'put'; |
| | | } |
| | | |
| | | formData.type = "equipment_file"; |
| | | formData.uploadId = that.uploadId; |
| | | // formData.fileType = "7";//æä»¶ç±»å 7ï¼å¾ç |
| | | 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(); |
| | | }) |
| | | |
| | | |
| | | }else{ |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | |
| | | |
| | | }, |
| | | |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" > |
| | | <a-row> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 设å¤åºç¡ä¿¡æ¯ </a-divider> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="è®¾å¤æå±åç±»" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentCategoryId"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©è®¾å¤æå±åç±»" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="mom_eam_equipment_category,name,id" |
| | | v-model="model.equipmentCategoryId" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ç»ä¸ç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> |
| | | <a-input v-model="model.num" placeholder="ç±ç³»ç»çæ" :disabled="formDisabled"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="设å¤åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> |
| | | <a-input v-model="model.name" placeholder="请è¾å
¥è®¾å¤åç§°" :disabled="formDisabled"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="åå·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model"> |
| | | <a-input v-model="model.model" placeholder="请è¾å
¥åå·" :disabled="formDisabled"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="è§æ ¼" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specification"> |
| | | <a-input v-model="model.specification" placeholder="请è¾å
¥è§æ ¼" :disabled="formDisabled" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="æ»åç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gpo"> |
| | | <a-input v-model="model.gpo" placeholder="请è¾å
¥æ»åç" :disabled="formDisabled"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="设å¤å¾ç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentPhoto"> |
| | | <j-image-upload |
| | | :isMultiple="false" |
| | | v-model="model.equipmentPhoto" |
| | | ></j-image-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">ç»´æ¤å使ç¨ä¿¡æ¯</a-divider> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ç»´æ¤é¨é¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manageId"> |
| | | <a-tree-select |
| | | :disabled="formDisabled" |
| | | style="width: 100%" |
| | | :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" |
| | | :tree-data="treeData" |
| | | placeholder="è¯·éæ©ç»´æ¤é¨é¨" |
| | | tree-default-expand-all |
| | | v-model="model.manageId" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="使ç¨é¨é¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useId"> |
| | | <a-tree-select |
| | | style="width: 100%" |
| | | :disabled="formDisabled" |
| | | :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" |
| | | :tree-data="treeData" |
| | | placeholder="è¯·éæ©ä½¿ç¨é¨é¨" |
| | | tree-default-expand-all |
| | | v-model="model.useId" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ç»´ä¿®çç»" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teamId"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="formDisabled" |
| | | placeholder="è¯·éæ©è´£ä»»çç»" |
| | | :triggerChange="true" |
| | | dictCode="mom_base_team,name,id,status='1' and del_flag='0'" |
| | | v-model="model.teamId" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="èµäº§å¶é å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="constructorId"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="formDisabled" |
| | | placeholder="è¯·éæ©èµäº§å¶é å" |
| | | :triggerChange="true" |
| | | dictCode="mom_base_constructor,name,id,status!='0' and del_flag!='1'" |
| | | v-model="model.constructorId" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">ç¶æåæ è¯</a-divider> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="å
³é®è®¾å¤æ è¯" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specificEquipment"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©å
³é®è®¾å¤æ è¯" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="specific_equipment" |
| | | v-model="model.specificEquipment" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="设å¤ç¶æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentStatus"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="formDisabled" |
| | | placeholder="请è¾å
¥è®¾å¤ç¶æ" |
| | | :triggerChange="true" |
| | | dictCode="equipment_status" |
| | | v-model="model.equipmentStatus" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ææ¯ç¶æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technologyStatus"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="formDisabled" |
| | | placeholder="è¯·éæ©ææ¯ç¶æ" |
| | | :triggerChange="true" |
| | | dictCode="technology_status" |
| | | v-model="model.technologyStatus" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">åºååå®è£
ä¿¡æ¯</a-divider> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="åºåç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryNumber"> |
| | | <a-input |
| | | :disabled="formDisabled" |
| | | placeholder="请è¾å
¥åºåç¼å·" |
| | | v-model="model.factoryNumber" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="åºåæ¥æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaveFactoryDate"> |
| | | <a-date-picker |
| | | :disabled="formDisabled" |
| | | placeholder="请è¾å
¥åºåæ¥æ" |
| | | style="width: 100%;" |
| | | v-model="model.leaveFactoryDate" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="éªæ¶æ¥æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="acceptanceCheckDate"> |
| | | <a-date-picker |
| | | :disabled="formDisabled" |
| | | placeholder="请è¾å
¥éªæ¶æ¥æ" |
| | | style="width: 100%;" |
| | | v-model="model.acceptanceCheckDate" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ç«é¡¹å¡å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectApprovalNo"> |
| | | <a-input v-model="model.projectApprovalNo" :disabled="formDisabled" placeholder="请è¾å
¥ç«é¡¹å¡å·" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="å·¥åº" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentUda1"> |
| | | <a-input v-model="model.equipmentUda1" placeholder="请è¾å
¥å·¥åº" :disabled="formDisabled" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="éé" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentUda3"> |
| | | <a-input v-model="model.equipmentUda3" :disabled="formDisabled" placeholder="请è¾å
¥éé" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="éé计éåä½" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentUda4"> |
| | | <a-input v-model="model.equipmentUda4" :disabled="formDisabled" placeholder="请è¾å
¥éé计éåä½ID" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="å®è£
ä½ç½®" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="location"> |
| | | <a-input v-model="model.location" placeholder="请è¾å
¥å®è£
ä½ç½®" :disabled="formDisabled" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="åè½ä½ç½®" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentUda5"> |
| | | <a-input v-model="model.equipmentUda5" :disabled="formDisabled" placeholder="请è¾å
¥åè½ä½ç½®" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="èµéæ¥æº" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fundSource"> |
| | | <a-input v-model="model.fundSource" :disabled="formDisabled" placeholder="请è¾å
¥èµéæ¥æº" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="èµäº§æ¥æºå½å®¶" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sourceCountry"> |
| | | <a-input v-model="model.sourceCountry" :disabled="formDisabled" placeholder="请è¾å
¥èµäº§æ¥æºå½å®¶" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="å®å
¨é
ç½®" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="securityConfiguration"> |
| | | <a-input v-model="model.securityConfiguration" :disabled="formDisabled" placeholder="请è¾å
¥å®å
¨é
ç½®" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="å·å´ç³»ç»" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="coolingSystem"> |
| | | <a-input v-model="model.coolingSystem" :disabled="formDisabled" placeholder="请è¾å
¥å·å´ç³»ç»" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="çç«å¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fireExtinguisher"> |
| | | <a-input v-model="model.fireExtinguisher" :disabled="formDisabled" placeholder="请è¾å
¥çç«å¨" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="çç«å¨æææ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fireExtinguisherValidityPeriod"> |
| | | <a-input v-model="model.fireExtinguisherValidityPeriod" :disabled="formDisabled" placeholder="请è¾å
¥çç«å¨æææ" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="æä½ç³»ç»" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operatingSystem"> |
| | | <a-input v-model="model.operatingSystem" :disabled="formDisabled" placeholder="请è¾å
¥æä½ç³»ç»" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ç³»ç»" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="system"> |
| | | <a-input v-model="model.system" :disabled="formDisabled" placeholder="请è¾å
¥ç³»ç»" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="端å£" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="port"> |
| | | <a-input v-model="model.port" :disabled="formDisabled" placeholder="请è¾å
¥ç«¯å£" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="åæ æ°é" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="coordinateNum"> |
| | | <a-input-number v-model="model.coordinateNum" :disabled="formDisabled" placeholder="请è¾å
¥åæ æ°é" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-input v-model="model.remark" placeholder="请è¾å
¥å¤æ³¨" :disabled="formDisabled" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">ABCæ è¯</a-divider> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="å¹³å使ç¨ç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardA"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©å¹³å使ç¨ç" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="ABC-standardA" |
| | | v-model="model.standardA" |
| | | @change="standardResultCompute" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="坿¿æ¢æ§" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardB"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©å¯æ¿æ¢æ§" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="ABC-standardB" |
| | | v-model="model.standardB" |
| | | @change="standardResultCompute" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="æ
éå½±å度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardC"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©æ
éå½±å度" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="ABC-standardC" |
| | | v-model="model.standardC" |
| | | @change="standardResultCompute" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ç产è¶
差度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardD"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©ç产è¶
差度" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="ABC-standardD" |
| | | v-model="model.standardD" |
| | | @change="standardResultCompute" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="æ
éé¢ç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardE"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©æ
éé¢ç" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="ABC-standardE" |
| | | @change="standardResultCompute" |
| | | v-model="model.standardE" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="设å¤ä»·å¼" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardF"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©è®¾å¤ä»·å¼" |
| | | :disabled="formDisabled" |
| | | :triggerChange="true" |
| | | dictCode="ABC-standardF" |
| | | v-model="model.standardF" |
| | | @change="standardResultCompute" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="ABCæ è¯" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentImportanceId"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="formDisabled" |
| | | placeholder ="è¯·éæ©ABCæ è¯" |
| | | :triggerChange="true" |
| | | dictCode="ABC-standard-result" |
| | | v-model="model.equipmentImportanceId" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> ç²¾åº¦åæ¨¡ç </a-divider> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="设å¤ç²¾åº¦ç®¡ç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="precisionParameters"> |
| | | <a-switch |
| | | :disabled="formDisabled" |
| | | checked-children="æ¯" |
| | | un-checked-children="å¦" |
| | | :checked="model.precisionParameters == '1'" |
| | | @change="handle2Switch(model.precisionParameters)" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6" v-if="model.precisionParameters == '1'"> |
| | | <a-form-model-item label="设å¤ç²¾åº¦æ¨¡ç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="precisionParametersTemplateId"> |
| | | <a-input-search |
| | | :disabled="formDisabled" |
| | | placeholder="è¯·éæ©è®¾å¤ç²¾åº¦æ¨¡æ¿" |
| | | enter-button |
| | | @search="onSearchPrecisionParametersTemplate()" |
| | | :read-only="true" |
| | | v-model="model.precisionParametersTemplateName" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item label="å·¥èºæ¨¡ç管ç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processParameters"> |
| | | <a-switch |
| | | :disabled="formDisabled" |
| | | checked-children="æ¯" |
| | | un-checked-children="å¦" |
| | | :checked="model.processParameters == '1'" |
| | | @change="handleSwitch(model.processParameters)" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6" v-if="model.processParameters == '1'"> |
| | | <a-form-model-item label="设å¤å·¥èºæ¨¡ç" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="precisionParametersTemplateId"> |
| | | <a-input-search |
| | | :disabled="formDisabled" |
| | | placeholder="è¯·éæ©è®¾å¤å·¥èºæ¨¡æ¿" |
| | | enter-button |
| | | @search="onSearchProcessParametersTemplate()" |
| | | :read-only="true" |
| | | v-model="model.processParametersTemplateName" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | <process-parameters-template-list |
| | | ref="ProcessParametersTemplateList" |
| | | @sendProcessParametersTemplateRecord='sendProcessParametersTemplateRecord' |
| | | ></process-parameters-template-list> |
| | | <precision-parameters-template-list |
| | | ref="PrecisionParametersTemplateList" |
| | | @sendPrecisionParametersTemplateRecord='sendPrecisionParametersTemplateRecord' |
| | | ></precision-parameters-template-list> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import pick from 'lodash.pick' |
| | | import { postAction, requestPut, getAction } from '@/api/manage' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import moment from 'moment' |
| | | import ProcessParametersTemplateList from '../equipment/ProcessParametersTemplateList' |
| | | import PrecisionParametersTemplateList from '../equipment/PrecisionParametersTemplateList' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | export default { |
| | | name: "EquipmentModal", |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | validateDuplicateValue, |
| | | ProcessParametersTemplateList, |
| | | PrecisionParametersTemplateList, |
| | | }, |
| | | props:{ |
| | | disableSubmit: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | }, |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | width:1500, |
| | | visible: false, |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | num: [ |
| | | { required: true, message: '请è¾å
¥è®¾å¤ç¼å·!' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' }, |
| | | { validator: this.validateNum }, |
| | | ], |
| | | name:[ |
| | | { required: true, message: '请è¾å
¥è®¾å¤åç§°!' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' }, |
| | | { validator: this.validateName }, |
| | | ], |
| | | teamId:[ |
| | | { required: true, message: 'è¯·éæ©è´£ä»»çç»!' }, |
| | | ], |
| | | processParametersTemplateName:[ |
| | | { required: true, message: 'è¯·éæ©å·¥èºåæ°æ¨¡æ¿!' }, |
| | | ], |
| | | precisionParametersTemplateName: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤ç²¾åº¦æ¨¡æ¿!' }, |
| | | ], |
| | | remark:[ |
| | | { min: 0, max: 100, message: 'é¿åº¦ä¸è¶
è¿ 100 个å符', trigger: 'blur' }, |
| | | ], |
| | | equipmentCategoryId:[ |
| | | { required: true, message: '请éå设å¤ç±»å«!' }, |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/equipment/add", |
| | | edit: "/eam/equipment/edit", |
| | | loadOptions: '/sys/sysDepart/loadDepartTreeOptions', |
| | | }, |
| | | treeData: [], |
| | | |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.initOptions(); |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | console.log(this.disabled) |
| | | 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 |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | validateNum(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'mom_eam_equipment', |
| | | fieldName: 'num', |
| | | fieldVal: value, |
| | | dataId: this.model.id, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: '0', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("ç¼å·å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //éªè¯ åç§° |
| | | validateName(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'mom_eam_equipment', |
| | | fieldName: 'name', |
| | | fieldVal: value, |
| | | dataId: this.model.id, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: '0', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("åç§°å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleSwitch(processParameters) { |
| | | if ('1' == processParameters) { |
| | | this.model.processParameters = '0' |
| | | } else { |
| | | this.model.processParameters = '1' |
| | | } |
| | | this.model = Object.assign({},this.model); |
| | | }, |
| | | handle2Switch(precisionParameters) { |
| | | if ('1' == precisionParameters) { |
| | | this.model.precisionParameters = '0' |
| | | } else { |
| | | this.model.precisionParameters = '1' |
| | | } |
| | | this.model = Object.assign({},this.model); |
| | | }, |
| | | initOptions() { |
| | | getAction(this.url.loadOptions).then(res => { |
| | | if (res.success) { |
| | | this.treeData = res.result |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handle2Change(val) { |
| | | if (val === null) { |
| | | setTimeout(() => { |
| | | this.form.setFieldsValue({ useId: "" }); |
| | | }, 100) |
| | | } |
| | | }, |
| | | handle1Change(val) { |
| | | if (val === null) { |
| | | setTimeout(() => { |
| | | this.form.setFieldsValue({ affiliationId: "" }); |
| | | }, 100) |
| | | } |
| | | }, |
| | | |
| | | handle3Change(val) { |
| | | if (val === null) { |
| | | setTimeout(() => { |
| | | this.form.setFieldsValue({ manageId: "" }); |
| | | }, 100) |
| | | } |
| | | }, |
| | | |
| | | uploadOk(imgList) { |
| | | this.model.sysUploadList = imgList |
| | | this.equipmentPhoto = this.getSrc(imgList[0]) |
| | | // this.$set(this.model, 'photo', res); |
| | | // this.$set(this.model, 'sysUploadList', imgList); |
| | | }, |
| | | |
| | | onSearchProcessParametersTemplate() { |
| | | this.$refs.ProcessParametersTemplateList.list(); |
| | | this.$refs.ProcessParametersTemplateList.title = "鿩工èºåæ°æ¨¡æ¿"; |
| | | }, |
| | | sendProcessParametersTemplateRecord(data) { |
| | | let record = data.record; |
| | | this.model.processParametersTemplateId = record.id |
| | | this.model.processParametersTemplateName = record.name |
| | | this.model = Object.assign({},this.model); |
| | | }, |
| | | |
| | | onSearchPrecisionParametersTemplate() { |
| | | this.$refs.PrecisionParametersTemplateList.list(); |
| | | this.$refs.PrecisionParametersTemplateList.title = "éæ©è®¾å¤ç²¾åº¦æ¨¡æ¿"; |
| | | }, |
| | | sendPrecisionParametersTemplateRecord(data) { |
| | | let record = data.record; |
| | | this.model.precisionParametersTemplateId = record.id |
| | | this.model.precisionParametersTemplateName = record.name |
| | | this.model = Object.assign({},this.model); |
| | | }, |
| | | standardResultCompute(){ |
| | | |
| | | var standardA = this.model.standardA==null||this.model.standardA==undefined||this.model.standardA==''?0:parseInt(this.model.standardA); |
| | | var standardB = this.model.standardB==null||this.model.standardB==undefined||this.model.standardB==''?0:parseInt(this.model.standardB); |
| | | var standardC = this.model.standardA==null||this.model.standardC==undefined||this.model.standardC==''?0:parseInt(this.model.standardC); |
| | | var standardD = this.model.standardD==null||this.model.standardD==undefined||this.model.standardD==''?0:parseInt(this.model.standardD); |
| | | var standardE = this.model.standardE==null||this.model.standardE==undefined||this.model.standardE==''?0:parseInt(this.model.standardE); |
| | | var standardF = this.model.standardF==null||this.model.standardF==undefined||this.model.standardF==''?0:parseInt(this.model.standardF); |
| | | |
| | | var sum = standardA+standardB+standardC+standardD+standardE+standardF; |
| | | console.log(sum) |
| | | if(sum>=18){ |
| | | this.model.equipmentImportanceId='A' |
| | | }else if(sum>=10&&sum<=17){ |
| | | this.model.equipmentImportanceId='B' |
| | | }else{ |
| | | this.model.equipmentImportanceId='C' |
| | | } |
| | | this.model = Object.assign({},this.model); |
| | | |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disableSubmit |
| | | }, |
| | | }, |
| | | watch: { |
| | | alterFlag() { |
| | | this.$bus.$emit('queryTreeData'); |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="equipmentId" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> |
| | | <a-input v-model="model.equipmentId" placeholder="请è¾å
¥equipmentId" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="precisionParametersId" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="precisionParametersId"> |
| | | <a-input v-model="model.precisionParametersId" placeholder="请è¾å
¥precisionParametersId" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="leaveFactoryValue" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaveFactoryValue"> |
| | | <a-input v-model="model.leaveFactoryValue" placeholder="请è¾å
¥leaveFactoryValue" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="actualValue" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualValue"> |
| | | <a-input v-model="model.actualValue" placeholder="请è¾å
¥actualValue" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="verificationDate" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verificationDate"> |
| | | <a-input v-model="model.verificationDate" placeholder="请è¾å
¥verificationDate" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda1"> |
| | | <a-input v-model="model.eppUda1" placeholder="请è¾å
¥eppUda1" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda2" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda2"> |
| | | <a-input v-model="model.eppUda2" placeholder="请è¾å
¥eppUda2" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda3" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda3"> |
| | | <a-input v-model="model.eppUda3" placeholder="请è¾å
¥eppUda3" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda4" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda4"> |
| | | <a-input v-model="model.eppUda4" placeholder="请è¾å
¥eppUda4" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda5" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda5"> |
| | | <a-input v-model="model.eppUda5" placeholder="请è¾å
¥eppUda5" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="remark" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-input v-model="model.remark" placeholder="请è¾å
¥remark" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="status" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> |
| | | <a-input v-model="model.status" placeholder="请è¾å
¥status" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="tenantId" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenantId"> |
| | | <a-input v-model="model.tenantId" placeholder="请è¾å
¥tenantId" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="delFlag" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> |
| | | <a-input-number v-model="model.delFlag" placeholder="请è¾å
¥delFlag" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="initialMeasuredValue" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialMeasuredValue"> |
| | | <a-input-number v-model="model.initialMeasuredValue" placeholder="请è¾å
¥initialMeasuredValue" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="allowableRange" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="allowableRange"> |
| | | <a-input-number v-model="model.allowableRange" placeholder="请è¾å
¥allowableRange" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="upperLimit" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperLimit"> |
| | | <a-input-number v-model="model.upperLimit" placeholder="请è¾å
¥upperLimit" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="lowerLimit" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lowerLimit"> |
| | | <a-input-number v-model="model.lowerLimit" placeholder="请è¾å
¥lowerLimit" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: "EquipmentPrecisionParametersModal", |
| | | components: { |
| | | }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | required:false, |
| | | default:'' |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/new/equipment/addEquipmentPrecisionParameters", |
| | | edit: "/new/equipment/editEquipmentPrecisionParameters", |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | 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'; |
| | | } |
| | | this.model['equipmentId'] = this.mainId |
| | | 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 |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="equipmentId" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> |
| | | <a-input v-model="model.equipmentId" placeholder="请è¾å
¥equipmentId" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="processParametersId" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processParametersId"> |
| | | <a-input v-model="model.processParametersId" placeholder="请è¾å
¥processParametersId" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="parametersValue" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parametersValue"> |
| | | <a-input v-model="model.parametersValue" placeholder="请è¾å
¥parametersValue" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda1"> |
| | | <a-input v-model="model.eppUda1" placeholder="请è¾å
¥eppUda1" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda2" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda2"> |
| | | <a-input v-model="model.eppUda2" placeholder="请è¾å
¥eppUda2" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda3" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda3"> |
| | | <a-input v-model="model.eppUda3" placeholder="请è¾å
¥eppUda3" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda4" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda4"> |
| | | <a-input v-model="model.eppUda4" placeholder="请è¾å
¥eppUda4" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="eppUda5" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eppUda5"> |
| | | <a-input v-model="model.eppUda5" placeholder="请è¾å
¥eppUda5" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="remark" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-input v-model="model.remark" placeholder="请è¾å
¥remark" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="status" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> |
| | | <a-input v-model="model.status" placeholder="请è¾å
¥status" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="tenantId" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenantId"> |
| | | <a-input v-model="model.tenantId" placeholder="请è¾å
¥tenantId" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="delFlag" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> |
| | | <a-input-number v-model="model.delFlag" placeholder="请è¾å
¥delFlag" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: "EquipmentProcessParametersModal", |
| | | components: { |
| | | }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | required:false, |
| | | default:'' |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/new/equipment/addEquipmentProcessParameters", |
| | | edit: "/new/equipment/editEquipmentProcessParameters", |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | 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'; |
| | | } |
| | | this.model['equipmentId'] = this.mainId |
| | | 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 |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" v-if="mainId"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('è®¾å¤ææ¡£')">导åº</a-button> |
| | | <a-upload |
| | | name="file" |
| | | :showUploadList="false" |
| | | :multiple="false" |
| | | :headers="tokenHeader" |
| | | :action="importExcelUrl" |
| | | @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> --> |
| | | <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" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | <span |
| | | slot="size" |
| | | slot-scope="text" |
| | | class="error" |
| | | > |
| | | {{sizeConvert(text)}} |
| | | </span> |
| | | |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | |
| | | <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> |
| | | <equipmentDocument-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></equipmentDocument-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EquipmentDocumentModal from '../modules/equipmentNew/EquipmentDocumentModal' |
| | | import { preview } from 'vue-photo-preview' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import Vue from 'vue' |
| | | import PdfView from '@views/common/PdfView' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import JEllipsis from "@/components/jeecg/JEllipsis"; |
| | | import { getFileAccessHttpUrl } from '@/api/manage'; |
| | | import '@/assets/less/TableExpand.less' |
| | | import store from '@/store/' |
| | | import { downFile, getAction } from '../../../api/manage' |
| | | export default { |
| | | name: "EquipmentDocumentList", |
| | | mixins:[JeecgListMixin,mixinDevice], |
| | | components: { |
| | | EquipmentDocumentModal, |
| | | PdfView, |
| | | preview, |
| | | JInput, |
| | | Tooltip, |
| | | JEllipsis, |
| | | }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | } |
| | | }, |
| | | watch:{ |
| | | mainId:{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['equipmentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | description: '设å¤å°è´¦ç®¡ç页é¢', |
| | | disableMixinCreated:true, |
| | | colorMap: {}, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'ææ¡£ç¼å·', |
| | | dataIndex: 'num', |
| | | align: "center", |
| | | width:300, |
| | | }, |
| | | { |
| | | title: 'ææ¡£åç§°', |
| | | align: 'center', |
| | | dataIndex: 'name', |
| | | width:300, |
| | | }, |
| | | { |
| | | title: 'ææ¡£ç±»å', |
| | | align: 'center', |
| | | dataIndex: 'type_dictText', |
| | | width:300, |
| | | }, |
| | | { |
| | | title: 'ä¸ä¼ æ¶é´', |
| | | align: "center", |
| | | dataIndex: 'createTime', |
| | | width:300, |
| | | }, |
| | | { |
| | | title: 'ä¸ä¼ è
', |
| | | align: "center", |
| | | dataIndex: 'createBy', |
| | | width:300, |
| | | }, |
| | | { |
| | | title: '大å°', |
| | | align: "center", |
| | | dataIndex: 'size', |
| | | scopedSlots: { |
| | | customRender: 'size' |
| | | }, |
| | | width:300, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: "center", |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action' |
| | | }, |
| | | width: 200, |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/equipmentDocument/list", |
| | | delete: "/eam/equipmentDocument/delete", |
| | | deleteBatch: '/eam/equipmentDocument/deleteBatch', |
| | | urlDownload: window._CONFIG['staticDomainURL'], |
| | | download: '/sys/upload/downloadFile', |
| | | }, |
| | | dictOptions:{ |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | importExcelUrl(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | clearList(){ |
| | | this.dataSource=[] |
| | | this.selectedRowKeys=[] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | 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; |
| | | }, |
| | | 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) |
| | | } |
| | | }, |
| | | view(record) { |
| | | this.$refs.pdfview.showPdf(record.upload.src); |
| | | }, |
| | | |
| | | handleDownload(record) { |
| | | downFile(this.url.download, { id: record.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对象 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | if (this.equipmentId == '') { |
| | | params.equipmentId = '-1'; |
| | | } |
| | | 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 |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | /deep/ .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .success { |
| | | color: green; |
| | | } |
| | | .error { |
| | | color: red; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | .ant-card { |
| | | margin-left: -30px; |
| | | margin-right: -30px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 :span="6"> |
| | | <a-form-item label="è®¾å¤æå±åç±»"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©è®¾å¤æå±åç±»" |
| | | :triggerChange="true" |
| | | dictCode="mom_eam_equipment_category,name,id" |
| | | v-model="queryParam.equipmentCategoryId" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :span="6" |
| | | > |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <a-input |
| | | placeholder="请è¾å
¥è®¾å¤ç¼å·æ¥è¯¢" |
| | | v-model="queryParam.num" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :span="6" |
| | | > |
| | | <a-form-item label="设å¤åç§°"> |
| | | <a-input |
| | | placeholder="请è¾å
¥è®¾å¤åç§°æ¥è¯¢" |
| | | v-model="queryParam.name" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | @click="searchReset" |
| | | icon="reload" |
| | | >éç½®</a-button> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('设å¤å°è´¦')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | </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" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
| | | :customRow="clickThenSelect" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <!--å·¥èºåæ°ä¸ªæ§å±ç¤º--> |
| | | <span |
| | | slot="processParameters" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.processParameters==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.processParameters==1" |
| | | class="success" |
| | | >æ¯</span> |
| | | <a-badge |
| | | v-if="record.processParameters==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.processParameters==0" |
| | | class="error" |
| | | >å¦</span> |
| | | </span> |
| | | <span |
| | | slot="processParameters" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.processParameters==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.processParameters==1" |
| | | class="success" |
| | | >æ¯</span> |
| | | <a-badge |
| | | v-if="record.processParameters==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.processParameters==0" |
| | | class="error" |
| | | >å¦</span> |
| | | </span> |
| | | <span |
| | | slot="precisionParameters" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.precisionParameters==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.precisionParameters==1" |
| | | class="success" |
| | | >æ¯</span> |
| | | <a-badge |
| | | v-if="record.precisionParameters==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.precisionParameters==0" |
| | | class="error" |
| | | >å¦</span> |
| | | </span> |
| | | <span |
| | | slot="verification" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.verification==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.verification==1" |
| | | class="success" |
| | | >æ¯</span> |
| | | <a-badge |
| | | v-if="record.verification==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.verification==0" |
| | | class="error" |
| | | >å¦</span> |
| | | </span> |
| | | |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <!-- class="table-operation" --> |
| | | <!-- <a |
| | | href="javascript:;" |
| | | @click="equipmentStructuresShow(record)" |
| | | >设å¤ç»æ</a> |
| | | <a-divider type="vertical" /> --> |
| | | <a |
| | | href="javascript:;" |
| | | @click='handleDetail(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 @click="equipmentResumeShow(record)">设å¤å±¥å</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | <equipment-resume-drawer |
| | | ref="EquipmentResumeDrawer" |
| | | @ok="modalFormOk" |
| | | ></equipment-resume-drawer> |
| | | |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="å·¥èºåæ°" key="1" > |
| | | <EquipmentProcessParametersList :mainId="equipmentProcessParametersMainId" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="设å¤ç²¾åº¦" key="2" forceRender> |
| | | <EquipmentPrecisionParametersList :mainId="equipmentPrecisionParametersMainId" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="è®¾å¤ææ¡£" key="3" forceRender> |
| | | <EquipmentDocumentList :mainId="equipmentDocumentMainId" /> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <equipment-modal ref="modalForm" @ok="modalFormOk"></equipment-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import EquipmentModal from '../modules/equipmentNew/EquipmentModal' |
| | | import { getAction } from '@/api/manage' |
| | | import EquipmentProcessParametersList from './EquipmentProcessParametersList' |
| | | import EquipmentDocumentList from './EquipmentDocumentList' |
| | | import EquipmentPrecisionParametersList from './EquipmentPrecisionParametersList' |
| | | import '@/assets/less/TableExpand.less' |
| | | import EquipmentResumeDrawer from '../modules/equipment/EquipmentResume/EquipmentResumeDrawer' |
| | | |
| | | |
| | | export default { |
| | | name: "EquipmentList", |
| | | mixins:[JeecgListMixin,mixinDevice], |
| | | components: { |
| | | EquipmentProcessParametersList, |
| | | EquipmentDocumentList, |
| | | EquipmentPrecisionParametersList, |
| | | EquipmentModal, |
| | | EquipmentResumeDrawer |
| | | }, |
| | | data () { |
| | | return { |
| | | description: '设å¤å°è´¦ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | width: 50, |
| | | }, |
| | | { |
| | | title: '设å¤ç±»å', |
| | | align: "center", |
| | | dataIndex: 'equipmentCategoryId_dictText', |
| | | }, |
| | | { |
| | | title: 'ç»ä¸ç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'num', |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | align: "center", |
| | | dataIndex: 'name', |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | align: "center", |
| | | dataIndex: 'model', |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | align: "center", |
| | | dataIndex: 'specification', |
| | | }, |
| | | { |
| | | title: 'æ»åç', |
| | | align: "center", |
| | | dataIndex: 'gpo', |
| | | }, |
| | | { |
| | | title: '使ç¨é¨é¨', |
| | | align: "center", |
| | | dataIndex: 'useId_dictText', |
| | | }, |
| | | { |
| | | title: 'ç»´æ¤é¨é¨', |
| | | align: "center", |
| | | dataIndex: 'manageId_dictText', |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®çç»', |
| | | align: "center", |
| | | dataIndex: 'teamId_dictText', |
| | | }, |
| | | { |
| | | title: 'ABCæ è¯', |
| | | align: "center", |
| | | dataIndex: 'equipmentImportanceId_dictText', |
| | | }, |
| | | { |
| | | title: 'å
³é®è®¾å¤æ è¯', |
| | | align: "center", |
| | | dataIndex: 'specificEquipment_dictText', |
| | | }, |
| | | // { |
| | | // title: 'å·¥åº', |
| | | // align: "center", |
| | | // dataIndex: 'equipmentUda1', |
| | | // }, |
| | | // { |
| | | // title: 'å®å
¨é
ç½®', |
| | | // align: "center", |
| | | // dataIndex: 'securityConfiguration', |
| | | // }, |
| | | // { |
| | | // title: 'å·å´ç³»ç»', |
| | | // align: "center", |
| | | // dataIndex: 'coolingSystem', |
| | | // }, |
| | | // { |
| | | // title: 'çç«å¨', |
| | | // align: "center", |
| | | // dataIndex: 'fireExtinguisher', |
| | | // }, |
| | | |
| | | // { |
| | | // title: 'çç«å¨æææ', |
| | | // align: "center", |
| | | // dataIndex: 'fireExtinguisherValidityPeriod', |
| | | // }, |
| | | // { |
| | | // title: 'æä½ç³»ç»', |
| | | // align: "center", |
| | | // dataIndex: 'operatingSystem', |
| | | // }, |
| | | // { |
| | | // title: 'ç³»ç»', |
| | | // align: "center", |
| | | // dataIndex: 'system', |
| | | // }, |
| | | // { |
| | | // title: '设å¤ç«¯å£', |
| | | // align: "center", |
| | | // dataIndex: 'port', |
| | | // }, |
| | | // { |
| | | // title: 'åæ æ°é', |
| | | // align: "center", |
| | | // dataIndex: 'coordinateNum', |
| | | // }, |
| | | // { |
| | | // title: '设å¤ç¶æ', |
| | | // align: "center", |
| | | // dataIndex: 'equipmentStatus_dictText', |
| | | // }, |
| | | // { |
| | | // title: 'éé', |
| | | // align: "center", |
| | | // dataIndex: 'equipmentUda3', |
| | | // }, |
| | | // { |
| | | // title: 'éé计éåä½', |
| | | // align: "center", |
| | | // dataIndex: 'equipmentUda4_dictText', |
| | | // }, |
| | | // { |
| | | // title: 'åè½ä½ç½®', |
| | | // align: "center", |
| | | // dataIndex: 'equipmentUda5', |
| | | // }, |
| | | // { |
| | | // title: 'å®è£
ä½ç½®', |
| | | // align: "center", |
| | | // dataIndex: 'equipmentUda2', |
| | | // }, |
| | | // { |
| | | // title: 'åºåæ¥æ', |
| | | // align: "center", |
| | | // dataIndex: 'leaveFactoryDate', |
| | | // }, |
| | | // { |
| | | // title: 'ç«é¡¹å¡å·', |
| | | // align: "center", |
| | | // dataIndex: 'projectApprovalNo', |
| | | // }, |
| | | // { |
| | | // title: 'èµéæ¥æº', |
| | | // align: "center", |
| | | // dataIndex: 'fundSource', |
| | | // }, |
| | | // { |
| | | // title: 'éªæ¶æ¥æ', |
| | | // align: "center", |
| | | // dataIndex: 'acceptanceCheckDate', |
| | | // }, |
| | | // { |
| | | // title: 'åºåç¼å·', |
| | | // align: "center", |
| | | // dataIndex: 'factoryNo', |
| | | // }, |
| | | // { |
| | | // title: 'èµäº§å¶é å', |
| | | // align: "center", |
| | | // dataIndex: 'constructorId_dictText', |
| | | // }, |
| | | // { |
| | | // title: 'èµäº§çæ¥æºå½å®¶', |
| | | // align: "center", |
| | | // dataIndex: 'sourceCountry', |
| | | // }, |
| | | { |
| | | title: 'å·¥èºåæ°ç®¡ç', |
| | | align: "center", |
| | | dataIndex: 'processParameters', |
| | | scopedSlots: { customRender: 'processParameters' }, |
| | | }, |
| | | { |
| | | title: 'å·¥èºåæ°æ¨¡æ¿', |
| | | align: "center", |
| | | dataIndex: 'processParametersTemplateName', |
| | | }, |
| | | { |
| | | title: '设å¤ç²¾åº¦ç®¡ç', |
| | | align: "center", |
| | | dataIndex: 'precisionParameters', |
| | | scopedSlots: { customRender: 'precisionParameters' }, |
| | | }, |
| | | { |
| | | title: 'ç²¾åº¦åæ°æ¨¡æ¿', |
| | | align: "center", |
| | | dataIndex: 'precisionParametersTemplateName', |
| | | }, |
| | | // { |
| | | // title: '夿³¨', |
| | | // align: "center", |
| | | // dataIndex: 'remark', |
| | | // }, |
| | | { |
| | | title: 'æä½', |
| | | align: "center", |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action', |
| | | }, |
| | | width: 200, |
| | | fixed: 'right', |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/equipment/list", |
| | | delete: "/eam/equipment/delete", |
| | | deleteBatch: "/eam/equipment/deleteBatch", |
| | | active: "/eam/equipment/active", |
| | | exportXlsUrl: '/eam/equipment/exportXls', |
| | | importExcelUrl: "/eam/equipment/importExcel", |
| | | }, |
| | | dictOptions:{ |
| | | }, |
| | | /* å页忰 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '50'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | selectedMainId:'', |
| | | superFieldList:[], |
| | | equipmentProcessParametersMainId: '', |
| | | equipmentDocumentMainId: '', |
| | | equipmentPrecisionParametersMainId: '', |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | equipmentResumeShow(record) { |
| | | this.$refs.EquipmentResumeDrawer.visible = true |
| | | this.$refs.EquipmentResumeDrawer.title = '设å¤å±¥å' |
| | | this.$refs.EquipmentResumeDrawer.handleShow(record) |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = []; |
| | | this.selectionRows = []; |
| | | this.selectedMainId='' |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedMainId=selectedRowKeys[0] |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | this.equipmentProcessParametersMainId = selectionRows[0]['id'] |
| | | this.equipmentDocumentMainId = selectionRows[0]['id'] |
| | | this.equipmentPrecisionParametersMainId = selectionRows[0]['id'] |
| | | }, |
| | | loadData(arg) { |
| | | if(!this.url.list){ |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | this.onClearSelected() |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records; |
| | | this.ipagination.total = res.result.total; |
| | | } |
| | | if(res.code===510){ |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'num',text:'ç»ä¸ç¼ç ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'name',text:'设å¤åç§°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'model',text:'åå·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'specification',text:'è§æ ¼',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentStatus',text:'设å¤ç¶æ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'technologyStatus',text:'technologyStatus',dictCode:''}) |
| | | fieldList.push({type:'string',value:'assetNumber',text:'assetNumber',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentCategoryId',text:'equipmentCategoryId',dictCode:''}) |
| | | fieldList.push({type:'string',value:'specificEquipment',text:'specificEquipment',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentPhoto',text:'equipmentPhoto',dictCode:''}) |
| | | fieldList.push({type:'string',value:'constructorId',text:'èµäº§å¶é å',dictCode:''}) |
| | | fieldList.push({type:'string',value:'supplierId',text:'supplierId',dictCode:''}) |
| | | fieldList.push({type:'string',value:'factoryNumber',text:'factoryNumber',dictCode:''}) |
| | | fieldList.push({type:'string',value:'leaveFactoryDate',text:'åºåæ¥æ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'acceptanceCheckDate',text:'éªæ¶æ¥æ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'affiliationId',text:'affiliationId',dictCode:''}) |
| | | fieldList.push({type:'string',value:'manageId',text:'ç»´æ¤é¨é¨ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'manager',text:'manager',dictCode:''}) |
| | | fieldList.push({type:'string',value:'useId',text:'使ç¨é¨é¨ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'functionary',text:'functionary',dictCode:''}) |
| | | fieldList.push({type:'string',value:'location',text:'location',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentImportanceId',text:'ABCæ è¯ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'processParameters',text:'processParameters',dictCode:''}) |
| | | fieldList.push({type:'string',value:'processParametersTemplateId',text:'processParametersTemplateId',dictCode:''}) |
| | | fieldList.push({type:'string',value:'precisionParameters',text:'precisionParameters',dictCode:''}) |
| | | fieldList.push({type:'string',value:'precisionParametersTemplateId',text:'precisionParametersTemplateId',dictCode:''}) |
| | | fieldList.push({type:'string',value:'verification',text:'verification',dictCode:''}) |
| | | fieldList.push({type:'string',value:'verificationPeriod',text:'verificationPeriod',dictCode:''}) |
| | | fieldList.push({type:'string',value:'lastVerificationDate',text:'lastVerificationDate',dictCode:''}) |
| | | fieldList.push({type:'string',value:'nextVerificationDate',text:'nextVerificationDate',dictCode:''}) |
| | | fieldList.push({type:'string',value:'status',text:'status',dictCode:''}) |
| | | fieldList.push({type:'string',value:'remark',text:'remark',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentUda1',text:'å·¥åº',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentUda2',text:'å®è£
ä½ç½®',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentUda3',text:'éé',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentUda4',text:'éé计éåä½ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentUda5',text:'åè½ä½ç½®',dictCode:''}) |
| | | fieldList.push({type:'string',value:'tenantId',text:'tenantId',dictCode:''}) |
| | | fieldList.push({type:'int',value:'delFlag',text:'delFlag',dictCode:''}) |
| | | fieldList.push({type:'string',value:'teamId',text:'ç»´ä¿®çç»ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'sourceId',text:'sourceId',dictCode:''}) |
| | | fieldList.push({type:'string',value:'fundSource',text:'èµéæ¥æº',dictCode:''}) |
| | | fieldList.push({type:'string',value:'factoryNo',text:'åºåç¼å·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'mfr',text:'å¶é å',dictCode:''}) |
| | | fieldList.push({type:'string',value:'sourceCountry',text:'èµäº§æ¥æºå½å®¶',dictCode:''}) |
| | | fieldList.push({type:'string',value:'gpo',text:'æ»åç',dictCode:''}) |
| | | fieldList.push({type:'string',value:'keyEquipmentIdentification',text:'å
³é®è®¾å¤æ è¯',dictCode:''}) |
| | | fieldList.push({type:'string',value:'securityConfiguration',text:'å®å
¨é
ç½®',dictCode:''}) |
| | | fieldList.push({type:'string',value:'coolingSystem',text:'å·å´ç³»ç»',dictCode:''}) |
| | | fieldList.push({type:'string',value:'fireExtinguisher',text:'çç«å¨',dictCode:''}) |
| | | fieldList.push({type:'string',value:'fireExtinguisherValidityPeriod',text:'çç«å¨æææ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'operatingSystem',text:'æä½ç³»ç»',dictCode:''}) |
| | | fieldList.push({type:'string',value:'system',text:'ç³»ç»',dictCode:''}) |
| | | fieldList.push({type:'string',value:'port',text:'端å£',dictCode:''}) |
| | | fieldList.push({type:'BigDecimal',value:'coordinateNum',text:'åæ æ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'projectApprovalNo',text:'ç«é¡¹å¡å·',dictCode:''}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" v-if="mainId"> |
| | | <!-- <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> --> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('设å¤ç²¾åº¦')">导åº</a-button> |
| | | <a-upload |
| | | name="file" |
| | | :showUploadList="false" |
| | | :multiple="false" |
| | | :headers="tokenHeader" |
| | | :action="importExcelUrl" |
| | | @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> --> |
| | | <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" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | <template |
| | | v-for="col in columns" |
| | | :slot="col.dataIndex" |
| | | slot-scope='text, record, index' |
| | | > |
| | | <div :key="col.dataIndex"> |
| | | <span v-if="col.dataIndex == 'remark'"> |
| | | <j-ellipsis |
| | | :value="text" |
| | | :length="10" |
| | | /> |
| | | </span> |
| | | <a-input-number |
| | | :value="text" |
| | | v-if="col.dataIndex == 'upperLimit'" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | style="width: 100%" |
| | | /> |
| | | <a-input-number |
| | | :value="text" |
| | | v-if="col.dataIndex == 'lowerLimit'" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | style="width: 100%" |
| | | /> |
| | | <a-input-number |
| | | :value="text" |
| | | v-if="col.dataIndex == 'actualValue'" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | style="width: 100%" |
| | | /> |
| | | <span v-if="col.dataIndex == 'action'"> |
| | | <a-button |
| | | type="primary" |
| | | @click="handleEdit(record)" |
| | | >æäº¤</a-button> |
| | | </span> |
| | | </div> |
| | | </template> |
| | | |
| | | <!-- <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> |
| | | |
| | | <equipmentPrecisionParameters-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></equipmentPrecisionParameters-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EquipmentPrecisionParametersModal from '../modules/equipmentNew/EquipmentPrecisionParametersModal' |
| | | import { postAction } from '../../../api/manage' |
| | | |
| | | export default { |
| | | name: "EquipmentPrecisionParametersList", |
| | | mixins:[JeecgListMixin], |
| | | components: { EquipmentPrecisionParametersModal }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | } |
| | | }, |
| | | watch:{ |
| | | mainId:{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['equipmentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | description: '设å¤å°è´¦ç®¡ç页é¢', |
| | | disableMixinCreated:true, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | }, |
| | | }, |
| | | { |
| | | title: 'ç²¾åº¦åæ°ç¼ç ', |
| | | dataIndex: 'precisionParametersNum', |
| | | align: "center", |
| | | width:250, |
| | | }, |
| | | { |
| | | title: 'ç²¾åº¦åæ°åç§°', |
| | | dataIndex: 'precisionParametersName', |
| | | align: "center", |
| | | width:250, |
| | | }, |
| | | { |
| | | title: '计éåä½', |
| | | dataIndex: 'precisionParametersUnitName', |
| | | align: "center", |
| | | width:250, |
| | | }, |
| | | { |
| | | title: 'ä¸éå¼', |
| | | dataIndex: 'upperLimit', |
| | | align: "center", |
| | | scopedSlots: { |
| | | customRender: 'upperLimit' |
| | | }, |
| | | width:250, |
| | | }, |
| | | { |
| | | title: 'ä¸éå¼', |
| | | dataIndex: 'lowerLimit', |
| | | align: "center", |
| | | scopedSlots: { |
| | | customRender: 'lowerLimit' |
| | | }, |
| | | width:250, |
| | | }, |
| | | { |
| | | title: 'å®é
精度å¼', |
| | | dataIndex: 'actualValue', |
| | | align: "center", |
| | | scopedSlots: { |
| | | customRender: 'actualValue' |
| | | }, |
| | | width:250, |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | | dataIndex: 'remark', |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | width: 160, |
| | | align: "center", |
| | | scopedSlots: { |
| | | customRender: 'action' |
| | | }, |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/equipmentPrecisionParameters/list", |
| | | edit: "/eam/equipmentPrecisionParameters/edit", |
| | | // delete: "/new/equipment/deleteEquipmentPrecisionParameters", |
| | | // deleteBatch: "/new/equipment/deleteBatchEquipmentPrecisionParameters", |
| | | // exportXlsUrl: "/new/equipment/exportEquipmentPrecisionParameters", |
| | | // importUrl: "/new/equipment/importEquipmentPrecisionParameters", |
| | | }, |
| | | dictOptions:{ |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | importExcelUrl(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | clearList(){ |
| | | this.dataSource=[] |
| | | this.selectedRowKeys=[] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | | let that = this; |
| | | const temp = [...that.dataSource]; |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | target[column.dataIndex] = value; |
| | | if ('actualValue' == column.dataIndex) { |
| | | target['actualValue'] = value; |
| | | } |
| | | if ('upperLimit' == column.dataIndex) { |
| | | target['upperLimit'] = value; |
| | | } |
| | | if ('lowerLimit' == column.dataIndex) { |
| | | target['lowerLimit'] = value; |
| | | } |
| | | //æ¾ç¤ºå¸¦è¿æ¥çæ°æ® |
| | | that.dataSource = temp; |
| | | } |
| | | }, |
| | | handleEdit(record) { |
| | | this.loading = true; |
| | | if (record.actualValue === "" || record.actualValue === null) { |
| | | this.$message.warning("åèå¼ä¸è½ä¸ºç©ºï¼") |
| | | this.loading = false; |
| | | return |
| | | } |
| | | postAction(this.url.edit, record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message); |
| | | this.loadData() |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | |
| | | modalFormOk() { |
| | | this.loadData(1); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" v-if="mainId"> |
| | | <!-- <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> --> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('å·¥èºåæ°')">导åº</a-button> |
| | | <a-upload |
| | | name="file" |
| | | :showUploadList="false" |
| | | :multiple="false" |
| | | :headers="tokenHeader" |
| | | :action="importExcelUrl" |
| | | @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> --> |
| | | <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" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | <template |
| | | v-for="col in columns" |
| | | :slot="col.dataIndex" |
| | | slot-scope='text, record, index' |
| | | > |
| | | <div :key="col.dataIndex"> |
| | | <span v-if="col.dataIndex == 'remark'"> |
| | | <j-ellipsis |
| | | :value="text" |
| | | :length="10" |
| | | /> |
| | | </span> |
| | | <a-input-number |
| | | :value="text" |
| | | v-if="col.dataIndex == 'parametersValue'" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | style="width: 100%" |
| | | /> |
| | | <span v-if="col.dataIndex == 'action'"> |
| | | <a-button |
| | | type="primary" |
| | | @click="handleEdit(record)" |
| | | >æäº¤</a-button> |
| | | </span> |
| | | </div> |
| | | </template> |
| | | <!-- <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> |
| | | <equipmentProcessParameters-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></equipmentProcessParameters-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EquipmentProcessParametersModal from '../modules/equipmentNew/EquipmentProcessParametersModal' |
| | | import { postAction } from '../../../api/manage' |
| | | |
| | | export default { |
| | | name: "EquipmentProcessParametersList", |
| | | mixins:[JeecgListMixin], |
| | | components: { EquipmentProcessParametersModal }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | } |
| | | }, |
| | | watch:{ |
| | | mainId:{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['equipmentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | description: '设å¤å°è´¦ç®¡ç页é¢', |
| | | disableMixinCreated:true, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'å·¥èºåæ°ç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'processParametersNum', |
| | | width:350, |
| | | }, |
| | | { |
| | | title: 'å·¥èºåæ°åç§°', |
| | | align: "center", |
| | | dataIndex: 'processParametersName', |
| | | width:350, |
| | | }, |
| | | { |
| | | title: '计éåä½', |
| | | align: "center", |
| | | dataIndex: 'processParametersUnitName', |
| | | width:350, |
| | | }, |
| | | { |
| | | title: 'åæ°å¼', |
| | | align: "center", |
| | | dataIndex: 'parametersValue', |
| | | scopedSlots: { |
| | | customRender: 'parametersValue' |
| | | }, |
| | | width:350, |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | | align: "center", |
| | | dataIndex: 'remark', |
| | | scopedSlots: { |
| | | customRender: 'remark' |
| | | }, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: "center", |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action' |
| | | }, |
| | | width:200 |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/equipmentProcessParameters/list", |
| | | edit: "/eam/equipmentProcessParameters/edit", |
| | | // delete: "/new/equipment/deleteEquipmentProcessParameters", |
| | | // deleteBatch: "/new/equipment/deleteBatchEquipmentProcessParameters", |
| | | // exportXlsUrl: "/new/equipment/exportEquipmentProcessParameters", |
| | | // importUrl: "/new/equipment/importEquipmentProcessParameters", |
| | | }, |
| | | dictOptions:{ |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | importExcelUrl(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | clearList(){ |
| | | this.dataSource=[] |
| | | this.selectedRowKeys=[] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | handleEdit(record) { |
| | | this.loading = true; |
| | | if (record.parametersValue === "" || record.parametersValue === null) { |
| | | this.$message.warning("åèå¼ä¸è½ä¸ºç©ºï¼") |
| | | this.loading = false; |
| | | return |
| | | } |
| | | postAction(this.url.edit, record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message); |
| | | this.loadData() |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | | let that = this; |
| | | const temp = [...that.dataSource]; |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | target[column.dataIndex] = value; |
| | | if ('parametersValue' == column.dataIndex) { |
| | | target['parametersValue'] = value; |
| | | } |
| | | //æ¾ç¤ºå¸¦è¿æ¥çæ°æ® |
| | | that.dataSource = temp; |
| | | } |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |