From 02d86ec24676f6d682277eb8e493e755d677c179 Mon Sep 17 00:00:00 2001 From: “linengliang” <vanSuperEnergy@163.com> Date: 星期五, 25 八月 2023 18:14:37 +0800 Subject: [PATCH] 设备台账2.0 --- src/views/eam/newEquipment/EquipmentList.vue | 640 +++++++++++++ src/views/eam/newEquipment/EquipmentDocumentList.vue | 395 ++++++++ src/views/eam/modules/equipmentNew/EquipmentModal.vue | 693 ++++++++++++++ src/views/eam/newEquipment/EquipmentPrecisionParametersList.vue | 285 +++++ src/views/eam/modules/equipmentNew/EquipmentPrecisionParametersModal.vue | 208 ++++ src/views/eam/modules/equipmentNew/EquipmentDocumentModal.vue | 264 +++++ src/views/eam/newEquipment/EquipmentProcessParametersList.vue | 243 ++++ src/views/eam/modules/equipmentNew/EquipmentProcessParametersModal.vue | 178 +++ 8 files changed, 2,906 insertions(+), 0 deletions(-) diff --git a/src/views/eam/modules/equipmentNew/EquipmentDocumentModal.vue b/src/views/eam/modules/equipmentNew/EquipmentDocumentModal.vue new file mode 100644 index 0000000..45a09a2 --- /dev/null +++ b/src/views/eam/modules/equipmentNew/EquipmentDocumentModal.vue @@ -0,0 +1,264 @@ +<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="璇疯緭鍏ユ枃妗g紪鍙�" + 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: '璇疯緭鍏ユ枃妗g紪鍙凤紒' }, + ], + 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> diff --git a/src/views/eam/modules/equipmentNew/EquipmentModal.vue b/src/views/eam/modules/equipmentNew/EquipmentModal.vue new file mode 100644 index 0000000..a174197 --- /dev/null +++ b/src/views/eam/modules/equipmentNew/EquipmentModal.vue @@ -0,0 +1,693 @@ +<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="璇烽�夋嫨璐d换鐝粍" + :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="璇疯緭鍏ラ噸閲忚閲忓崟浣岻D" ></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: '璇烽�夋嫨璐d换鐝粍!' }, + ], + 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> \ No newline at end of file diff --git a/src/views/eam/modules/equipmentNew/EquipmentPrecisionParametersModal.vue b/src/views/eam/modules/equipmentNew/EquipmentPrecisionParametersModal.vue new file mode 100644 index 0000000..41c8f2c --- /dev/null +++ b/src/views/eam/modules/equipmentNew/EquipmentPrecisionParametersModal.vue @@ -0,0 +1,208 @@ +<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="璇疯緭鍏quipmentId" ></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="璇疯緭鍏recisionParametersId" ></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="璇疯緭鍏eaveFactoryValue" ></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="璇疯緭鍏ctualValue" ></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="璇疯緭鍏erificationDate" ></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="璇疯緭鍏ppUda1" ></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="璇疯緭鍏ppUda2" ></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="璇疯緭鍏ppUda3" ></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="璇疯緭鍏ppUda4" ></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="璇疯緭鍏ppUda5" ></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="璇疯緭鍏emark" ></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="璇疯緭鍏tatus" ></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="璇疯緭鍏enantId" ></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="璇疯緭鍏elFlag" 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="璇疯緭鍏nitialMeasuredValue" 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="璇疯緭鍏llowableRange" 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="璇疯緭鍏pperLimit" 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="璇疯緭鍏owerLimit" 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> diff --git a/src/views/eam/modules/equipmentNew/EquipmentProcessParametersModal.vue b/src/views/eam/modules/equipmentNew/EquipmentProcessParametersModal.vue new file mode 100644 index 0000000..5a80845 --- /dev/null +++ b/src/views/eam/modules/equipmentNew/EquipmentProcessParametersModal.vue @@ -0,0 +1,178 @@ +<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="璇疯緭鍏quipmentId" ></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="璇疯緭鍏rocessParametersId" ></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="璇疯緭鍏arametersValue" ></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="璇疯緭鍏ppUda1" ></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="璇疯緭鍏ppUda2" ></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="璇疯緭鍏ppUda3" ></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="璇疯緭鍏ppUda4" ></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="璇疯緭鍏ppUda5" ></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="璇疯緭鍏emark" ></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="璇疯緭鍏tatus" ></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="璇疯緭鍏enantId" ></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="璇疯緭鍏elFlag" 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> diff --git a/src/views/eam/newEquipment/EquipmentDocumentList.vue b/src/views/eam/newEquipment/EquipmentDocumentList.vue new file mode 100644 index 0000000..4a30fcf --- /dev/null +++ b/src/views/eam/newEquipment/EquipmentDocumentList.vue @@ -0,0 +1,395 @@ +<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锛屽垯杞寲鎴怋 + } else if (limit < 0.1 * 1024 * 1024) { + size = (parseFloat(limit) / 1024).toFixed(2) + "KB";//灏忎簬0.1MB锛屽垯杞寲鎴怟B + } else if (limit < 0.1 * 1024 * 1024 * 1024) { + size = (parseFloat(limit) / (1024 * 1024)).toFixed(2) + "MB";//灏忎簬0.1GB锛屽垯杞寲鎴怣B + } else { + size = (parseFloat(limit) / (1024 * 1024 * 1024)).toFixed(2) + "GB";//鍏朵粬杞寲鎴怗B + } + 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 ''; + } + //鏈湴锛歭ocal\Minio锛歮inio\闃块噷浜戯細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 { + //鏍规嵁鍙戝竷鐘舵�佷慨鏀筯ttps 鎴� 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鎷ユ湁鎵�鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰昍AM鎺у埗鍙板垱寤篟AM璐﹀彿銆� + accessKeyId: window._CONFIG['accessKeyId'], + accessKeySecret: window._CONFIG['accessKeySecret'], + bucket: window._CONFIG['bucket'], + }) + // object-key琛ㄧず浠嶰SS涓嬭浇鏂囦欢鏃堕渶瑕佹寚瀹氬寘鍚枃浠跺悗缂�鍦ㄥ唴鐨勫畬鏁磋矾寰勶紝渚嬪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) //閲婃斁鎺塨lob瀵硅薄 + } + } + }) + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.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> diff --git a/src/views/eam/newEquipment/EquipmentList.vue b/src/views/eam/newEquipment/EquipmentList.vue new file mode 100644 index 0000000..7da1592 --- /dev/null +++ b/src/views/eam/newEquipment/EquipmentList.vue @@ -0,0 +1,640 @@ +<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("璇疯缃畊rl.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> \ No newline at end of file diff --git a/src/views/eam/newEquipment/EquipmentPrecisionParametersList.vue b/src/views/eam/newEquipment/EquipmentPrecisionParametersList.vue new file mode 100644 index 0000000..9fe1860 --- /dev/null +++ b/src/views/eam/newEquipment/EquipmentPrecisionParametersList.vue @@ -0,0 +1,285 @@ +<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> diff --git a/src/views/eam/newEquipment/EquipmentProcessParametersList.vue b/src/views/eam/newEquipment/EquipmentProcessParametersList.vue new file mode 100644 index 0000000..b676148 --- /dev/null +++ b/src/views/eam/newEquipment/EquipmentProcessParametersList.vue @@ -0,0 +1,243 @@ +<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> -- Gitblit v1.9.3