From 0c1e5b7f1bb69dc8514a4350834ec34b9d10d77f Mon Sep 17 00:00:00 2001 From: “linengliang” <vanSuperEnergy@163.com> Date: 星期三, 13 九月 2023 17:33:44 +0800 Subject: [PATCH] 预测性维护工单 1.工单执行 2.子表:触发条件,维护内容,计划用料,危险防控,作业指导书,实际用料,实际工时 --- src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderModel.vue | 368 +++++ src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue | 174 ++ src/views/eam/modules/predictiveWorkOrder/PlanMaterial.vue | 220 +++ src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue | 728 +++++++++ src/views/eam/PredictiveWorkOrderList.vue | 108 src/views/eam/modules/predictiveWorkOrder/select/ActualHourUserSelect.vue | 315 ++++ src/views/eam/modules/predictiveWorkOrder/WorkInstruction.vue | 373 +++++ src/views/eam/modules/predictiveWorkOrder/PredictiveWorkPlanList.vue | 392 +++++ src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue | 350 ++++ src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue | 301 ++++ src/views/eam/modules/predictiveWorkOrder/SafetyRequirement.vue | 210 ++ src/views/eam/modules/predictiveWorkOrder/boms/PredictiveSpareParts.vue | 185 ++ src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue | 173 ++ src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue | 230 +++ src/views/eam/modules/predictiveWorkOrder/DetailList.vue | 220 +++ 15 files changed, 4,282 insertions(+), 65 deletions(-) diff --git a/src/views/eam/PredictiveWorkOrderList.vue b/src/views/eam/PredictiveWorkOrderList.vue index a34dbb4..a55a5a8 100644 --- a/src/views/eam/PredictiveWorkOrderList.vue +++ b/src/views/eam/PredictiveWorkOrderList.vue @@ -219,23 +219,14 @@ </a-table> </div> - <maintenance-order-modal + <predictive-work-order-model ref="modalForm" @ok="modalFormOk" - ></maintenance-order-modal> - <inspection-order-assign-modal - ref="InspectionOrderAssignModal" + ></predictive-work-order-model> + <predictive-work-order-drawer + ref="PredictiveWorkOrderDrawer" @ok="modalFormOk" - ></inspection-order-assign-modal> - <specialy-maintenance-order-exe-drawer - ref="SpecialyMaintenanceOrderExeDrawer" - @ok="modalFormOk" - ></specialy-maintenance-order-exe-drawer> - <specialty-maintenance-order-assign-modal - ref="SpecialtyMaintenanceOrderAssignModal" - @ok="modalFormOk" - > - </specialty-maintenance-order-assign-modal> + ></predictive-work-order-drawer> </a-card> </template> @@ -244,22 +235,17 @@ import '@/assets/less/TableExpand.less' import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import MaintenanceOrderModal from './modules/specialtyMaintenanceOrder/MaintenanceOrderModal' -import InspectionOrderAssignModal from './modules/specialtyMaintenanceOrder/InspectionOrderAssignModal' -import SpecialyMaintenanceOrderExeDrawer from './modules/specialtyMaintenanceOrder/SpecialyMaintenanceOrderExeDrawer' import { getAction, postAction, requestPut } from '@/api/manage' -import SpecialtyMaintenanceOrderAssignModal from './modules/specialtyMaintenanceOrder/SpecialtyMaintenanceOrderAssignModal.vue' -import SpecialtyInspectionOrderAssignModal from './modules/specialtyInspectionOrder/SpecialtyInspectionOrderAssignModal.vue' +import PredictiveWorkOrderModel from './modules/predictiveWorkOrder/PredictiveWorkOrderModel' +import PredictiveWorkOrderDrawer from './modules/predictiveWorkOrder/PredictiveWorkOrderDrawer' + export default { name: 'PredictiveWorkOrderList', mixins: [JeecgListMixin, mixinDevice], components: { - MaintenanceOrderModal, - InspectionOrderAssignModal, - SpecialyMaintenanceOrderExeDrawer, - SpecialtyMaintenanceOrderAssignModal, - SpecialtyInspectionOrderAssignModal + PredictiveWorkOrderModel, + PredictiveWorkOrderDrawer }, data() { return { @@ -279,7 +265,7 @@ { title: '鐘舵��', align: "center", - dataIndex: 'statusName' + dataIndex: 'status_dictText' }, { title: '鍗曟嵁鍙�', @@ -290,66 +276,66 @@ { title: '鐩戞帶绫诲瀷', align: "center", - dataIndex: 'maintenanceMode' + dataIndex: 'monitorType_dictText' }, { title: '璁惧缂栫爜', align: "center", - dataIndex: 'departName', + dataIndex: 'equipmentNum', }, { title: '璁惧鍚嶇О', align: "center", - dataIndex: 'maintenanceTypeName', + dataIndex: 'equipmentName', }, { title: '鍨嬪彿', align: "center", - dataIndex: 'maintenanceCycleName', + dataIndex: 'model', }, { title: '鏍囧噯缂栫爜', align: 'center', - dataIndex: 'assignModeName', + dataIndex: 'planNum', }, { title: '鐗堟湰', align: "center", - dataIndex: 'specialtyMaintenancePlanNum', + dataIndex: 'version', }, { title: '浣跨敤閮ㄩ棬', align: "center", - dataIndex: 'teamName', + dataIndex: 'useId_dictText', }, { title: '娲惧伐鏂瑰紡', align: "center", - dataIndex: 'sumOfWorkingHourQuota', + dataIndex: 'assignMode_dictText', }, { title: '璐d换鐝粍', align: "center", - dataIndex: 'planStartTime', + dataIndex: 'teamId_dictText', width: 170 }, { title: '璐d换浜�', align: "center", - dataIndex: 'planEndTime', + dataIndex: 'maintenanceUserId_dictText', width: 170 }, - { - title: '宸ユ椂瀹氶锛堝皬鏃讹級', - align: "center", - dataIndex: 'planEndTime', - width: 170 - }, + // { + // title: '宸ユ椂瀹氶锛堝皬鏃讹級', + // align: "center", + // dataIndex: 'planEndTime', + // width: 170 + // }, { title: '瀹為檯宸ユ椂', align: "center", - dataIndex: 'planEndTime', + dataIndex: 'actualWorkingHourQuota', width: 170 }, { @@ -418,38 +404,30 @@ }, methods: { - - batchAssign() { - this.$refs.InspectionOrderAssignModal.visible = true - this.$refs.InspectionOrderAssignModal.title = '宸ュ崟娲惧伐' - this.$refs.InspectionOrderAssignModal.selectionRows - this.$refs.InspectionOrderAssignModal.handleShow() - this.$bus.$emit('selectionRows', this.selectionRows); - }, onSelectChange(selectionRows) { this.selectionRows = selectionRows; }, handleOrderExe(record) { - this.$refs.SpecialyMaintenanceOrderExeDrawer.visible = true - this.$refs.SpecialyMaintenanceOrderExeDrawer.title = '涓撲笟淇濆吇宸ュ崟鎵ц' - this.$refs.SpecialyMaintenanceOrderExeDrawer.handleShow(record) + this.$refs. PredictiveWorkOrderDrawer.visible = true + this.$refs. PredictiveWorkOrderDrawer.title = '涓撲笟淇濆吇宸ュ崟鎵ц' + this.$refs. PredictiveWorkOrderDrawer.handleShow(record) if (record.status === '3') { - this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true//淇濆瓨銆佹殏瀛樸�佹姤宸� - this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true//鎾ら攢鎸夐挳 - this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = false//寮�宸ユ寜閽� + this.$refs. PredictiveWorkOrderDrawer.buttonDistable = true//淇濆瓨銆佹殏瀛樸�佹姤宸� + this.$refs. PredictiveWorkOrderDrawer.revocationDistable = true//鎾ら攢鎸夐挳 + this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = false//寮�宸ユ寜閽� } else if (record.status === '4') { - this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = false - this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true - this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true + this.$refs. PredictiveWorkOrderDrawer.buttonDistable = false + this.$refs. PredictiveWorkOrderDrawer.revocationDistable = true + this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = true } else if (record.status === '5') { - this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true - this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = false - this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true + this.$refs. PredictiveWorkOrderDrawer.buttonDistable = true + this.$refs. PredictiveWorkOrderDrawer.revocationDistable = false + this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = true } else if (record.status === '7') { - this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true - this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true - this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true + this.$refs. PredictiveWorkOrderDrawer.buttonDistable = true + this.$refs. PredictiveWorkOrderDrawer.revocationDistable = true + this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = true } }, diff --git a/src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue b/src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue new file mode 100644 index 0000000..448d049 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue @@ -0,0 +1,350 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <a-table + ref="table" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + @change="handleTableChange" + > + + <template + v-for="col in columns" + :slot="col.dataIndex" + slot-scope='text, record, index' + > + <div :key="col.dataIndex"> + <a-input-search + v-if="col.dataIndex == 'materialName'" + enter-button + @search="onSearchMaterial(index)" + :value="text" + :read-only="true" + @change="(e) => handleChange(e, record.key, col, index)" + /> + <a-input-number + :value="text" + v-if="col.dataIndex == 'actualQuantity'" + :min="1" + :max="99999" + @change="(e)=>handleChange(e, record.key, col, index)" + :disabled="record.disabled" + /> + + </div> + </template> + <span + slot='action' + slot-scope='text, record,index' + > + <a @click="handleDeleteFake(index)">鍒犻櫎</a> + </span> + </a-table> + <a-button + style="width: 100%; margin-top: 16px; margin-bottom: 8px" + type="dashed" + icon="plus" + @click="addMaterial" + :disabled="repairOrderStatus!='3'" + >娣诲姞瀹為檯鐢ㄦ枡 + + </a-button> + <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> + <a-row :style="{textAlign:'right'}"> + <a-button + :style="{marginRight: '8px'}" + @click="handleCancel" + :disabled="repairOrderStatus!='3'" + > + 娓呯┖ + </a-button> + <a-button + @click="handleOk(1)" + type="primary" + :style="{marginRight: '8px'}" + :disabled="repairOrderStatus!='3'" + >鏆傚瓨</a-button> + <a-button + @click="handleOk(0)" + type="primary" + :disabled="repairOrderStatus!='3'" + >淇濆瓨</a-button> + </a-row> + <!-- :disabled="false" --> + </div> + <actual-material-select + ref="actualMaterialSelect" + @sendMaterialRecord="sendMaterialRecord" + > + </actual-material-select> + </a-card> +</template> +<script> +import { postAction, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import pick from 'lodash.pick' +import JEllipsis from '@/components/jeecg/JEllipsis' +import ActualMaterialSelect from './select/ActualMaterialSelect.vue' +export default { + name: 'ActualMaterialEditTable', + mixins: [JeecgListMixin], + components: { + JEllipsis, + ActualMaterialSelect + }, + props: { + repairOrderId: { + type: String, + required: false, + default: '-1' + }, + repairOrderStatus: { + type: String, + required: false, + default: '' + } + }, + data() { + return { + title: "宸ヨ壓纭", + flag: false,//涓婚〉闈㈢殑鏍囪浣� 鐢ㄤ簬鍖哄垎鏄惁纭杩囧伐鍗曞伐鑹� 鏉ュ尯鍒唗able椤靛睍绀� 宸ュ崟宸ュ簭 杩樻槸浜у搧宸ュ簭 + visible: false, + model: {}, + obj: {}, + maskClosable: true, + confirmLoading: false, + form: this.$form.createForm(this), + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 99, + pageSizeOptions: ['99', '199'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + validatorRules: { + materialId: { + rules: [ + { required: true, message: '璇烽�夋嫨鐗╂枡!' }, + ] + }, + actualQuantity: { + rules: [ + { required: false, message: '璇峰~鍐欐暟閲�!' }, + ] + }, + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 7 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + drawerWidth: "100%", + visible: false, + disableSubmit: false, + disableSelect: false, + loading: false, + dataSource: [], + columns: [ + { + title: '棰嗘枡鍑哄簱鍗曞彿', + dataIndex: 'num', + align: "center", + width: 150, + }, + { + title: '澶囦欢缂栫爜', + dataIndex: 'sparePartNum', + align: "center", + + }, + { + title: '澶囦欢鍚嶇О', + dataIndex: 'sparePartName', + align: "center", + + }, + { + title: '瑙勬牸', + dataIndex: 'specification', + align: "center", + }, + { + title: '鍨嬪彿', + dataIndex: 'model', + align: "center", + }, + { + title: '鍒堕�犲晢', + dataIndex: 'constructorName', + align: "center", + }, + { + title: '涓诲崟浣�', + dataIndex: 'mainUnitName', + align: "center", + + }, + { + title: '涓绘暟閲�', + align: 'center', + dataIndex: 'mainQuantity' + }, + { + title: '鍙敤鏁伴噺', + align: 'center', + dataIndex: 'availableQuantity' + }, + { + title: '浣跨敤鏁伴噺', + dataIndex: 'quantity', + align: "center", + scopedSlots: { customRender: 'quantity' }, + className: 'red', + + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + width: 250, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/eam/repairOrder/listRepairOrderActualMaterialByMainId", + confirmMaterial: "/eam/repairOrder/addRepairOrderActualMaterial" + }, + changeIndex: 0 + } + }, + + created() { + this.queryParam['repairOrderId'] = this.repairOrderId; + this.loadData(1); + }, + methods: { + addMaterial() { + this.dataSource.push({ materialId: '', repairOrderId: this.repairOrderId, actualQuantity: 1, materialNum: '', materialName: '', materialModel: '', materialSpecification: '', unitId_dictText: '' }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close'); + this.dataSource = []; + this.disableSubmit = false; + this.visible = false; + }, + handleDeleteFake(index) { + this.dataSource.pop(index); + }, + handleOk(saveStatus) { + const that = this + if (saveStatus == 0) { + let materialDataSource = that.dataSource; + let indexIdList = []; + for (let i = 0; i < materialDataSource.length; i++) { + if (materialDataSource[i].materialId == undefined || materialDataSource[i].materialId == null || materialDataSource[i].materialId == '') { + that.$message.warning("璇烽�夋嫨绗�" + (i + 1) + "琛岀墿鏂欙紒"); + return false; + } + if (materialDataSource[i].actualQuantity == undefined || materialDataSource[i].actualQuantity == null || materialDataSource[i].actualQuantity == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "琛岀敤鏂欐暟锛�"); + return false; + } + } + } + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = {} + formData.repairOrderId = that.repairOrderId; + formData.actualMaterialList = that.dataSource; + let obj = obj = postAction(this.url.confirmMaterial, formData) + obj.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() + that.loadData(1); + }) + } + }) + }, + handleChange(value, key, column, index) { + let that = this; + const temp = [...that.dataSource]; + const target = temp[index]; + if (target) { + target[column.dataIndex] = value; + if ('materialId' == column.dataIndex) { + target['materialId'] = value; + } + if ('actualQuantity' == column.dataIndex) { + target['actualQuantity'] = value; + } + that.dataSource = temp; + } + }, + onSearchMaterial(index) { + this.recordIndex = index + this.$refs.actualMaterialSelect.list() + this.$refs.actualMaterialSelect.title = '鐗╂枡閫夋嫨' + }, + sendMaterialRecord(data, val) { + let record = data.record + const temp = [...this.dataSource] + const target = temp[this.recordIndex] + if (target) { + console.log(target) + target.materialId = record.id; + target.materialName = record.name; + target.materialNum = record.num; + target.materialModel = record.model; + target.materialSpecification = record.specification; + target.unitId_dictText = record.unitId_dictText; + this.dataSource = temp + } + }, + clearList() { + this.dataSource = []; + this.ipagination.current = 1 + } + }, + + watch: { + repairOrderId: { + immediate: true, + handler(val) { + this.clearList(); + this.queryParam['repairOrderId'] = val + this.loadData(1); + } + } + } +} +</script> + +<style scoped> +/deep/ .red { + color: red; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue b/src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue new file mode 100644 index 0000000..8fe8162 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue @@ -0,0 +1,301 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <a-table + ref="table" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + @change="handleTableChange" + > + <template + v-for="col in columns" + :slot="col.dataIndex" + slot-scope='text, record, index' + > + <div :key="col.dataIndex"> + <a-input-search + v-if="col.dataIndex == 'username'" + enter-button + @search="onSearchUser(index)" + :value="text" + :read-only="true" + @change="(e) => handleChange(e, record.key, col, index)" + /> + <a-input-number + :value="text" + v-if="col.dataIndex == 'actualHour'" + :min="1" + :max="99999" + @change="(e)=>handleChange(e, record.key, col, index)" + :disabled="record.disabled" + /> + + </div> + </template> + <span slot='action' slot-scope='text, record,index'> + <a @click="handleDeleteFake(index)">鍒犻櫎</a> + </span> + </a-table> + <a-button + style="width: 100%; margin-top: 16px; margin-bottom: 8px" + type="dashed" + icon="plus" + @click="addHour" + :disabled="repairOrderStatus!='3'" + >娣诲姞瀹為檯宸ユ椂 + </a-button> + <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> + <a-row :style="{textAlign:'right'}"> + <a-button + :style="{marginRight: '8px'}" + @click="handleCancel" + :disabled="repairOrderStatus!='3'" + > + 娓呯┖ + </a-button> + <a-button + @click="handleOk(1)" + type="primary" + :style="{marginRight: '8px'}" + :disabled="repairOrderStatus!='3'" + >鏆傚瓨</a-button> + <a-button + @click="handleOk(0)" + type="primary" + :disabled="repairOrderStatus!='3'" + >淇濆瓨</a-button> + </a-row> + <!-- :disabled="false" --> + </div> + <actual-hour-user-select + ref="actualUserSelect" + @sendUserRecord="sendUserRecord" + > + </actual-hour-user-select> + </a-card> +</template> +<script> +import { postAction, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import pick from 'lodash.pick' +import JEllipsis from '@/components/jeecg/JEllipsis' +import ActualHourUserSelect from './select/ActualHourUserSelect.vue' +export default { + name: 'ActualWorkHoursEditTable', + mixins: [JeecgListMixin], + components: { + JEllipsis, + ActualHourUserSelect + }, + props:{ + repairOrderId:{ + type:String, + required:false, + default:'' + }, + repairOrderStatus:{ + type:String, + required:false, + default:'' + } + }, + data() { + return { + title: "宸ヨ壓纭", + flag: false,//涓婚〉闈㈢殑鏍囪浣� 鐢ㄤ簬鍖哄垎鏄惁纭杩囧伐鍗曞伐鑹� 鏉ュ尯鍒唗able椤靛睍绀� 宸ュ崟宸ュ簭 杩樻槸浜у搧宸ュ簭 + visible: false, + model: {}, + obj: {}, + maskClosable: true, + confirmLoading: false, + form: this.$form.createForm(this), + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 99, + pageSizeOptions: ['99', '199'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + validatorRules: { + userId: { + rules: [ + { required: true, message: '璇烽�夋嫨浜哄憳!' }, + ] + }, + actual_hour: { + rules: [ + { required: false, message: '璇峰~鍐欏伐鏃�!'}, + ] + }, + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 7 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + drawerWidth: "100%", + visible: false, + disableSubmit: false, + disableSelect: false, + loading: false, + dataSource: [], + columns: [ + { + title: '*浜哄憳缂栫爜', + dataIndex: 'username', + align: "center", + scopedSlots: { customRender: 'username' }, + className: 'red', + width: 250, + }, + { + title: '浜哄憳鍚嶇О', + dataIndex: 'realname', + align: "center", + width: 250, + }, + { + title: '*瀹為檯宸ユ椂', + dataIndex: 'actualHour', + align: "center", + className: 'red', + scopedSlots: { customRender: 'actualHour' }, + width: 250, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + width: 250, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/eam/repairOrder/listRepairOrderActualWorkHoursByMainId", + confirmHour:"/eam/repairOrder/addRepairOrderActualWorkHours" + }, + changeIndex: 0 + } + }, + created(){ + this.queryParam['repairOrderId'] = this.repairOrderId; + this.loadData(1); + }, + methods: { + addHour() { + this.dataSource.push({userId:'',repairOrderId:this.repairOrderId,actualHour:0,username:'',realname:''}) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close'); + this.dataSource = [] + this.disableSubmit = false; + this.visible = false; + }, + handleDeleteFake(index){ + this.dataSource.pop(index); + }, + handleOk(saveStatus) { + const that = this + if(saveStatus==0){ + let workHoursDataSource = that.dataSource; + for (let i = 0; i < workHoursDataSource.length; i++) { + if (workHoursDataSource[i].userId == undefined || workHoursDataSource[i].userId == null || workHoursDataSource[i].userId == '') { + that.$message.warning("璇烽�夋嫨绗�"+(i+1)+"琛岀淮淇汉鍛橈紒"); + return false; + } + if(workHoursDataSource[i].actualHour == undefined || workHoursDataSource[i].actualHour == null||workHoursDataSource[i].actualHour==''){ + that.$message.warning("璇峰~鍐欑"+(i+1)+"琛屽疄闄呭伐鏃讹紒"); + return false; + } + } + } + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true + let formData = {} + formData.repairOrderId = that.repairOrderId; + formData.actualHourList = that.dataSource; + let obj = obj = postAction(this.url.confirmHour, formData) + obj.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() + that.loadData(1); + }) + } + }) + }, + handleChange(value, key, column, index) { + let that = this; + const temp = [...that.dataSource]; + const target = temp[index]; + if (target) { + target[column.dataIndex] = value; + if ('userId' == column.dataIndex) { + target['userId'] = value; + } + if ('actualHour' == column.dataIndex) { + target['actualHour'] = value; + } + that.dataSource = temp; + } + }, + onSearchUser(index) { + this.recordIndex = index + this.$refs.actualUserSelect.list() + this.$refs.actualUserSelect.title = '浜哄憳閫夋嫨' + }, + sendUserRecord(data, val) { + let record = data.record + const temp = [...this.dataSource] + const target = temp[this.recordIndex] + if (target) { + console.log(record) + target.userId = record.id; + target.username = record.username; + target.realname = record.realname; + this.dataSource = temp + } + }, + clearList(){ + this.dataSource=[]; + this.ipagination.current = 1 + } + }, + watch:{ + repairOrderId:{ + immediate: true, + handler(val) { + this.clearList(); + this.queryParam['repairOrderId'] = val + this.loadData(1); + } + } + } +} +</script> + +<style scoped> +/deep/ .red { + color: red; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/predictiveWorkOrder/DetailList.vue b/src/views/eam/modules/predictiveWorkOrder/DetailList.vue new file mode 100644 index 0000000..c0434bf --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/DetailList.vue @@ -0,0 +1,220 @@ +<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" + v-if="mainId !='' && isAdd " + >鏂板</a-button> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange"> + <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" --> + + <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="action" slot-scope="text, record" > + <a @click="handleEdit(record)" v-if="addStatus" >缂栬緫</a> + <a-divider type="vertical" v-if="addStatus" /> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)" > + <a v-if="addStatus">鍒犻櫎</a> + </a-popconfirm> + <a style="font-size: 12px;font-style: italic;" v-if="!addStatus">璇ョ姸鎬佷笉鍙搷浣�</a> + </span> + + </a-table> + </div> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + export default { + name: "RepairOrderDetailList", + mixins:[JeecgListMixin], + components: { }, + props:{ + mainId:{ + type:String, + default:'', + required:false + }, + maintenanceStandardId: { + type: String, + required: false + }, + isEdit: { + type: Boolean, + default: false + }, + isAdd: { + type: Boolean, + default: false + }, + isDel: { + type: Boolean, + default: false + } + + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['repairOrderId'] = val + this.loadData(1); + } + } + } + }, + data () { + return { + disableMixinCreated:true, + repairOrderSelectionRows:[], + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'閮ㄤ綅', + align:"center", + dataIndex: 'location', + width:200 + }, + { + title:'绀烘剰鍥�', + align:"center", + scopedSlots: {customRender: 'imgSlot'}, + dataIndex: 'sketchMap', + width:200 + }, + // { + // title:'缁翠慨椤圭洰', + // align:"center", + // dataIndex: 'maintenanceItem' + // }, + { + title:'缁翠慨瑕佹眰', + align:"center", + dataIndex: 'maintenanceRequire', + width:200 + }, + { + title:'鏂规硶', + align:"center", + dataIndex: 'maintenanceWay', + width:200 + }, + { + title:'宸ュ叿', + align:"center", + dataIndex: 'maintenanceTooling', + width:200 + }, + { + title:'瀹夊叏瑕佹眰', + align:"center", + dataIndex: 'safetyRequirement' , + width:200 + }, + { + title:'宸ユ椂瀹氶', + align:"center", + dataIndex: 'timeQuota', + width:200 + }, + { + title:'缁翠繚涓撲笟', + align:"center", + dataIndex: 'mamaintenanceSpecialtyId_dictText', + width:200 + }, + ], + url: { + list: "/eam/repairOrder/pageRepairOrderDetailByMainId", + delete: "/eam/repairOrder/deleteRepairOrderDetail", + deleteBatch: "/eam/repairOrder/deleteBatchRepairOrderDetail", + exportXlsUrl: "/eam/repairOrder/exportRepairOrderDetail", + importUrl: "/eam/repairOrder/importRepairOrderDetail", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + mounted() { + this.$bus.$on('repairOrderSelectionRows', (data) => { + this.repairOrderSelectionRows = data + }) + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/eam/modules/predictiveWorkOrder/PlanMaterial.vue b/src/views/eam/modules/predictiveWorkOrder/PlanMaterial.vue new file mode 100644 index 0000000..eb5120f --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/PlanMaterial.vue @@ -0,0 +1,220 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + <span + slot="action" + slot-scope="text, record" + > + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + </div> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { getAction, deleteAction } from '@/api/manage' + import Tooltip from 'ant-design-vue/es/tooltip' + export default { + name: 'PlanningMaterial', + components: { + Tooltip, + }, + mixins: [JeecgListMixin], + props: { + maintenanceStandardId: { + type: String, + required: false + }, + isEdit: { + type: Boolean, + default: false + }, + isAdd: { + type: Boolean, + default: false + }, + isDel: { + type: Boolean, + default: false + } + }, + mounted() { + + }, + watch: { + maintenanceStandardId: { + immediate: true, + handler(val) { + if (this.maintenanceStandardId) { + this.queryParam.maintenanceStandardId = val + this.queryParam.delFlag = 0 + this.loadData(1) + }else{ + this.clearList(); + } + } + }, + }, + data() { + return { + disableMixinCreated:true, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '澶囦欢缂栧彿', + dataIndex: 'num', + align: 'center', + width:200 + }, + { + title: '澶囦欢鍚嶇О', + dataIndex: 'name', + align: 'center', + width:200 + }, + { + title: '澶囦欢瑙勬牸', + dataIndex: 'specification', + align: 'center', + width:200 + }, + { + title: '澶囦欢鍨嬪彿', + dataIndex: 'model', + align: 'center', + width:200 + }, + { + title: '鍒堕�犲晢', + dataIndex: 'constructorName', + align: 'center', + width:200 + }, + { + title: '鏁伴噺', + dataIndex: 'quantity', + align: 'center', + width:200 + }, + { + title: '鍗曚綅', + dataIndex: 'unitName', + align: 'center', + width:200 + }, + ], + url: { + list: '/eam/maintenanceStandardPlanningMaterial/getMaintenanceStandardPlanningMaterialList', + delete: '/eam/maintenanceStandardPlanningMaterial/delete' + } + } + }, + + methods: { + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '璁″垝鐢ㄦ枡' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.maintenanceStandardId = this.maintenanceStandardId + }, + + handleDelete: function(id) { + if (!this.url.delete) { + this.$message.error('璇疯缃畊rl.delete灞炴��!') + return + } + var that = this + deleteAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData() + that.alterFlag = new Date() + } else { + that.$message.warning(res.message) + } + }) + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + var params = this.getQueryParams()//鏌ヨ鏉′欢 + this.loading = true + // this.originTargetKeys = []; + getAction(this.url.list, params).then((res) => { + if (res.success) { + 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'; +</style> diff --git a/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue new file mode 100644 index 0000000..66d6dcb --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue @@ -0,0 +1,728 @@ +<template> + <a-drawer + :title="title" + :width="drawerWidth" + :visible="visible" + @close="handleCancel" + :confirmLoading="confirmLoading" + :maskClosable="maskClosable" + > + <a-card :style="getBackground()"> + <template> + <a-card> + <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> + <a-row :style="{textAlign:'left'}"> + <a-button + :style="{marginRight: '8px'}" + @click="handleSW" + :disabled=SWbuttonDistable + type="primary" + >寮�宸�</a-button> + <a-button + :style="{marginRight: '8px'}" + @click="handleReport" + :disabled="buttonDistable" + type="primary" + >鎶ュ伐</a-button> + <a-button + :style="{marginRight: '8px'}" + @click="handleReset" + :disabled="revocationDistable" + type="primary" + >鎾ら攢</a-button> + </a-row> + </div> + <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="鐘舵��" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.statusName }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="淇濆吇宸ュ崟鍙�" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.num }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="淇濆吇绫诲瀷" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.maintenanceTypeName }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="瀵硅薄閮ㄩ棬" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.departName }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="缁翠繚鏂瑰紡" + class="hightColor" + > + <span + v-if="this.model != null" + class="hight" + >{{ this.model.maintenanceMode }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="璐d换鐝粍" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.teamName }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + </a-row> + </div> + <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="璁惧缂栧彿" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.equipmentNum }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="璁惧鍚嶇О" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.equipmentName }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + <a-col :span="8"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="璁惧鍨嬪彿" + class="hightColor" + > + <span + v-if="this.model != null" + class="hightColor" + >{{ this.model.equipmentModel }}</span> + <span + v-else + class="frozenRowClass" + >-</span> + </a-form-item> + </a-col> + </a-row> + </div> + <a-tabs + type="card" + defaultActiveKey="1" + > + <a-tab-pane + tab='瑙﹀彂鏉′欢' + key="1" + class="hightColor" + > + <div + class="table-operator" + style="margin:-16px" + > + <predictive-spare-parts :planId='workPlanId' v-show="model.monitorType == 'smkz'"/> + <!-- v-if="selectionRows[0].monitorType == 'smkz'"--> + <predictive-parameters :planId='workPlanId' v-show="model.monitorType == 'cskz'"/> + <!-- v-if="selectionRows[0].monitorType == 'cskz'" --> + <predictive-warn :planId='workPlanId' v-show="model.monitorType == 'bjkz'"/> + <!-- v-if="selectionRows[0].monitorType == 'bjkz'"--> + </div> + </a-tab-pane> + <a-tab-pane + tab='缁存姢鍐呭' + key="2" + class="hightColor" + > + <predictive-order-detail-list :mainId='workPlanId'></predictive-order-detail-list> + </a-tab-pane> + + <a-tab-pane + tab='璁″垝鐢ㄦ枡' + key="3" + > + <div + class="table-operator" + style="margin:-16px" + > + <plan-material :maintenanceStandardId="workPlanId" /> + </div> + </a-tab-pane> + <a-tab-pane + tab='鍗遍櫓闃叉帶' + key="4" + > + <div + class="table-operator" + style="margin:-16px" + > + <maintenance-standard-safety-requirement :maintenanceStandardId='workPlanId' /> + </div> + </a-tab-pane> + <a-tab-pane + tab='浣滀笟鎸囧涔�' + key="5" + > + <div + class="table-operator" + style="margin:-16px" + > + <predictive-work-instruction :maintenanceStandardId='workPlanId'></predictive-work-instruction> + </div> + </a-tab-pane> + <a-tab-pane + tab='瀹為檯鐢ㄦ枡' + key="6" + > + <div + class="table-operator" + style="margin:-16px" + > + <actual-material-edit-table + ref="actualMaterialTabel" + :specialyMaintenanceOrderId="this.model.id" + :specialyMaintenanceOrderStatus="this.model.status" + :equipmentId="this.model.equipmentId" + ></actual-material-edit-table> + </div> + </a-tab-pane> + <a-tab-pane + tab='瀹為檯宸ユ椂' + key="7" + > + <div + class="table-operator" + style="margin:-16px" + > + <actual-work-hours-edit-table + :specialyMaintenanceOrderId="this.model.id" + :specialyMaintenanceOrderStatus="this.model.status" + :equipmentId="this.model.equipmentId" + :teamId="this.model.teamId" + ></actual-work-hours-edit-table> + </div> + </a-tab-pane> + </a-tabs> + </a-card> + </template> + </a-card> + + <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> + <a-row :style="{textAlign:'right'}"> + <a-button + :style="{marginRight: '8px'}" + @click="handleCancel" + > + 鍙栨秷 + </a-button> + <a-button + :style="{marginRight: '8px'}" + @click="handleTS" + :disabled="buttonDistable" + type="primary" + v-if="false" + >鏆傚瓨</a-button> + <a-button + @click="handleOk" + :disabled="buttonDistable" + type="primary" + v-if="false" + >淇濆瓨</a-button> + </a-row> + </div> + </a-drawer> +</template> + +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { requestPut, getAction, downFile } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' + +import { preview } from 'vue-photo-preview' +import { ACCESS_TOKEN } from '@/store/mutation-types' +import Vue from 'vue' +import PdfView from '@views/common/PdfView' +import { getFileAccessHttpUrl } from '@/api/manage'; + +import PlanMaterial from './PlanMaterial.vue' +import MaintenanceStandardSafetyRequirement from './SafetyRequirement' +import ActualMaterialEditTable from './ActualMaterialEditTable' +import ActualWorkHoursEditTable from './ActualWorkHoursEditTable' +//鏂颁笢瑗� +import PredictiveParameters from './boms/PredictiveParameters.vue' +import PredictiveSpareParts from './boms/PredictiveSpareParts.vue' +import PredictiveWarn from './boms/PredictiveWarn.vue' +import PredictiveOrderDetailList from './DetailList' +import PredictiveWorkInstruction from './WorkInstruction' + +export default { + name: 'PredictiveWorkOrderExeDrawer', + mixins: [JeecgListMixin], + components: { + PdfView, + Tooltip, + PlanMaterial, + MaintenanceStandardSafetyRequirement, + ActualMaterialEditTable, + ActualWorkHoursEditTable, + PredictiveParameters, + PredictiveSpareParts, + PredictiveWarn, + PredictiveOrderDetailList, + PredictiveWorkInstruction + + }, + data() { + return { + pageSizeOptions: ['1'], + currentPage: 1, + pageSize: 1, + total: 10, + workPlanId:'', + title: "涓撲笟宸ュ崟鎵ц", + visible: false, + maskClosable: true, + confirmLoading: false, + drawerWidth: "100%", + buttonDistable: false, + SWbuttonDistable: false, + revocationDistable: false, + currentNodeSelect: '', + specialtyMaintenancePlanId: '', + maintenanceStandardId: '-1', + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + url: { + getEquipmentTotalByOrderId: "/eam/specialtyMaintenanceOrderDetail/getEquipmentTotalByOrderId", + urlDownload: window._CONFIG['staticDomainURL'], + download: '/sys/upload/downloadFile', + editStatus: "/eam/specialtyMaintenanceOrder/editStatus", + revocation: "/eam/specialtyMaintenanceOrder/revocation", + report: "/eam/specialtyMaintenanceOrder/report", + }, + } + }, + mounted() { + this.$bus.$on('closeDrawer', (data) => { + this.visible = false; + }) + }, + + methods: { + + onChange(page, pageSize) { + this.queryParam.specialtyMaintenanceOrderId = this.specialtyMaintenanceOrderId + this.queryParam.pageSize = pageSize + this.queryParam.pageNo = page + this.getEquipmentTotal() + }, + + handleShow(record) { + this.model = Object.assign({}, record); + this.workPlanId = record.workPlanId; + this.visible = true; + }, + getEquipmentTotal() { + var params = this.queryParam;//鏌ヨ鏉′欢 + getAction(this.url.getEquipmentTotalByOrderId, params).then((res) => { + if (res.success) { + this.total = res.result.total + this.model.equipmentNum = res.result.records[0].equipmentNum + this.model.equipmentName = res.result.records[0].equipmentName + this.model.equipmentModel = res.result.records[0].equipmentModel + this.model.equipmentId = res.result.records[0].equipmentId + this.queryParam.equipmentId = res.result.records[0].equipmentId + this.loadData1(1) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + + }) + }, + loadData1(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + for (let i = 0; i < res.result.records.length; i++) { + this.maintenanceStandardId = res.result.records[i].maintenanceStandardId; + let r = res.result.records[i].sketchPhoto; + r.src = this.getSrc(res.result.records[i].sketchPhoto); + } + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + 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 + }) + }, + + modalFormOk() { + this.getEquipmentTotal() + //娓呯┖鍒楄〃閫変腑 + this.onClearSelected() + }, + loadData() { + // this.getEquipmentTotal() + }, + getBackground() { + return "background-color:rgba(127, 127, 127,0.08)"; + }, + handleCancel() { + this.$emit('ok'); + this.alterFlag = new Date(); + this.close() + }, + close() { + this.visible = false; + }, + //鏆傚瓨 + handleTS() { + const that = this; + that.confirmLoading = true; + let formData = Object.assign(this.model); + formData.specialtyInspectionOrderDetails = that.dataSource + requestPut(this.url.edit, formData).then((res) => { + if (res.success) { + that.$message.success("鏆傚瓨鎴愬姛!"); + that.getEquipmentTotal() + that.$emit('ok'); + that.alterFlag = new Date(); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + // that.close(); + }) + }, + //寮�宸� + handleSW() { + const that = this; + that.confirmLoading = true; + this.$confirm({ + title: '淇濆吇宸ュ崟寮�宸�', + content: '鎻愮ず锛氬紑宸ュ悗鏃犳硶鎾ゅ洖锛岃璋ㄦ厧鎿嶄綔锛�', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + requestPut(that.url.editStatus, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => { + if (res.success) { + that.model.status = '4' + that.$message.success("宸ュ崟寮�宸ユ垚鍔燂紒") + that.getEquipmentTotal() + that.buttonDistable = false + that.revocationDistable = true + that.SWbuttonDistable = true + } else { + that.$message.warning("宸ュ崟寮�宸ュけ璐ワ紒") + } + }).finally(() => { + that.confirmLoading = false; + // that.close(); + }) + }, + }) + }, + //鎶ュ伐 + handleReport() { + var actualMaterials = this.$refs.actualMaterialTabel.dataSource; + for (var i = 0; i < actualMaterials.length; i++) { + if (actualMaterials[i].isLock == 'no') { + this.$message.warn("瀹為檯鐢ㄦ枡绗�" + (i + 1) + "琛屽皻鏈攣鏂欙紝璇烽攣鏂欏悗鍐嶈繘琛屾姤宸�"); + return false; + } + } + const that = this; + that.confirmLoading = true; + this.$confirm({ + title: '淇濆吇宸ュ崟鎶ュ伐', + content: '鎻愮ず锛氭姤宸ュ悗鐐规瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + requestPut(that.url.report, { id: that.specialtyMaintenanceOrderId, status: '5' }).then((res) => { + if (res.success) { + that.model.status = '5' + that.$message.success(res.message) + that.getEquipmentTotal() + that.buttonDistable = false + that.revocationDistable = true + that.SWbuttonDistable = true + that.$emit('ok'); + that.alterFlag = new Date(); + that.close(); + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false; + // + }) + }, + }) + }, + //鎾ら攢 + handleReset() { + const that = this; + that.confirmLoading = true; + this.$confirm({ + title: '瀹屽伐鎾ら攢', + content: '鎻愮ず锛氬畬宸ユ挙閿�鍚庡彲缁х画鎶ュ伐鎿嶄綔锛�', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + requestPut(that.url.revocation, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => { + if (res.success) { + that.model.status = '4' + that.$message.success(res.message) + that.getEquipmentTotal() + that.buttonDistable = false + that.revocationDistable = true + that.SWbuttonDistable = true + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false; + // that.close(); + }) + }, + }) + }, + //淇濆瓨 + handleOk() { + const that = this; + that.confirmLoading = true; + let formData = Object.assign(this.model); + for (let i = 0; i < that.dataSource.length; i++) { + let o = this.dataSource[i] + if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') { + that.$message.warning('璇疯緭鍏ョ偣妫�缁撴灉锛�') + that.confirmLoading = false; + return + } + if (o.treatmentMeasure == null || o.treatmentMeasure == '') { + that.$message.warning('璇烽�夋嫨寮傚父澶勭疆锛�') + that.confirmLoading = false; + return + } + } + formData.specialtyInspectionOrderDetails = that.dataSource + requestPut(this.url.save, formData).then((res) => { + if (res.success) { + that.$message.success("淇濆瓨鎴愬姛!"); + that.getEquipmentTotal() + that.$emit('ok'); + that.alterFlag = new Date(); + } else { + that.$message.warning("淇濆瓨澶辫触!"); + } + }).finally(() => { + that.confirmLoading = false; + // that.close(); + }) + }, + + view(record) { + this.$refs.pdfview.showPdf(record.src); + }, + + handleDownload(record) { + downFile(this.url.download, { id: record.upload.id }).then((res) => { + if (!res) { + this.$message.warning('鏂囦欢涓嬭浇澶辫触') + return + } else { + let fileName = record.upload.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瀵硅薄 + } + } + }) + }, + + 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) + } + }, + }, + +} +</script> + +<style scoped> +@import '~@assets/less/common.less'; +.hightColor { + height: 10%; + font-weight: bold; + font-size: 20px; + color: #1b1e1e; +} +.frozenRowClass { + color: #c9c9c9; +} +.fontweight { + font-weight: bold; +} +.hight { + color: #f5222d; +} +.red { + color: red; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderModel.vue b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderModel.vue new file mode 100644 index 0000000..2be3a0d --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderModel.vue @@ -0,0 +1,368 @@ +<template> + <a-modal + :title="title" + :width="1250" + :visible="visible" + :maskClosable="false" + @ok="handleOk" + cancelText="鍏抽棴" + @cancel="handleCancel" + :confirmLoading="confirmLoading" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item + label="缁熶竴缂栫爜" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'绯荤粺鑷姩鐢熸垚'" + v-decorator="['num', validatorRules.num ]" + /> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item + label="淇濆吇鏃ユ湡" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <j-date + :disabled="disableSubmit" + v-decorator="['planStartTime', validatorRules.planStartTime ]" + placeholder="璇烽�夋嫨缁存姢鏃堕棿" + style="width: 100%" + :showTime="true" + dateFormat="YYYY-MM-DD HH:mm:ss" + /> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item + label="涓撲笟淇濆吇鏂规" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input-search + :disabled="disableSubmit" + :placeholder="disableSubmit?'':'璇烽�夋嫨棰勬祴鎬х淮鎶ゆ柟妗�'" + enter-button + @search="onPredictiveWorkPlanList()" + :read-only="true" + v-decorator="['planNum', validatorRules.planNum]" + /> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="娲惧伐鏂瑰紡" + > + <j-dict-select-tag + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇烽�夋嫨娲惧伐鏂瑰紡'" + :triggerChange="true" + dictCode="assign_mode" + v-decorator="['assignMode', validatorRules.assignMode]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="璐d换鐝粍" + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ヨ矗浠荤彮缁�'" + v-decorator="['teamId_dictText', validatorRules.teamId_dictText ]" + /> + </a-form-item> + </a-col> + <a-col + hidden + :span="12" + > + <a-form-item + label="涓撲笟鐐规鏂规Id" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'涓撲笟鐐规鏂规Id'" + v-decorator="['workPlanId', validatorRules.workPlanId ]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row + v-if="!isHidden" + :gutter="24" + > + <a-col :span="12"> + <a-form-item + label="璐d换浜�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input-search + :disabled="disableSubmit" + placeholder="璐d换浜�" + enter-button + @search="onDutyUserList()" + :read-only="true" + v-decorator="['maintenanceUserId_dictText', validatorRules.maintenanceUserId_dictText]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row + hidden + :gutter="24" + > + <a-col :span="12"> + <a-form-item + label="璐d换鐝粍Id" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ヨ矗浠荤彮缁処d'" + v-decorator="['teamId', validatorRules.teamId ]" + /> + </a-form-item> + </a-col> + <a-col :span="12"> + <a-form-item + label="璐d换浜�/缁存姢浜篒d" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ヨ矗浠讳汉'" + v-decorator="['maintenanceUserId', validatorRules.maintenanceUserId ]" + /> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + + <template slot="footer"> + <a-button + :style="{marginRight: '8px'}" + @click="handleCancel()" + > + 鍏抽棴 + </a-button> + + <a-button + @click="handleOk()" + type="primary" + :loading="confirmLoading" + :disabled="disableSubmit || confirmLoading" + >纭畾</a-button> + </template> + <predictive-work-plan-list + ref="PredictiveWorkPlanList" + @sendPlanRecord='sendPlanRecord' + ></predictive-work-plan-list> + </a-modal> + +</template> + +<script> +import { getAction, postAction, requestPut } from '@/api/manage' +import pick from 'lodash.pick' +import JMultiSelectTag from '@/components/dict/JMultiSelectTag' +import Tooltip from 'ant-design-vue/es/tooltip' +import PredictiveWorkPlanList from './PredictiveWorkPlanList.vue' + +export default { + name: "MaintenanceOrderModal", + components: { + JMultiSelectTag, + Tooltip, + PredictiveWorkPlanList + // PdfView, + // preview, + }, + data() { + return { + isHidden: true, + title: "鎿嶄綔", + visible: false, + disableSubmit: false, + codeDisable: true, + model: {}, + inspectionCycles: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + num: { + rules: [ + // { required: true, message: '璇疯緭鍏ュ伐鍗曠紪鐮�!' }, + ] + }, + planNum: { + rules: [ + { required: true, message: '璇烽�夋嫨涓撲笟鐐规鏂规!' }, + ] + }, + planStartTime: { + rules: [ + { required: true, message: '璇烽�夋嫨淇濆吇鏃ユ湡!' }, + ] + }, + assignMode: { + rules: [ + { required: true, message: '璇烽�夋嫨娲惧伐鏂瑰紡!' }, + ] + }, + maintenanceUserId_dictText: { + rules: [ + { required: true, message: '璇烽�夋嫨璐d换浜�!' }, + ] + }, + teamId_dictText: { + rules: [ + { required: true, message: '璇烽�夋嫨璐d换鐝粍!' }, + ] + }, + }, + url: { + add: "/eam/specialtyMaintenanceOrder/add", + edit: "/eam/specialtyMaintenanceOrder/edit", + }, + } + }, + + methods: { + add() { + this.edit({}) + }, + + edit(record) { + let that = this; + this.form.resetFields(); + this.model = Object.assign({}, record); + this.visible = true; + that.$nextTick(() => { + that.form.setFieldsValue(pick(that.model, 'num', 'planNum', 'assignMode', 'assignMode_dictText', 'teamId', 'teamId_dictText', 'workPlanId', 'planStartTime')); + }); + if (record.id) { + this.codeDisable = true; + } else { + this.codeDisable = false; + } + }, + + close() { + this.$emit('close'); + this.visible = false; + }, + + handleCancel() { + this.close(); + }, + onPredictiveWorkPlanList() { + this.$refs.PredictiveWorkPlanList.list(); + this.$refs.PredictiveWorkPlanList.title = "閫夋嫨棰勬祴鎬х淮鎶ゆ柟妗�"; + }, + sendPlanRecord(data) { + let record = data.record; + this.form.setFieldsValue({ assignMode: null, teamId_dictText: null, teamId: null, maintenanceUserName: null, maintenanceUserId: null }); + this.form.setFieldsValue({ workPlanId: record.id, planNum: record.num }); + this.form.setFieldsValue({ assignMode: record.assign_mode, teamId_dictText: record.teamName, teamId: record.teamId }); + if ("3" == record.assignMode) { + this.isHidden = false + } else { + this.isHidden = true + } + }, + + handleOk() { + const that = this; + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let formData = Object.assign(this.model, values); + let obj; + if (!this.model.id) { + obj = postAction(this.url.add, formData); + } else { + obj = requestPut(this.url.edit, formData, { id: this.model.id }); + } + obj.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(); + }) + } + }) + }, + + + }, +} +</script> + +<style lang="less" scoped> +/deep/ .frozenRowClass { + color: #c9c9c9; +} +.fontweight { + font-weight: bold; +} +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkPlanList.vue b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkPlanList.vue new file mode 100644 index 0000000..50147d7 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/PredictiveWorkPlanList.vue @@ -0,0 +1,392 @@ +<template> + <a-modal + :title="title" + :width="1250" + :visible="visible" + :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="鏂规缂栫爜"> + <a-input + placeholder="璇疯緭鍏ユ柟妗堢紪鐮佹绱�" + v-model="queryParam.num" + ></a-input> + </a-form-item> + </a-col> + <!-- <a-col + :md="6" + :sm="8" + > + <a-form-item label="浜哄憳缂栧彿"> + <a-input + placeholder="璇疯緭鍏ヤ汉鍛樼紪鍙锋绱�" + v-model="queryParam.username" + ></a-input> + </a-form-item> + </a-col> + + <a-col + :md="6" + :sm="8" + > + <a-form-item label="浜哄憳鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ヤ汉鍛樺悕绉版绱�" + v-model="queryParam.realname" + ></a-input> + </a-form-item> + </a-col> --> + <a-col + :md="6" + :sm="8" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + @click="searchReset" + icon="reload" + style="margin-left:8px;" + >閲嶇疆</a-button> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + + </a-col> + </a-row> + </a-form> + </div> + <div style="margin-top:8px;"> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + :customRow="clickThenCheck" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" + > + + </a-table> + </div> + </a-form> + </a-spin> + + </a-modal> +</template> + +<script> + +import { postAction, getAction } from '@/api/manage' +import JDate from '@/components/jeecg/JDate' +import Tooltip from 'ant-design-vue/es/tooltip' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JEllipsis from '@/components/jeecg/JEllipsis'//寮曞叆杩囬暱瑁佸壀 +import store from '@/store' + +export default { + name: "PredictiveWorkPlanList", + mixins: [JeecgListMixin], + components: { + JDate, + Tooltip, + JEllipsis, + }, + data() { + return { + title: "棰勬祴鎬х淮鎶ゆ柟妗�", + visible: false, + model: {}, + dataSource: [], + disableSubmit: false, + type: "radio", + params: "-1", + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + form: this.$form.createForm(this), + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鐗堟湰鐘舵��', + align: 'center', + dataIndex: 'statusName' + }, + { + title: '鐗堟湰', + align: 'center', + dataIndex: 'planVersion' + }, + + { + title: '鏂规缂栫爜', + align: 'center', + dataIndex: 'num' + }, + { + title: '鏂规鍚嶇О', + align: 'center', + dataIndex: 'name' + }, + { + title: '鐩戞帶绫诲瀷', + align: 'center', + dataIndex: 'monitorTypeName' + }, + { + title: '璁惧缂栫爜', + align: 'center', + dataIndex: 'deviceNum' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'deviceName' + }, + { + title: '璁惧鍨嬪彿', + align: 'center', + dataIndex: 'deviceModel' + }, + { + title: '缁翠繚鏂瑰紡', + align: 'center', + dataIndex: 'maintenanceMethodName' + }, + { + title: '娲惧伐鏂瑰紡', + align: 'center', + dataIndex: 'assignModeName' + }, + { + title: '璐d换鐝粍', + align: 'center', + dataIndex: 'teamName' + }, + { + title: '鍒涘缓浜�', + align: 'center', + dataIndex: 'createBy' + }, + { + title: '鍒涘缓鏃ユ湡', + align: 'center', + dataIndex: 'createTime' + }, + ], + url: { + list: '/eam/predictiveworkplan/pagePredictiveWorkPlan', + }, + } + }, + + + methods: { + + searchQuery() { + this.loadData(1); + }, + searchReset() { + this.queryParam = {}; + this.loadData(1) + }, + list() { + this.selectedRowKeys = []; + this.selectedRowRecord = []; + this.visible = true; + this.loadData(1); + }, + clickThenCheck(record) { + return { + on: { + click: (e) => { + this.selectedRowRecord = record; + this.onSelectChange(record.id.split(","), [record]); + } + } + }; + }, + onSelectChange(selectedRowKeys, selectedRows) { + this.selectedRowKeys = selectedRowKeys; + this.selectedRowRecord = selectedRows[0]; + }, + close() { + this.queryParam = {}; + this.$emit('close'); + this.visible = false; + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + this.queryParam.status = '1' + var params = this.getQueryParams() //鏌ヨ鏉′欢 + this.loading = true + getAction(this.url.list, params) + .then(res => { + if (res.success) { + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + 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 + }) + }, + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + if (that.selectedRowKeys.length > 0) { + if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") { + that.$emit('sendPlanRecord', { record: that.selectedRowRecord }); + that.close(); + } else { + that.$message.error("璇烽�夋嫨棰勬祴鎬х淮鎶ゆ柟妗堬紒") + } + } else { + that.$message.error("璇烽�夋嫨棰勬祴鎬х淮鎶ゆ柟妗堬紒") + } + }, + + handleCancel() { + this.close(); + }, + + }, +} +</script> +<style scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +.fontweight { + font-weight: bold; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +.ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; +} + +.anty-row-operator button { + margin: 0 5px; +} + +.ant-btn-danger { + background-color: #ffffff; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} + +.notshow { + display: none; +} + +.frozenRowClass { + color: #c9c9c9; +} +.hight { + color: #f5222d; +} +.middle { + color: #fa8c16; +} +.low { + color: #52c41a; +} +.dataUnKnow { + color: #1890ff; +} +.frozenRowClass { + color: #c9c9c9; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/predictiveWorkOrder/SafetyRequirement.vue b/src/views/eam/modules/predictiveWorkOrder/SafetyRequirement.vue new file mode 100644 index 0000000..fe9d0e2 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/SafetyRequirement.vue @@ -0,0 +1,210 @@ +<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> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + v-if="maintenanceStandardId !='' && isAdd " + >鏂板 + </a-button> + <div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + <span + slot="action" + slot-scope="text, record" + > + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + </div> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { getAction, deleteAction } from '@/api/manage' + import Tooltip from 'ant-design-vue/es/tooltip' + + export default { + name: 'MaintenanceStandardPlanningMaterial', + components: { + Tooltip, + }, + mixins: [JeecgListMixin], + props: { + maintenanceStandardId: { + type: String, + required: false + }, + isEdit: { + type: Boolean, + default: false + }, + isAdd: { + type: Boolean, + default: false + }, + isDel: { + type: Boolean, + default: false + } + }, + mounted() { + }, + watch: { + maintenanceStandardId: { + immediate: true, + handler(val) { + if (this.maintenanceStandardId) { + this.queryParam.maintenanceStandardId = val + this.queryParam.delFlag = 0 + this.loadData(1) + }else{ + this.clearList(); + } + } + }, + }, + data() { + return { + disableMixinCreated:true, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 100, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍗遍櫓婧愮紪鐮�', + align: 'center', + dataIndex: 'num', + width:200 + + }, + + { + title: '鍗遍櫓婧�', + align: 'center', + dataIndex: 'name', + width:200 + }, + { + title: '鍗遍櫓鎻忚堪', + align: 'center', + dataIndex: 'description', + width:200 + }, + { + title: '闃叉帶鎺柦', + align: 'center', + dataIndex: 'measure', + width:200 + }, + ], + url: { + list: '/eam/maintenanceStandardSafetyRequirement/getMaintenanceStandardSafetyRequirementList', + delete: '/eam/maintenanceStandardSafetyRequirement/delete' + } + } + }, + + methods: { + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鍗遍櫓闃叉帶' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.maintenanceStandardId = this.maintenanceStandardId + }, + + handleDelete: function(id) { + if (!this.url.delete) { + this.$message.error('璇疯缃畊rl.delete灞炴��!') + return + } + var that = this + deleteAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData() + that.alterFlag = new Date() + } else { + that.$message.warning(res.message) + } + }) + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + var params = this.getQueryParams()//鏌ヨ鏉′欢 + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) { + 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'; +</style> diff --git a/src/views/eam/modules/predictiveWorkOrder/WorkInstruction.vue b/src/views/eam/modules/predictiveWorkOrder/WorkInstruction.vue new file mode 100644 index 0000000..7a5889c --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/WorkInstruction.vue @@ -0,0 +1,373 @@ +<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> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + v-if="maintenanceStandardId !='' && isAdd " + >鏂板</a-button> + <div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + <span + slot="size" + slot-scope="text" + class="error" + > + {{sizeConvert(text)}} + </span> + <!-- <span + slot="action" + slot-scope="text, record" + > + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </span> --> + <span + slot="action" + slot-scope="text, record" + > + + <Tooltip + placement="top" + title="棰勮鍥剧墖" + > + <img + v-if="record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif')" + width="30" + height="14" + border="1" + draggable="false" + preview="1" + :preview-text="''" + :src="record.upload.src" + /> + </Tooltip> + + <a + v-if="record.upload.path && record.upload.format.toLowerCase()=='pdf'" + href="javascript:;" + @click="view(record)" + > + 棰勮 + </a> + + <a-divider + v-if="record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif'||record.upload.format.toLowerCase()=='pdf')" + type="vertical" + /> + + <a + href="javascript:;" + @click="handleDownload(record)" + >涓嬭浇</a> + + <a-divider type="vertical" /> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + + </span> + </a-table> + </div> + <pdf-view ref="pdfview"></pdf-view> + </a-card> +</template> + +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction, deleteAction, downFile } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' + +import JInput from '@/components/jeecg/JInput' +import JEllipsis from "@/components/jeecg/JEllipsis"; + +import { preview } from 'vue-photo-preview' +import { ACCESS_TOKEN } from '@/store/mutation-types' +import Vue from 'vue' +import PdfView from '@views/common/PdfView' +import { getFileAccessHttpUrl } from '@/api/manage'; +import store from '@/store/' + +export default { + name: "MaintenanceStandardWorkInstruction", + components: { + Tooltip, + JInput, + JEllipsis, + PdfView, + preview, + }, + mixins: [JeecgListMixin], + props: { + maintenanceStandardId: { + type: String, + required: false + }, + isEdit: { + type: Boolean, + default: false + }, + isAdd: { + type: Boolean, + default: false + }, + isDel: { + type: Boolean, + default: false + } + }, + mounted() { + }, + watch: { + maintenanceStandardId: { + immediate: true, + handler(val) { + if (this.maintenanceStandardId) { + this.queryParam.maintenanceStandardId = val + this.queryParam.delFlag = 0 + this.loadData(1) + }else{ + this.clearList(); + } + } + }, + }, + data() { + return { + disableMixinCreated:true, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 100, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '鏂囨。缂栫爜', + align: 'center', + dataIndex: 'num', + width:200 + }, + + { + title: '鏂囨。鍚嶇О', + align: 'center', + dataIndex: 'name', + width:200 + }, + { + title: '鏂囨。绫诲瀷', + align: 'center', + dataIndex: 'typeName', + width:200 + }, + { + title: '鏂囨。澶у皬', + align: 'center', + dataIndex: 'size', + scopedSlots: { customRender: 'size' }, + width:200 + }, + ], + url: { + list: "/eam/maintenanceStandardWorkInstruction/getMaintenanceStandardWorkInstructionList", + delete: "/eam/maintenanceStandardWorkInstruction/delete", + urlDownload: window._CONFIG['staticDomainURL'], + download: '/sys/upload/downloadFile', + }, + } + }, + + methods: { + handleAdd: function () { + this.$refs.modalForm.add(); + this.$refs.modalForm.title = "浣滀笟鎸囧涔�"; + this.$refs.modalForm.disableSubmit = false; + this.$refs.modalForm.maintenanceStandardId = this.maintenanceStandardId + }, + + handleDelete: function (id) { + if (!this.url.delete) { + this.$message.error("璇疯缃畊rl.delete灞炴��!") + return + } + var that = this; + deleteAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$message.success(res.message); + that.loadData(); + that.alterFlag = new Date(); + } else { + that.$message.warning(res.message); + } + }); + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + for (let i = 0; i < res.result.records.length; i++) { + let r = res.result.records[i].upload; + r.src = this.getSrc(res.result.records[i].upload); + } + this.dataSource = res.result.records || res.result; + if (res.result.total) { + this.ipagination.total = res.result.total; + } else { + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + + handleDownload(record) { + downFile(this.url.download, { id: record.upload.id }).then((res) => { + if (!res) { + this.$message.warning('鏂囦欢涓嬭浇澶辫触') + return + } else { + let fileName = record.name; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([res]), fileName); + } else { + let url = window.URL.createObjectURL(new Blob([res])); + let link = document.createElement('a'); + link.style.display = 'none'; + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click() + document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 + } + } + }) + }, + + //鎷艰src + 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) + } + }, + + + 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; + }, + + view(record) { + this.$refs.pdfview.showPdf(record.upload.src); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> diff --git a/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue new file mode 100644 index 0000000..871d3d3 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue @@ -0,0 +1,174 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </div> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { deleteAction } from '@/api/manage' + import Tooltip from 'ant-design-vue/es/tooltip' + + export default { + name: 'PredictiveParameters', + components: { + Tooltip, + }, + mixins: [JeecgListMixin], + props: { + planId: { + type: String, + default:'', + required: false + }, + equipmentId: { + type: String, + required: false + }, + isAdd: { + type: Boolean, + default: false + }, + isDel: { + type: Boolean, + default: false + } + }, + mounted() { + + }, + watch: { + planId:{ + immediate:true, + handler(val){ + if (this.planId) { + this.queryParam.planId = val + this.queryParam.delFlag = 0 + this.loadData(1) + } + } + } + }, + data() { + return { + disableMixinCreated: true, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏉′欢', + dataIndex: 'conditionalRelationName', + align: 'center', + width:200 + }, + { + title: '鍙傛暟浠g爜', + dataIndex: 'parameterCode', + align: 'center', + width:200 + }, + { + title: '鍙傛暟鍚嶇О', + dataIndex: 'parameterName', + align: 'center', + width:200 + }, + { + title: '鍙傛暟鍗曚綅', + dataIndex: 'unitName', + align: 'center', + width:200 + }, + { + title: '鍙傛暟涓婇檺', + dataIndex: 'upperLimitValue', + align: 'center', + width:200 + }, + { + title: '鍙傛暟涓嬮檺', + dataIndex: 'lowerLimitValue', + align: 'center', + width:200 + }, + ], + url: { + list: '/eam/predictiveworkplanparameter/pagePredictiveWorkPlanParameter', + delete: '/eam/predictiveworkplanparameter/delete' + } + } + }, + + methods: { + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鍙傛暟鎺у埗' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.planId = this.planId + this.$refs.modalForm.equipmentId = this.equipmentId + }, + + handleDelete: function(id) { + if (!this.url.delete) { + this.$message.error('璇疯缃畊rl.delete灞炴��!') + return + } + var that = this + deleteAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData() + that.alterFlag = new Date() + } else { + that.$message.warning(res.message) + } + }) + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> diff --git a/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveSpareParts.vue b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveSpareParts.vue new file mode 100644 index 0000000..e35a44a --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveSpareParts.vue @@ -0,0 +1,185 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </div> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { getAction, deleteAction } from '@/api/manage' + import Tooltip from 'ant-design-vue/es/tooltip' + + export default { + name: 'PredictiveSpareParts', + components: { + Tooltip, + }, + mixins: [JeecgListMixin], + props: { + planId: { + type: String, + required: false + }, + isEdit: { + type: Boolean, + default: false + }, + isAdd: { + type: Boolean, + default: false + }, + isDel: { + type: Boolean, + default: false + } + }, + mounted() { + + }, + watch: { + planId:{ + immediate:true, + handler(val){ + if (this.planId) { + this.queryParam.planId = val + this.queryParam.delFlag = 0 + this.loadData(1) + } + } + } + }, + data() { + return { + disableMixinCreated: true, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '澶囦欢缂栧彿', + dataIndex: 'sparePartNum', + align: 'center', + width:200 + }, + { + title: '澶囦欢鍚嶇О', + dataIndex: 'sparePartName', + align: 'center', + width:200 + }, + { + title: '澶囦欢瑙勬牸', + dataIndex: 'sparePartSpecification', + align: 'center', + width:200 + }, + { + title: '澶囦欢鍨嬪彿', + dataIndex: 'sparePartModel', + align: 'center', + width:200 + }, + { + title: '鍗曚綅', + dataIndex: 'mainUnitName', + align: 'center', + width:200 + }, + { + title: '閰嶅鏁伴噺', + dataIndex: 'supportingQuantity', + align: 'center', + width:200 + }, + { + title: '棰濆畾瀵垮懡/灏忔椂', + dataIndex: 'ratedLife', + align: 'center', + width:200 + }, + { + title: '瀵垮懡鎺у埗闄�', + dataIndex: 'lifeWarning', + align: 'center', + width:200 + }, + ], + url: { + list: '/eam/predictiveworkplansparepart/pagePredictiveWorkPlanSparePart', + delete: '/eam/predictiveworkplansparepart/delete' + } + } + }, + + methods: { + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '璁″垝鐢ㄦ枡' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.planId = this.planId + }, + + handleDelete: function(id) { + if (!this.url.delete) { + this.$message.error('璇疯缃畊rl.delete灞炴��!') + return + } + var that = this + deleteAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData() + that.alterFlag = new Date() + } else { + that.$message.warning(res.message) + } + }) + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> diff --git a/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue new file mode 100644 index 0000000..e41a7c2 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue @@ -0,0 +1,173 @@ +<template> + <a-card + :bordered="false" + :class="'cust-erp-sub-tab'" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + > + </a-table> + </div> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { deleteAction } from '@/api/manage' + import Tooltip from 'ant-design-vue/es/tooltip' + + export default { + name: 'PredictiveWarn', + components: { + Tooltip, + }, + mixins: [JeecgListMixin], + props: { + planId: { + type: String, + required: false + }, + equipmentId: { + type: String, + required: false + }, + isAdd: { + type: Boolean, + default: false + }, + isDel: { + type: Boolean, + default: false + } + }, + mounted() { + + }, + watch: { + planId:{ + immediate:true, + handler(val){ + if (this.planId) { + this.queryParam.planId = val + this.queryParam.delFlag = 0 + this.loadData(1) + } + } + } + }, + data() { + return { + disableMixinCreated: true, + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏉′欢', + dataIndex: 'conditionalRelationName', + align: 'center', + width:200 + }, + { + title: '鎶ヨ浠g爜', + dataIndex: 'warnCode', + align: 'center', + width:200 + }, + { + title: '鎶ヨ鍚嶇О', + dataIndex: 'warnName', + align: 'center', + width:200 + }, + { + title: '鎶ヨ鍛ㄦ湡', + dataIndex: 'warnCycle', + align: 'center', + width:200 + }, + { + title: '鎶ヨ鍛ㄦ湡鍗曚綅', + dataIndex: 'cycleUnitName', + align: 'center', + width:200 + }, + { + title: '鎶ヨ娆℃暟', + dataIndex: 'times', + align: 'center', + width:200 + }, + ], + url: { + list: '/eam/predictiveworkplanwarn/pagePredictiveWorkPlanWarn', + delete: '/eam/predictiveworkplanwarn/delete' + } + } + }, + + methods: { + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鎶ヨ鎺у埗' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.planId = this.planId + this.$refs.modalForm.equipmentId = this.equipmentId + }, + + handleDelete: function(id) { + if (!this.url.delete) { + this.$message.error('璇疯缃畊rl.delete灞炴��!') + return + } + var that = this + deleteAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData() + that.alterFlag = new Date() + } else { + that.$message.warning(res.message) + } + }) + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> diff --git a/src/views/eam/modules/predictiveWorkOrder/select/ActualHourUserSelect.vue b/src/views/eam/modules/predictiveWorkOrder/select/ActualHourUserSelect.vue new file mode 100644 index 0000000..235a536 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/select/ActualHourUserSelect.vue @@ -0,0 +1,315 @@ +<template> + <a-modal + :title="title" + :width="1250" + :visible="visible" + :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="鐝粍鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ョ彮缁勫悕绉版绱�" + v-model="queryParam.num" + ></a-input> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="浜哄憳缂栧彿"> + <a-input + placeholder="璇疯緭鍏ヤ汉鍛樼紪鍙锋绱�" + v-model="queryParam.username" + ></a-input> + </a-form-item> + </a-col> + + <a-col + :md="6" + :sm="8" + > + <a-form-item label="浜哄憳鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ヤ汉鍛樺悕绉版绱�" + v-model="queryParam.realname" + ></a-input> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + @click="searchReset" + icon="reload" + style="margin-left:8px;" + >閲嶇疆</a-button> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + + </a-col> + </a-row> + </a-form> + </div> + <div style="margin-top:8px;"> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange" + :customRow="clickThenCheck" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" + > + + </a-table> + </div> + </a-form> + </a-spin> + + </a-modal> +</template> + +<script> + +import { postAction, getAction } from '@/api/manage' +import JDate from '@/components/jeecg/JDate' +import Tooltip from 'ant-design-vue/es/tooltip' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JEllipsis from '@/components/jeecg/JEllipsis'//寮曞叆杩囬暱瑁佸壀 +import store from '@/store' + +export default { + name: "EquipmentList", + mixins: [JeecgListMixin], + components: { + JDate, + Tooltip, + JEllipsis, + }, + data() { + return { + title: "浜哄憳淇℃伅", + visible: false, + model: {}, + dataSource: [], + disableSubmit: false, + type: "radio", + params: "-1", + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + form: this.$form.createForm(this), + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鐝粍缂栫爜', + align: 'center', + dataIndex: 'teamName', + }, + { + title: '浜哄憳缂栧彿', + align: 'center', + dataIndex: 'username', + }, + { + title: '浜哄憳鍚嶇О', + align: 'center', + dataIndex: 'realname', + }, + ], + url: { + list: "/eam/inspectionOrder/findUserList", + }, + } + }, + + + methods: { + + searchQuery() { + this.loadData(1); + }, + searchReset() { + this.queryParam = { teamId: this.params }; + this.loadData(1) + }, + list(params) { + this.selectedRowKeys = []; + this.selectedRowRecord = []; + this.visible = true; + if (params == null || params == "") { + this.queryParam.teamId = "-1" + } else { + this.queryParam.teamId = params + } + this.loadData(1); + }, + clickThenCheck(record) { + return { + on: { + click: (e) => { + this.selectedRowRecord = record; + this.onSelectChange(record.id.split(","), [record]); + } + } + }; + }, + onSelectChange(selectedRowKeys, selectedRows) { + this.selectedRowKeys = selectedRowKeys; + this.selectedRowRecord = selectedRows[0]; + }, + close() { + this.queryParam = {}; + this.$emit('close'); + this.visible = false; + }, + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + if (that.selectedRowKeys.length > 0) { + if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") { + that.$emit('sendUserRecord', { record: that.selectedRowRecord }); + that.close(); + } else { + that.$message.error("璇烽�夋嫨浜哄憳锛�") + } + } else { + that.$message.error("璇烽�夋嫨浜哄憳锛�") + } + }, + + handleCancel() { + this.close(); + }, + + }, +} +</script> +<style scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +.fontweight { + font-weight: bold; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +.ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; +} + +.anty-row-operator button { + margin: 0 5px; +} + +.ant-btn-danger { + background-color: #ffffff; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} + +/deep/ .notshow { + display: none; +} + +.frozenRowClass { + color: #c9c9c9; +} +.hight { + color: #f5222d; +} +.middle { + color: #fa8c16; +} +.low { + color: #52c41a; +} +.dataUnKnow { + color: #1890ff; +} + +/deep/ .frozenRowClass { + color: #c9c9c9; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue b/src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue new file mode 100644 index 0000000..d5815d4 --- /dev/null +++ b/src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue @@ -0,0 +1,230 @@ +<template> + <a-modal + :title="title" + :width="1000" + :visible="visible" + :confirmLoading="confirmLoading" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="鐗╂枡缂栫爜"> + <j-input + placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" + v-model="queryParam.num" + ></j-input> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="鐗╂枡鍚嶇О"> + <j-input + placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" + v-model="queryParam.name" + ></j-input> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + @click="searchReset" + icon="reload" + style="margin-left:8px;" + >閲嶇疆</a-button> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + + </a-col> + </a-row> + </a-form> + </div> + <div style="margin-top:8px;"> + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}" + @change="handleTableChange" + :customRow="clickThenCheck" + > + </a-table> + </div> + </a-form> + </a-spin> + </a-modal> +</template> + +<script> +import pick from 'lodash.pick' +import { httpAction, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JInput from '@/components/jeecg/JInput' +export default { + name: "MaterialSelectTable", + mixins: [JeecgListMixin], + components: { + JInput + }, + data() { + return { + title: "鎿嶄綔", + visible: false, + model: {}, + confirmLoading: false, + form: this.$form.createForm(this), + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 50, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鐗╂枡缂栧彿', + align: 'center', + dataIndex: 'num', + sorter: true, + }, + { + title: '鐗╂枡鍚嶇О', + align: 'center', + dataIndex: 'name', + sorter: true, + }, + { + title: '鐗╂枡瑙勬牸', + align: 'center', + dataIndex: 'specification', + sorter: true, + }, + { + title: '鐗╂枡鍨嬪彿', + align: 'center', + dataIndex: 'model', + sorter: true, + }, + { + title: '鍗曚綅', + align: 'center', + dataIndex: 'unitId_dictText', + sorter: true, + }, + + ], + url: { + list: "/base/material/list", + }, + index: '', + } + }, + methods: { + + searchQuery() { + this.loadData(1); + }, + + list(index) { + this.visible = true; + this.index = index; + this.loadData(1); + }, + + clickThenCheck(record) { + return { + on: { + click: (e) => { + this.selectedRowRecord = record; + this.onSelectChange(record.id.split(","), [record]); + } + } + }; + }, + + onSelectChange(selectedRowKeys, selectedRows) { + this.selectedRowKeys = selectedRowKeys; + this.selectedRowRecord = selectedRows[0]; + }, + + close() { + this.queryParam = {}; + this.$emit('close'); + this.visible = false; + this.selectedRowKeys = []; + }, + + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + if (that.selectedRowKeys.length > 0) { + if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") { + that.$emit('sendMaterialRecord', { index: this.index, record: that.selectedRowRecord }); + that.close(); + } else { + that.$message.error("璇烽�夋嫨鐗╂枡锛�") + } + } else { + that.$message.error("璇烽�夋嫨鐗╂枡锛�") + } + }, + + handleCancel() { + this.close(); + }, + + } +} +</script> +<style> +@import '~@assets/less/common.less'; +.frozenRowClass { + color: #c9c9c9; +} + +.fontweight { + font-weight: bold; +} + +.fontweightfrozen { + font-weight: bold; + color: #c9c9c9; +} +.success { + color: green; +} +.error { + color: red; +} +</style> \ No newline at end of file -- Gitblit v1.9.3