¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | title="ä¸ä¸ä¿å
Ȍᴌ" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <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="ç¹æ£æ¹æ³åç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ç¹æ£æ¹æ³åç§°" |
| | | v-model="queryParam.name" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> --> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <span |
| | | style="float: left;overflow: hidden;" |
| | | class="table-page-search-submitButtons" |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | style="margin-left: 8px" |
| | | >éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | <a-button |
| | | v-if="selectedRowKeys.length > 0" |
| | | type="primary" |
| | | @click="batchAssign" |
| | | style="margin-left: 8px" |
| | | >工忴¾å·¥</a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div |
| | | class="ant-alert ant-alert-info" |
| | | style="margin-bottom: 16px;" |
| | | > |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a |
| | | style="margin-left: 24px" |
| | | @click="onClearSelected" |
| | | >æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{ x: 'calc(1900px + 50%)', y: 900 }" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange" |
| | | > |
| | | <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" --> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a-popconfirm |
| | | title="ç¡®å®ä¸åå·¥åå?" |
| | | @confirm="() => handleOrderIssue(record)" |
| | | > |
| | | <a v-if="record.status == '1'">ä¸å</a> |
| | | </a-popconfirm> |
| | | <a-divider |
| | | v-if="record.status == '1'" |
| | | type="vertical" |
| | | /> |
| | | <a-popconfirm |
| | | title="ç¡®å®æ¤åå·¥åå?" |
| | | @confirm="() => handleOrderReset(record)" |
| | | > |
| | | <a v-if="record.status == '2'">æ¤å</a> |
| | | </a-popconfirm> |
| | | <a-divider |
| | | v-if="record.status == '2'" |
| | | type="vertical" |
| | | /> |
| | | <a-popconfirm |
| | | title="ç¡®å®æ¢å¤å·¥åå?" |
| | | @confirm="() => handleOrderRecover(record)" |
| | | > |
| | | <a v-if="record.status == '7'">æ¢å¤</a> |
| | | </a-popconfirm> |
| | | <a-divider |
| | | v-if="record.status == '7'" |
| | | type="vertical" |
| | | /> |
| | | <a-popconfirm |
| | | title="ç¡®å®ä½åºå·¥åå?" |
| | | @confirm="() => handleOrderCancel(record)" |
| | | > |
| | | <a v-if="record.status == '2'">ä½åº</a> |
| | | </a-popconfirm> |
| | | <a-divider |
| | | v-if="record.status == '2'" |
| | | type="vertical" |
| | | /> |
| | | <a-popconfirm |
| | | title="ç¡®å®é¢åå·¥åå?" |
| | | @confirm="() => handleOrderGet(record)" |
| | | > |
| | | <a v-if="record.status == '2' && record.assignMode == '1'">é¢å</a> |
| | | </a-popconfirm> |
| | | <a |
| | | v-if="record.status == '2' && record.assignMode == '2' " |
| | | @click="handleAssignOrder(record)" |
| | | >派工</a> |
| | | <a |
| | | v-if="record.status == '2'&& record.assignMode == '3' && record.inspectionUserName != null " |
| | | @click="handleAssignOrder(record)" |
| | | >æ¹æ´¾</a> |
| | | <a |
| | | v-if="record.status == '3'" |
| | | @click="handleAssignOrder(record)" |
| | | >æ¹æ´¾</a> |
| | | <a-divider |
| | | v-if="record.status == '2'" |
| | | type="vertical" |
| | | /> |
| | | <a-divider |
| | | v-if="record.status === '3'" |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-if="record.status === '3' || record.status === '4' " |
| | | @click="handleOrderExe(record)" |
| | | >æ§è¡</a> |
| | | <a-divider |
| | | v-if="record.status === '3' || record.status === '4' " |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-if="record.status === '1'" |
| | | @click="handleEdit(record)" |
| | | >ç¼è¾</a> |
| | | <a-divider |
| | | v-if="record.status === '1'" |
| | | type="vertical" |
| | | /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a v-if="record.status === '1'">å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | <span |
| | | slot="num" |
| | | slot-scope="text, record" |
| | | > |
| | | <a |
| | | v-if="record.status === '3' || record.status === '4' ||record.status === '5' ||record.status === '7' " |
| | | class="lot" |
| | | @click="handleOrderExe(record)" |
| | | >{{record.num}}</a> |
| | | <span v-else>{{record.num}}</span> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <maintenance-order-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></maintenance-order-modal> |
| | | <inspection-order-assign-modal |
| | | ref="InspectionOrderAssignModal" |
| | | @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> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | 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' |
| | | |
| | | export default { |
| | | name: 'PredictiveWorkOrderList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | MaintenanceOrderModal, |
| | | InspectionOrderAssignModal, |
| | | SpecialyMaintenanceOrderExeDrawer, |
| | | SpecialtyMaintenanceOrderAssignModal, |
| | | SpecialtyInspectionOrderAssignModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: '颿µæ§ç»´æ¤å·¥å', |
| | | // 表头 |
| | | 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: 'num', |
| | | scopedSlots: { customRender: 'num' } |
| | | }, |
| | | { |
| | | title: 'çæ§ç±»å', |
| | | align: "center", |
| | | dataIndex: 'maintenanceMode' |
| | | }, |
| | | { |
| | | title: '设å¤ç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'departName', |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | align: "center", |
| | | dataIndex: 'maintenanceTypeName', |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | align: "center", |
| | | dataIndex: 'maintenanceCycleName', |
| | | }, |
| | | { |
| | | title: 'æ åç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'assignModeName', |
| | | }, |
| | | { |
| | | title: 'çæ¬', |
| | | align: "center", |
| | | dataIndex: 'specialtyMaintenancePlanNum', |
| | | }, |
| | | { |
| | | title: '使ç¨é¨é¨', |
| | | align: "center", |
| | | dataIndex: 'teamName', |
| | | }, |
| | | { |
| | | title: '派工æ¹å¼', |
| | | align: "center", |
| | | dataIndex: 'sumOfWorkingHourQuota', |
| | | }, |
| | | { |
| | | title: '责任çç»', |
| | | align: "center", |
| | | dataIndex: 'planStartTime', |
| | | width: 170 |
| | | |
| | | }, |
| | | { |
| | | title: '责任人', |
| | | align: "center", |
| | | dataIndex: 'planEndTime', |
| | | width: 170 |
| | | }, |
| | | { |
| | | title: 'å·¥æ¶å®é¢ï¼å°æ¶ï¼', |
| | | align: "center", |
| | | dataIndex: 'planEndTime', |
| | | width: 170 |
| | | }, |
| | | { |
| | | title: 'å®é
å·¥æ¶', |
| | | align: "center", |
| | | dataIndex: 'planEndTime', |
| | | width: 170 |
| | | }, |
| | | { |
| | | title: 'å®é
å¼å§æ¶é´', |
| | | align: "center", |
| | | dataIndex: 'actualStartTime', |
| | | width: 170 |
| | | }, |
| | | { |
| | | title: 'å®é
ç»ææ¶é´', |
| | | align: "center", |
| | | dataIndex: 'actualEndTime', |
| | | width: 170 |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | align: "center", |
| | | dataIndex: 'createBy' |
| | | }, |
| | | { |
| | | title: 'åå»ºæ¥æ', |
| | | align: "center", |
| | | dataIndex: 'createTime', |
| | | width: 170 |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 300, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/predictiveworkorder/pageOrderList", |
| | | delete: "/eam/specialtyMaintenanceOrder/delete", |
| | | deleteBatch: "/eam/specialtyMaintenanceOrder/deleteBatch", |
| | | exportXlsUrl: "/eam/specialtyMaintenanceOrder/exportXls", |
| | | importExcelUrl: "eam/specialtyMaintenanceOrder/importExcel", |
| | | edit: "/eam/specialtyMaintenanceOrder/editStatus", |
| | | orderGet: "/eam/specialtyMaintenanceOrder/orderGet", |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | computed: { |
| | | importExcelUrl: function () { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.onSelectChange(selectedRows); |
| | | }, |
| | | getCheckboxProps: record => ({ |
| | | props: { |
| | | disabled: record.distable |
| | | }, |
| | | }), |
| | | selectedRowKeys: this.selectedRowKeys, |
| | | }; |
| | | }, |
| | | }, |
| | | |
| | | 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) |
| | | if (record.status === '3') { |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true//ä¿åãæåãæ¥å·¥ |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true//æ¤éæé® |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = false//å¼å·¥æé® |
| | | } else if (record.status === '4') { |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = false |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true |
| | | } else if (record.status === '5') { |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = false |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true |
| | | } else if (record.status === '7') { |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true |
| | | this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true |
| | | } |
| | | }, |
| | | |
| | | handleOrderIssue(record) { |
| | | const that = this; |
| | | requestPut(that.url.edit, { id: record.id, status: '2' }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("å·¥åä¸åæåï¼") |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning("å·¥åä¸å失败ï¼") |
| | | } |
| | | }) |
| | | }, |
| | | //æ¤å |
| | | handleOrderReset(record) { |
| | | const that = this; |
| | | requestPut(that.url.edit, { id: record.id, status: '1' }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("工忤åæåï¼") |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning("工忤å失败ï¼") |
| | | } |
| | | }) |
| | | }, |
| | | handleOrderGet(record) { |
| | | const that = this; |
| | | requestPut(that.url.orderGet, { id: record.id, status: '1' }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("å·¥åé¢åæåï¼") |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning("å·¥åé¢å失败ï¼") |
| | | } |
| | | }) |
| | | }, |
| | | //ä½åº |
| | | handleOrderCancel(record) { |
| | | const that = this; |
| | | requestPut(that.url.edit, { id: record.id, status: '7' }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("å·¥åä½åºæåï¼") |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning("å·¥åä½åºå¤±è´¥ï¼") |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //æ¢å¤ |
| | | handleOrderRecover(record) { |
| | | const that = this; |
| | | requestPut(that.url.edit, { id: record.id, status: '2' }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("工忢夿åï¼") |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning("工忢å¤å¤±è´¥ï¼") |
| | | } |
| | | }) |
| | | }, |
| | | handleAssignOrder: function (record) { |
| | | this.$refs.SpecialtyMaintenanceOrderAssignModal.edit(record) |
| | | this.$refs.SpecialtyMaintenanceOrderAssignModal.title = 'å·¥åæ¹æ´¾' |
| | | this.$refs.SpecialtyMaintenanceOrderAssignModal.disableSubmit = false |
| | | }, |
| | | // modalFormOk() { |
| | | // alert(0) |
| | | // // æ°å¢/ä¿®æ¹ æåæ¶ï¼éè½½å表 |
| | | // this.loadData(); |
| | | // //æ¸
空å表éä¸ |
| | | // this.onClearSelected() |
| | | // }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | title="颿µæ§ç»´æ¤æ¹æ¡" |
| | | :bordered='false' |
| | | > |
| | | <div class='table-page-search-wrapper'> |
| | | <a-form |
| | | layout='inline' |
| | | @keyup.enter.native='searchQuery' |
| | | > |
| | | <a-row :gutter='24'> |
| | | <a-col |
| | | :xl='6' |
| | | :lg='7' |
| | | :md='8' |
| | | :sm='24' |
| | | > |
| | | <a-form-item label='æ¹æ¡ç¼ç '> |
| | | <a-input |
| | | placeholder='请è¾å
¥æ¹æ¡ç¼ç ' |
| | | v-model='queryParam.planNum' |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :xl='6' |
| | | :lg='7' |
| | | :md='8' |
| | | :sm='24' |
| | | > |
| | | <a-form-item label='设å¤åç§°'> |
| | | <a-input |
| | | placeholder='请è¾å
¥è®¾å¤åç§°' |
| | | v-model='queryParam.deviceName' |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="10" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="çæ¬ç¶æ"> |
| | | <a-radio-group |
| | | v-model="queryParam.versionStatus" |
| | | @change="onChange" |
| | | default-value="2" |
| | | > |
| | | <a-radio-button value="1"> |
| | | æªçæ |
| | | </a-radio-button> |
| | | <a-radio-button value="2"> |
| | | å·²çæ |
| | | </a-radio-button> |
| | | <a-radio-button value="3"> |
| | | 已失æ |
| | | </a-radio-button> |
| | | </a-radio-group> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <div class="table-operator"> |
| | | <a-button |
| | | @click='handleAdd' |
| | | type='primary' |
| | | icon='plus' |
| | | >æ°å¢ |
| | | </a-button> |
| | | <a-button |
| | | type='primary' |
| | | @click='searchQuery' |
| | | icon='search' |
| | | >æ¥è¯¢ |
| | | </a-button> |
| | | <a-button |
| | | type='primary' |
| | | @click='searchReset' |
| | | icon='reload' |
| | | style='margin-left: 8px' |
| | | >éç½® |
| | | </a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div |
| | | class='ant-alert ant-alert-info' |
| | | style='margin-bottom: 16px;' |
| | | > |
| | | <i class='anticon anticon-info-circle ant-alert-icon'></i> 已鿩 <a style='font-weight: 600'>{{ |
| | | selectedRowKeys.length }}</a>项 |
| | | <a |
| | | style='margin-left: 24px' |
| | | @click='onClearSelected' |
| | | >æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref='table' |
| | | size='middle' |
| | | bordered |
| | | rowKey='id' |
| | | :scroll="{ x: 'calc(1400px + 50%)', y: 900 }" |
| | | :columns='columns' |
| | | :dataSource='dataSource' |
| | | :pagination='ipagination' |
| | | :loading='loading' |
| | | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio' }" |
| | | :customRow='clickThenSelect' |
| | | @change='handleTableChange' |
| | | > |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a |
| | | v-if="record.status == '2'" |
| | | @click="handleRevise(record)" |
| | | >åç</a> |
| | | <a |
| | | v-if="record.status == '1'" |
| | | @click="handleTakeEffect(record)" |
| | | >çæ</a> |
| | | <a-divider type="vertical"/> |
| | | <a |
| | | v-if="record.status == '1'" |
| | | @click="handleEdit(record)" |
| | | >ç¼è¾</a> |
| | | <a-divider type="vertical"/> |
| | | <a-popconfirm |
| | | v-if="record.status == '1'" |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | </a-table> |
| | | <a-tabs |
| | | type="card" |
| | | defaultActiveKey="1" |
| | | > |
| | | <a-tab-pane |
| | | tab='è§¦åæ¡ä»¶' |
| | | key="1" forceRender |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <predictive-spare-parts :planId='planId' :isEdit="isEdit" :isAdd="isAdd" :isDel="isDel"/> |
| | | <!-- v-if="selectionRows[0].monitorType == 'smkz'"--> |
| | | <predictive-parameters :planId='planId' :equipmentId='equipmentId' :isEdit="isEdit" :isAdd="isAdd" |
| | | :isDel="isDel"/> |
| | | <!-- v-if="selectionRows[0].monitorType == 'cskz'" --> |
| | | <predictive-warn :planId='planId' :equipmentId='equipmentId' :isEdit="isEdit" :isAdd="isAdd" |
| | | :isDel="isDel"/> |
| | | <!-- v-if="selectionRows[0].monitorType == 'bjkz'"--> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane |
| | | tab='ç»´æ¤å
容' |
| | | key="2" forceRender |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <repair-order-detail-list :mainId='planId' :isEdit="isEdit" :isAdd="isAdd" :isDel="isDel"/> |
| | | </div> |
| | | </a-tab-pane> |
| | | <a-tab-pane |
| | | tab='计åç¨æ' |
| | | key="3" forceRender |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <maintenance-standard-planning-material :maintenanceStandardId='planId' :isEdit="isEdit" :isAdd="isAdd" |
| | | :isDel="isDel"/> |
| | | </div> |
| | | </a-tab-pane> |
| | | <a-tab-pane |
| | | tab='å±é©é²æ§' |
| | | key="4" forceRender |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <maintenance-standard-safety-requirement :maintenanceStandardId='planId' :isEdit="isEdit" :isAdd="isAdd" |
| | | :isDel="isDel"/> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane |
| | | tab='ä½ä¸æå¯¼ä¹¦' |
| | | key="5" forceRender |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <maintenance-standard-work-instruction :maintenanceStandardId='planId' :isEdit="isEdit" :isAdd="isAdd" |
| | | :isDel="isDel"/> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | </a-tabs> |
| | | </div> |
| | | |
| | | <predictive-work-plan-modal |
| | | ref='modalForm' |
| | | @ok='modalFormOk' |
| | | ></predictive-work-plan-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | import { requestPut } from '@/api/manage' |
| | | |
| | | import DailyMaintenanceStandardDetail from './modules/dailyMaintenanceStandard/DailyMaintenanceStandardDetail' |
| | | //计åç¨æ |
| | | import MaintenanceStandardPlanningMaterial from '@/views/eam/common/MaintenanceStandardPlanningMaterial' |
| | | //å±é©é²æ§ |
| | | import MaintenanceStandardSafetyRequirement from '@/views/eam/common/MaintenanceStandardSafetyRequirement' |
| | | //æ°å¢ç¼è¾ |
| | | import PredictiveWorkPlanModal from './modules/predictiveWorkPlan/PredictiveWorkPlanModal' |
| | | //åæ° |
| | | import PredictiveParameters from './modules/predictiveWorkPlan/PredictiveParameters' |
| | | //æ¥è¦ |
| | | import PredictiveWarn from './modules/predictiveWorkPlan/PredictiveWarn' |
| | | //å¤ä»¶ |
| | | import PredictiveSpareParts from './modules/predictiveWorkPlan/PredictiveSpareParts' |
| | | //ä½ä¸æå¯¼ä¹¦ |
| | | import MaintenanceStandardWorkInstruction from '@/views/eam/common/MaintenanceStandardWorkInstruction' |
| | | //ç»´æ¤å
容 |
| | | import RepairOrderDetailList from '@/views/eam/common/RepairOrderDetailList' |
| | | import '@/assets/less/TableExpand.less' |
| | | |
| | | export default { |
| | | name: 'PredictiveWorkPlanList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | DailyMaintenanceStandardDetail, |
| | | PredictiveWorkPlanModal, |
| | | MaintenanceStandardPlanningMaterial, |
| | | MaintenanceStandardSafetyRequirement, |
| | | MaintenanceStandardWorkInstruction, |
| | | PredictiveSpareParts, |
| | | PredictiveParameters, |
| | | PredictiveWarn, |
| | | RepairOrderDetailList |
| | | }, |
| | | data() { |
| | | return { |
| | | equipmentId: '', |
| | | 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: 'versionStatusName' |
| | | // }, |
| | | { |
| | | 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: '责任çç»', |
| | | align: 'center', |
| | | dataIndex: 'teamName' |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | align: 'center', |
| | | dataIndex: 'createBy' |
| | | }, |
| | | { |
| | | title: 'åå»ºæ¥æ', |
| | | align: 'center', |
| | | dataIndex: 'createTime' |
| | | }, |
| | | // { |
| | | // title: 'æ´æ°äºº', |
| | | // align: 'center', |
| | | // dataIndex: 'updateBy', |
| | | // }, |
| | | // { |
| | | // title: 'æ´æ°æ¥æ', |
| | | // align: 'center', |
| | | // dataIndex: 'updateTime', |
| | | // }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | scopedSlots: { customRender: 'action' }, |
| | | width: 200 |
| | | } |
| | | ], |
| | | monitorType: '', |
| | | planId: '', |
| | | isEdit: false, |
| | | isAdd: false, |
| | | isDel: false, |
| | | url: { |
| | | list: '/eam/predictiveworkplan/pagePredictiveWorkPlan', |
| | | delete: '/eam/maintenanceStandard/delete', |
| | | deleteBatch: '/eam/maintenanceStandard/deleteBatch', |
| | | versionTakeEffect: '/eam/maintenanceStandard/versionTakeEffect' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(','), [record]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.planId = '' |
| | | this.equipmentId = '' |
| | | this.isAdd = false |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectionRows = selectionRows |
| | | this.planId = this.selectedRowKeys[0] |
| | | this.equipmentId = selectionRows[0].equipment_id |
| | | this.isAdd = true |
| | | }, |
| | | |
| | | onChange(e) { |
| | | this.queryParam.status = e.target.value |
| | | this.loadData() |
| | | }, |
| | | |
| | | handleEdit: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | this.$refs.modalForm.isRevise = false |
| | | }, |
| | | handleAdd: function() { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = 'æ°å¢' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | this.$refs.modalForm.isRevise = false |
| | | }, |
| | | |
| | | //åç |
| | | handleRevise: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ä¿å
»æ åçæ¬å级' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | this.$refs.modalForm.isRevise = true |
| | | }, |
| | | |
| | | //çæ |
| | | handleTakeEffect(record) { |
| | | const that = this |
| | | that.confirmLoading = true |
| | | this.$confirm({ |
| | | title: 'æ¥å¸¸ä¿å
»æ åçæ¬çæï¼', |
| | | content: 'æç¤ºï¼çæ¬çæåä¸ä¸çæ¬å°èªå¨å¤±æï¼è¯·è°¨æ
æä½ï¼', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | requestPut(that.url.versionTakeEffect, { |
| | | id: record.id, |
| | | num: record.num, |
| | | versionStatus: '2' |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success('çæ¬çææåï¼') |
| | | that.loadData(1) |
| | | } else { |
| | | that.$message.warning('çæ¬çæå¤±è´¥ï¼') |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.loadData(1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | |
| | | .table-operator .ant-btn { |
| | | margin: 10px 8px 8px 10px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!--æ¯æå
¨å±ç¼©æ¾--> |
| | | <a-modal |
| | | :visible='visible' |
| | | :title='title' |
| | | switchFullscreen |
| | | @ok='handleSubmit' |
| | | @cancel='close' |
| | | style='top:50px' |
| | | cancelText='å
³é' |
| | | :width='1050' |
| | | > |
| | | <a-card :bordered='false'> |
| | | <div class='table-page-search-wrapper'> |
| | | <a-form |
| | | layout='inline' |
| | | @keyup.enter.native='searchQuery' |
| | | > |
| | | <a-row :gutter='24'> |
| | | <a-col |
| | | :md='8' |
| | | :sm='6' |
| | | > |
| | | <a-form-item label='å±é©æºç¼ç '> |
| | | <a-input |
| | | placeholder='请è¾å
¥å±é©æºç¼ç ' |
| | | v-model='queryParam.num' |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md='3'> |
| | | <span |
| | | style='float: left;overflow: hidden;' |
| | | class='table-page-search-submitButtons' |
| | | > |
| | | <a-button |
| | | type='primary' |
| | | @click='searchQuery' |
| | | icon='search' |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | @click='searchReset' |
| | | icon='reload' |
| | | style='margin-left: 10px' |
| | | >éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <a-table |
| | | ref='table' |
| | | :scroll='scrollTrigger' |
| | | size='middle' |
| | | rowKey='id' |
| | | bordered |
| | | :columns='columns' |
| | | :dataSource='dataSource' |
| | | :pagination='ipagination' |
| | | :rowSelection='rowSelection' |
| | | :loading='loading' |
| | | @change='handleTableChange' |
| | | > |
| | | |
| | | </a-table> |
| | | </a-card> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { filterObj } from '@/utils/util' |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'JSelectMaintenanceStandardSafetyRequirementModal', |
| | | mixins: [JeecgListMixin], |
| | | components: {}, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | queryParam: {}, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'å±é©æºç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'num' |
| | | }, |
| | | |
| | | { |
| | | title: 'å±é©æº', |
| | | align: 'center', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: 'å±é©æè¿°', |
| | | align: 'center', |
| | | dataIndex: 'description' |
| | | }, |
| | | { |
| | | title: '鲿§æªæ½', |
| | | align: 'center', |
| | | dataIndex: 'measure' |
| | | }, |
| | | ], |
| | | selectedRowKeys: [], |
| | | oldSelectRows: [], |
| | | scrollTrigger: {}, |
| | | dataSource: [], |
| | | selectionRows: [], |
| | | title: 'æ ¹æ®æ¥è¯¢ç»æéæ©å±é©é²æ§', |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['5', '10', '30', '50', '100'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isorter: { |
| | | column: 'num', |
| | | order: 'desc' |
| | | }, |
| | | visible: false, |
| | | loading: false, |
| | | url: { |
| | | list: '/eam/riskPrevention/list' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.onSelectChange(selectedRows) |
| | | }, |
| | | getCheckboxProps: record => ({ |
| | | props: { |
| | | disabled: record.distable |
| | | } |
| | | }), |
| | | selectedRowKeys: this.selectedRowKeys |
| | | } |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | async loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | let that = this |
| | | this.loading = true |
| | | let params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | await getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.records.length; i++) { |
| | | if (that.oldSelectRows.indexOf(res.result.records[i].id) > -1) { |
| | | res.result.records[i].distable = true |
| | | } else { |
| | | res.result.records[i].distable = false |
| | | } |
| | | } |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | showModals(oldSelectRows) { |
| | | this.oldSelectRows = oldSelectRows |
| | | this.visible = true |
| | | this.loadData(1) |
| | | }, |
| | | getQueryParams() { |
| | | let param = Object.assign({}, this.queryParam, this.isorter) |
| | | param.field = this.getQueryField() |
| | | param.pageNo = this.ipagination.current |
| | | param.pageSize = this.ipagination.pageSize |
| | | return filterObj(param) |
| | | }, |
| | | //æ¥è¯¢æ¡ä»¶å¤ç |
| | | getQueryField() { |
| | | let str = 'id,' |
| | | for (let a = 0; a < this.columns.length; a++) { |
| | | str += ',' + this.columns[a].dataIndex |
| | | } |
| | | return str |
| | | }, |
| | | searchReset(num) { |
| | | let that = this |
| | | this.queryParam = [] |
| | | if (num !== 0) { |
| | | that.loadData(1) |
| | | } |
| | | that.selectborrowIds = [] |
| | | }, |
| | | close() { |
| | | this.searchReset(0) |
| | | this.selectedRowKeys = [] |
| | | this.visible = false |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | //TODO çé |
| | | |
| | | if (Object.keys(sorter).length > 0) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc' |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | handleSubmit() { |
| | | this.$bus.$emit('selection2Rows', this.selectionRows) |
| | | this.searchReset(0) |
| | | this.close() |
| | | }, |
| | | onSelectChange(selectionRows) { |
| | | this.selectionRows = selectionRows |
| | | }, |
| | | searchQuery() { |
| | | this.loadData(1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | #components-layout-demo-custom-trigger .trigger { |
| | | font-size: 18px; |
| | | line-height: 64px; |
| | | padding: 0 24px; |
| | | cursor: pointer; |
| | | transition: color 0.3s; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | :class="'cust-erp-sub-tab'" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <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> |
| | | <maintenance-standard-planning-material-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | :mainId="maintenanceStandardId" |
| | | ></maintenance-standard-planning-material-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction, deleteAction } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import MaintenanceStandardPlanningMaterialModal from './MaintenanceStandardPlanningMaterialModal' |
| | | |
| | | export default { |
| | | name: 'MaintenanceStandardPlanningMaterial', |
| | | components: { |
| | | Tooltip, |
| | | MaintenanceStandardPlanningMaterialModal |
| | | }, |
| | | 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: function(val) { |
| | | this.clearList() |
| | | if (this.maintenanceStandardId) { |
| | | this.queryParam.maintenanceStandardId = 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: 'num', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | dataIndex: 'name', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶è§æ ¼', |
| | | dataIndex: 'specification', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åå·', |
| | | dataIndex: 'model', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'å¶é å', |
| | | dataIndex: 'constructorName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ°é', |
| | | dataIndex: 'quantity', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | dataIndex: 'unitName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 250, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | 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('请设置url.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('请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="900" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="å¤ä»¶ç¼å·" |
| | | > |
| | | <a-input-search |
| | | placeholder="è¯·éæ©å¤ä»¶" |
| | | enter-button |
| | | @search="onSearchSparePart()" |
| | | v-decorator="['sparePartNum',validatorRules.sparePartNum]" |
| | | :read-only="true" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2" > |
| | | <a-form-item label="å¤ä»¶åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['sparePartName', validatorRules.sparePartName]" placeholder="请è¾å
¥è®¾å¤åç§°" ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2" > |
| | | <a-form-item label="å¤ä»¶åå·" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['sparePartModel', validatorRules.sparePartModel]" placeholder="请è¾å
¥è®¾å¤åå·" ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2" > |
| | | <a-form-item label="å¤ä»¶è§æ ¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['sparePartSpecification', validatorRules.sparePartSpecification]" placeholder="请è¾å
¥è®¾å¤è§æ ¼" ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2" > |
| | | <a-form-item label="å¶é å" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['constructorName', validatorRules.constructorName]" placeholder="请è¾å
¥å¶é å" ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2" > |
| | | <a-form-item label="åä½" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['mainUnitName', validatorRules.mainUnitName]" placeholder="请è¾å
¥åä½" ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="æ°é" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥æ°é" |
| | | v-decorator="['quantity', validatorRules.quantity]" |
| | | /> |
| | | </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 |
| | | :disabled="disableSubmit || confirmLoading" |
| | | :loading="confirmLoading" |
| | | @click="handleOk" |
| | | type="primary" |
| | | >ç¡®å®</a-button> |
| | | </template> |
| | | |
| | | <plan-spare-part-select |
| | | ref="planSparePartSelect" |
| | | @sendSparePartRecord='sendSparePartRecord' |
| | | ></plan-spare-part-select> |
| | | |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import { postAction, requestPut } from '@/api/manage' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import PlanSparePartSelect from './PlanSparePartSelect.vue' |
| | | |
| | | |
| | | export default { |
| | | name: 'MaintenanceStandardPlanningMaterialModal', |
| | | components: { |
| | | PlanSparePartSelect |
| | | }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | required:false, |
| | | default:'' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | codeDisable: true, |
| | | disableSubmit: false, |
| | | maintenanceStandardId: '', |
| | | sparePartId: '', |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | sparePartName: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©å¤ä»¶!' }, |
| | | ] |
| | | }, |
| | | quantity: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥æ°é!' }, |
| | | ] |
| | | } |
| | | }, |
| | | url: { |
| | | add: "/eam/maintenanceStandardPlanningMaterial/add", |
| | | edit: "/eam/maintenanceStandardPlanningMaterial/edit" |
| | | }, |
| | | //æ°å¢ãç¼è¾ãå é¤ãæ¹éå 餿使¹åæ°æ®åå·æ°å
³èçç»ä»¶ççå¬å±æ§ |
| | | alterFlag: "", |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | |
| | | add() { |
| | | this.edit({}); |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.disableSubmit = false; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, |
| | | 'sparePartNum', |
| | | 'sparePartName', |
| | | 'sparePartModel', |
| | | 'sparePartSpecification', |
| | | 'mainUnitName', |
| | | 'constructorName', |
| | | 'quantity')); |
| | | }); |
| | | if (record.id) { |
| | | this.codeDisable = true; |
| | | } else { |
| | | this.codeDisable = false; |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | |
| | | //ä¿åå¹¶æ°å¢æé®è§¦å |
| | | |
| | | |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let formData = Object.assign(this.model, values); |
| | | formData.maintenanceStandardId = this.mainId; |
| | | formData.sparePartId = this.sparePartId |
| | | 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'); |
| | | that.alterFlag = new Date(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onSearchSparePart() { |
| | | this.$refs.planSparePartSelect.list(); |
| | | this.$refs.planSparePartSelect.title = "éæ©å¤ä»¶"; |
| | | }, |
| | | sendSparePartRecord(data) { |
| | | let record = data.record; |
| | | this.sparePartId = record.id; |
| | | this.form.setFieldsValue({ sparePartId : record.id,sparePartNum: record.num,sparePartName: record.name,sparePartModel: record.model, |
| | | sparePartSpecification: record.specification,mainUnitId:record.mainUnitId,mainUnitName: record.mainUnitId_dictText,constructorName:record.constructorId_dictText }); |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <maintenance-standard-safety-requirement-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></maintenance-standard-safety-requirement-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction, deleteAction } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import MaintenanceStandardSafetyRequirementModal from './MaintenanceStandardSafetyRequirementModal' |
| | | |
| | | export default { |
| | | name: 'MaintenanceStandardPlanningMaterial', |
| | | components: { |
| | | Tooltip, |
| | | MaintenanceStandardSafetyRequirementModal |
| | | }, |
| | | 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: function(val) { |
| | | this.clearList() |
| | | if (this.maintenanceStandardId) { |
| | | this.queryParam.maintenanceStandardId = val |
| | | this.queryParam.delFlag = 0 |
| | | this.loadData(1) |
| | | } |
| | | } |
| | | }, |
| | | 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' |
| | | }, |
| | | |
| | | { |
| | | title: 'å±é©æº', |
| | | align: 'center', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: 'å±é©æè¿°', |
| | | align: 'center', |
| | | dataIndex: 'description' |
| | | }, |
| | | { |
| | | title: '鲿§æªæ½', |
| | | align: 'center', |
| | | dataIndex: 'measure' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action' |
| | | } |
| | | } |
| | | ], |
| | | 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('请设置url.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('请设置url.list屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="1050" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | |
| | | <a-button |
| | | type="primary" |
| | | :style="{ marginRight: '8px',marginBottom:'8px' }" |
| | | :loading="confirmLoading" |
| | | @click="selectSafetyRequirement()" |
| | | >å±é©é²æ§</a-button> |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey='id' |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | > |
| | | |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record, index" |
| | | > |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(text,record, index)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | |
| | | <template slot="footer"> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleCancel" |
| | | > |
| | | å
³é |
| | | </a-button> |
| | | <a-button |
| | | :disabled="disableSubmit || confirmLoading" |
| | | :loading="confirmLoading" |
| | | @click="handleOk" |
| | | type="primary" |
| | | >ç¡®å®</a-button> |
| | | </template> |
| | | <j-select-maintenance-standard-safety-requirement-modal ref="maintenanceStandardSafetyRequirementModalForm"></j-select-maintenance-standard-safety-requirement-modal> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import { postAction, requestPut } from '@/api/manage' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import JSelectMaintenanceStandardSafetyRequirementModal from './JSelectMaintenanceStandardSafetyRequirementModal' |
| | | |
| | | export default { |
| | | name: 'MaintenanceStandardSafetyRequirementModal', |
| | | components: { |
| | | JSelectMaintenanceStandardSafetyRequirementModal |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | codeDisable: true, |
| | | disableSubmit: false, |
| | | maintenanceStandardId: '', |
| | | dataSource: [], |
| | | model: {}, |
| | | 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 |
| | | }, |
| | | width: 50, |
| | | }, |
| | | { |
| | | title: 'å±é©æºç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'num' |
| | | }, |
| | | |
| | | { |
| | | title: 'å±é©æº', |
| | | align: 'center', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: 'å±é©æè¿°', |
| | | align: 'center', |
| | | dataIndex: 'description' |
| | | }, |
| | | { |
| | | title: '鲿§æªæ½', |
| | | align: 'center', |
| | | dataIndex: 'measure' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action' |
| | | }, |
| | | } |
| | | ], |
| | | url: { |
| | | add: "/eam/maintenanceStandardSafetyRequirement/add", |
| | | edit: "/eam/maintenanceStandardSafetyRequirement/edit" |
| | | }, |
| | | //æ°å¢ãç¼è¾ãå é¤ãæ¹éå 餿使¹åæ°æ®åå·æ°å
³èçç»ä»¶ççå¬å±æ§ |
| | | alterFlag: "", |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | |
| | | mounted() { |
| | | this.$bus.$on('selection2Rows', (data) => { |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | id: data[i].id, |
| | | num: data[i].num, |
| | | name: data[i].name, |
| | | description: data[i].description, |
| | | measure: data[i].measure, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | |
| | | add() { |
| | | this.dataSource = []; |
| | | this.edit({}); |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.disableSubmit = false; |
| | | if (record.id) { |
| | | this.codeDisable = true; |
| | | } else { |
| | | this.codeDisable = false; |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | |
| | | //ä¿åå¹¶æ°å¢æé®è§¦å |
| | | |
| | | |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let formData = Object.assign(this.model, values); |
| | | formData.maintenanceStandardId = this.maintenanceStandardId; |
| | | formData.riskPreventionList = this.dataSource; |
| | | 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'); |
| | | that.alterFlag = new Date(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | handleDelete(text, record, index) { |
| | | this.dataSource.splice(index, 1); |
| | | }, |
| | | |
| | | selectSafetyRequirement: function () { |
| | | let ids = []; |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].id); |
| | | } |
| | | this.$refs.maintenanceStandardSafetyRequirementModalForm.showModals(ids); |
| | | this.$refs.maintenanceStandardSafetyRequirementModalForm.title = 'éæ©å±é©é²æ§'; |
| | | this.$refs.maintenanceStandardSafetyRequirementModalForm.disableSubmit = false; |
| | | }, |
| | | |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <maintenance-standard-work-instruction-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></maintenance-standard-work-instruction-modal> |
| | | </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 MaintenanceStandardWorkInstructionModal from './MaintenanceStandardWorkInstructionModal' |
| | | |
| | | 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, |
| | | MaintenanceStandardWorkInstructionModal, |
| | | 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: function(val) { |
| | | this.clearList() |
| | | if (this.maintenanceStandardId) { |
| | | this.queryParam.maintenanceStandardId = val |
| | | this.queryParam.delFlag = 0 |
| | | this.loadData(1) |
| | | } |
| | | } |
| | | }, |
| | | 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' |
| | | }, |
| | | |
| | | { |
| | | title: 'ææ¡£åç§°', |
| | | align: 'center', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: 'ææ¡£ç±»å', |
| | | align: 'center', |
| | | dataIndex: 'typeName' |
| | | }, |
| | | { |
| | | title: 'ææ¡£å¤§å°', |
| | | align: 'center', |
| | | dataIndex: 'size', |
| | | scopedSlots: { customRender: 'size' }, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | dataIndex: 'action', |
| | | scopedSlots: { |
| | | customRender: 'action' |
| | | }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/maintenanceStandardWorkInstruction/getMaintenanceStandardWorkInstructionList", |
| | | 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("请设置url.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("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.records.length; i++) { |
| | | let r = res.result.records[i].upload; |
| | | r.src = this.getSrc(res.result.records[i].upload); |
| | | } |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | handleDownload(record) { |
| | | downFile(this.url.download, { id: record.upload.id }).then((res) => { |
| | | if (!res) { |
| | | this.$message.warning('æä»¶ä¸è½½å¤±è´¥') |
| | | return |
| | | } else { |
| | | let fileName = record.name; |
| | | if (typeof window.navigator.msSaveBlob !== 'undefined') { |
| | | window.navigator.msSaveBlob(new Blob([res]), fileName); |
| | | } else { |
| | | let url = window.URL.createObjectURL(new Blob([res])); |
| | | let link = document.createElement('a'); |
| | | link.style.display = 'none'; |
| | | link.href = url; |
| | | link.setAttribute('download', fileName); |
| | | document.body.appendChild(link); |
| | | link.click() |
| | | document.body.removeChild(link) //ä¸è½½å®æç§»é¤å
ç´ |
| | | window.URL.revokeObjectURL(url) //éæ¾æblob对象 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //æ¼è£
src |
| | | getSrc(record) { |
| | | |
| | | if (!record.path) { |
| | | return ''; |
| | | } |
| | | //æ¬å°ï¼local\Minioï¼minio\é¿éäºï¼alioss |
| | | if (record.uploadType == 'local') { |
| | | |
| | | let ssoLoginFlag = Vue.ls.get("ssoLoginFlag"); |
| | | let deployMode = Vue.ls.get("deployMode"); |
| | | |
| | | if (ssoLoginFlag && deployMode == "container") { |
| | | var baseProject = Vue.ls.get("baseProject"); |
| | | console.log("baseProject==>" + baseProject) |
| | | |
| | | var hostname = window.location.protocol + "//" + window.location.host; |
| | | var url = hostname + '/' + baseProject + '/sys/common/static'; |
| | | return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer']) |
| | | } else { |
| | | //æ ¹æ®åå¸ç¶æä¿®æ¹https æ http |
| | | return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer']) |
| | | } |
| | | |
| | | } else if (record.uploadType == 'alioss') { |
| | | |
| | | const OSS = require('ali-oss') |
| | | const client = new OSS({ |
| | | // region以æå·ä¸ºä¾ï¼oss-cn-hangzhouï¼ï¼å
¶ä»regionæå®é
æ
åµå¡«åã |
| | | region: window._CONFIG['region'], |
| | | // é¿éäºä¸»è´¦å·AccessKeyæ¥æææAPIçè®¿é®æéï¼é£é©å¾é«ã强ç建议æ¨å建并使ç¨RAMè´¦å·è¿è¡APIè®¿é®ææ¥å¸¸è¿ç»´ï¼è¯·ç»å½RAMæ§å¶å°å建RAMè´¦å·ã |
| | | accessKeyId: window._CONFIG['accessKeyId'], |
| | | accessKeySecret: window._CONFIG['accessKeySecret'], |
| | | bucket: window._CONFIG['bucket'], |
| | | }) |
| | | // object-key表示ä»OSSä¸è½½æä»¶æ¶éè¦æå®å
嫿件åç¼å¨å
ç宿´è·¯å¾ï¼ä¾å¦abc/efg/123.jpgã |
| | | return client.signatureUrl(record.path) |
| | | } |
| | | }, |
| | | |
| | | |
| | | sizeConvert(limit) { |
| | | var size = ""; |
| | | if (limit < 0.1 * 1024) { |
| | | size = parseFloat(limit).toFixed(2) + "B";//å°äº0.1KBï¼å转åæB |
| | | } else if (limit < 0.1 * 1024 * 1024) { |
| | | size = (parseFloat(limit) / 1024).toFixed(2) + "KB";//å°äº0.1MBï¼å转åæKB |
| | | } else if (limit < 0.1 * 1024 * 1024 * 1024) { |
| | | size = (parseFloat(limit) / (1024 * 1024)).toFixed(2) + "MB";//å°äº0.1GBï¼å转åæMB |
| | | } else { |
| | | size = (parseFloat(limit) / (1024 * 1024 * 1024)).toFixed(2) + "GB";//å
¶ä»è½¬åæGB |
| | | } |
| | | var sizeStr = size + "";//转æå符串 |
| | | var index = sizeStr.indexOf(".");//è·åå°æ°ç¹å¤çç´¢å¼ |
| | | var dou = sizeStr.substr(index + 1, 2);//è·åå°æ°ç¹å两ä½çå¼ |
| | | if (dou == "00") {//夿å䏤使¯å¦ä¸º00ï¼å¦ææ¯åå é¤00 |
| | | return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2); |
| | | } |
| | | return size; |
| | | }, |
| | | |
| | | view(record) { |
| | | this.$refs.pdfview.showPdf(record.upload.src); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="850" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="ææ¡£ç¼ç " |
| | | > |
| | | <a-input |
| | | :disabled="disableSubmit" |
| | | placeholder="请è¾å
¥ææ¡£ç¼ç " |
| | | v-decorator="['num', validatorRules.num ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="æä»¶ç±»å" |
| | | > |
| | | <a-radio-group |
| | | v-for="(item,index) in fileTypes" |
| | | :key="index" |
| | | button-style="solid" |
| | | v-decorator="['fileType', validatorRules.fileType ]" |
| | | :disabled="disableSubmit" |
| | | > |
| | | |
| | | <a-radio-button :value="item.value"> |
| | | {{item.text}} |
| | | </a-radio-button> |
| | | </a-radio-group> |
| | | |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æä»¶ä¸ä¼ " |
| | | > |
| | | <a-upload-dragger |
| | | name="file" |
| | | :customRequest="customRequest" |
| | | @change="handleChange" |
| | | :file-list="fileList" |
| | | :multiple="false" |
| | | > |
| | | <p class="ant-upload-drag-icon"> |
| | | <a-icon type="inbox" /> |
| | | </p> |
| | | <p class="ant-upload-text"> |
| | | ç¹å»ä¸ä¼ æææ½æä»¶è³è¯¥åºåè¿è¡ä¸ä¼ |
| | | </p> |
| | | <p class="ant-upload-hint"> |
| | | ä»
æ¯æåæä»¶ä¸ä¼ |
| | | </p> |
| | | </a-upload-dragger> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æä»¶åç§°" |
| | | > |
| | | <a-input |
| | | :disabled="true " |
| | | placeholder="请è¾å
¥æä»¶åç§°" |
| | | v-decorator="['name', validatorRules.name ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | label="æä»¶æè¿°" |
| | | > |
| | | <a-textarea |
| | | :disabled="disableSubmit" |
| | | placeholder="请è¾å
¥æä»¶æè¿°" |
| | | allow-clear |
| | | v-decorator="['description', validatorRules.description]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, postAction, postFileAction } from '@/api/manage' |
| | | import Vue from 'vue' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import JEllipsis from "@/components/jeecg/JEllipsis"; |
| | | import { ajaxGetDictItems } from '@/api/api' |
| | | import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" |
| | | |
| | | export default { |
| | | name: "UploadModel", |
| | | components: { |
| | | JInput, |
| | | Tooltip, |
| | | JEllipsis, |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | headers: {}, |
| | | validatorRules: { |
| | | num: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥ç¼ç ï¼' }, |
| | | { min: 0, max: 150, message: 'æé¿ 30 个å符', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | fileType: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥éæ©ç±»åï¼' }, |
| | | ] |
| | | }, |
| | | name: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥åç§°ï¼' }, |
| | | ] |
| | | }, |
| | | }, |
| | | url: { |
| | | add: "/eam/maintenanceStandardWorkInstruction/add", |
| | | edit: "/eam/maintenanceStandardWorkInstruction/edit", |
| | | listByBusIdAndBusType: "/system/sysUploadRela/listByBusIdAndBusType", |
| | | }, |
| | | //ç¨äºå±ç¤ºæä»¶ |
| | | fileList: [], |
| | | fileObject: {}, |
| | | fileTypes: [], |
| | | //ç¨äºå¤æéä»¶çç¶æ addï¼æ°å¢é¡µé¢çéä»¶ editï¼ç¼è¾é¡µé¢çé件为被修æ¹i editUpdateï¼ç¼è¾é¡µé¢çéä»¶è¢«ä¿®æ¹ |
| | | isFileChange: false, |
| | | uploadId: '', |
| | | maintenanceStandardId: '', |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | customRequest(val) { |
| | | if (this.fileList.length == 0) { |
| | | this.fileObject = val; |
| | | } |
| | | }, |
| | | |
| | | handleChange(info) { |
| | | //é»è®¤ç»éä»¶ç¶æï¼ä»
æ§å¶æ ·å¼ |
| | | let file = info.file; |
| | | //æä»¶æ´æ¹ï¼æ è®°æ´æ° |
| | | if (this.model.id) { |
| | | this.isFileChange = true; |
| | | } |
| | | //å é¤ |
| | | if (file.status == "removed") { |
| | | this.fileList = []; |
| | | this.fileObject.file = {}; |
| | | this.form.setFieldsValue({ name: '' }); |
| | | return false; |
| | | } |
| | | //åæä»¶æ§å¶ |
| | | if (this.fileList.length > 0) { |
| | | this.$message.warning("å½åä»
å
许ä¸ä¼ ä¸ä¸ªæä»¶ï¼"); |
| | | return false; |
| | | } |
| | | file.status = 'done'; |
| | | //页é¢å±ç¤ºä¸ä¼ æä»¶ |
| | | this.fileList.push(file); |
| | | this.form.setFieldsValue({ name: file.name }); |
| | | }, |
| | | |
| | | add() { |
| | | this.edit({}) |
| | | }, |
| | | |
| | | edit(record) { |
| | | let that = this; |
| | | that.visible = true; |
| | | that.isFileChange = false; |
| | | that.model = Object.assign({}, record); |
| | | that.fileList = []; |
| | | that.form.resetFields(); |
| | | that.uploadId = '' |
| | | if (record.isNoPhotoFlag) { |
| | | //è·åå½åæä»¶å¯¹åºéä»¶ |
| | | getAction(that.url.listByBusIdAndBusType, { busId: record.id, busType: 'maintenance_standard_work_instruction' }).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | that.fileList.push({ |
| | | uid: res.result[i].upload.id, |
| | | name: res.result[i].upload.name, |
| | | status: "done", |
| | | }) |
| | | that.$nextTick(() => { |
| | | that.form.setFieldsValue({ name: res.result[i].upload.name }); |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | that.form.validateFields((err, values) => { |
| | | if (JSON.stringify(that.fileObject.file) == '{}' && that.uploadId == '' && that.fileList.length == 0) { |
| | | that.$message.warning("请ä¸ä¼ æä»¶"); |
| | | return false |
| | | } |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!that.model.id) { |
| | | httpurl += that.url.add; |
| | | method = 'post'; |
| | | } else { |
| | | httpurl += that.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(that.model, values); |
| | | |
| | | formData.type = "maintenance_standard_work_instruction"; |
| | | formData.uploadId = that.uploadId; |
| | | // formData.fileType = "7";//æä»¶ç±»å 7ï¼å¾ç |
| | | formData.maintenanceStandardId = this.maintenanceStandardId; |
| | | var saveDate = new FormData(); |
| | | |
| | | formData.isFileChange = that.isFileChange; |
| | | |
| | | saveDate.append("file", that.fileObject.file); |
| | | saveDate.append('data', JSON.stringify(formData)); |
| | | |
| | | postFileAction(httpurl, saveDate, this.headers).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | }).catch((e) => { }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close(); |
| | | }, |
| | | initFileTypes() { |
| | | ajaxGetDictItems("common_upload_type", null).then((res) => { |
| | | if (res.success) { |
| | | this.fileTypes = res.result; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | }, |
| | | |
| | | created() { |
| | | this.initFileTypes(); |
| | | const token = Vue.ls.get(ACCESS_TOKEN); |
| | | const tenantid = Vue.ls.get(TENANT_ID) |
| | | this.headers = { |
| | | 'Content-Type': 'multipart/form-data', |
| | | "X-Access-Token": token, |
| | | 'X-Access-Tenant': tenantid |
| | | }; |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | export default { |
| | | name: "PlanSparePartSelectTable", |
| | | 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: 'constructorId_dictText', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align: 'center', |
| | | dataIndex: 'mainUnitId_dictText', |
| | | sorter: true, |
| | | }, |
| | | |
| | | ], |
| | | url: { |
| | | list: "/spare/sparePart/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('sendSparePartRecord', { 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | |
| | | <repairOrderDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></repairOrderDetail-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import RepairOrderDetailModal from './RepairOrderDetailModal' |
| | | export default { |
| | | name: "RepairOrderDetailList", |
| | | mixins:[JeecgListMixin], |
| | | components: { RepairOrderDetailModal }, |
| | | 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' |
| | | }, |
| | | { |
| | | title:'示æå¾', |
| | | align:"center", |
| | | scopedSlots: {customRender: 'imgSlot'}, |
| | | dataIndex: 'sketchMap' |
| | | }, |
| | | // { |
| | | // title:'维修项ç®', |
| | | // align:"center", |
| | | // dataIndex: 'maintenanceItem' |
| | | // }, |
| | | { |
| | | title:'ç»´ä¿®è¦æ±', |
| | | align:"center", |
| | | dataIndex: 'maintenanceRequire' |
| | | }, |
| | | { |
| | | title:'æ¹æ³', |
| | | align:"center", |
| | | dataIndex: 'maintenanceWay' |
| | | }, |
| | | { |
| | | title:'å·¥å
·', |
| | | align:"center", |
| | | dataIndex: 'maintenanceTooling' |
| | | }, |
| | | { |
| | | title:'å®å
¨è¦æ±', |
| | | align:"center", |
| | | dataIndex: 'safetyRequirement' |
| | | }, |
| | | // { |
| | | // title:'ç»´ä¿®å¨æ', |
| | | // align:"center", |
| | | // dataIndex: 'repairCycle' |
| | | // }, |
| | | { |
| | | title:'å·¥æ¶å®é¢', |
| | | align:"center", |
| | | dataIndex: 'timeQuota' |
| | | }, |
| | | { |
| | | title:'ç»´ä¿ä¸ä¸', |
| | | align:"center", |
| | | dataIndex: 'mamaintenanceSpecialtyId_dictText' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model |
| | | ref="form" |
| | | :model="model" |
| | | :rules="validatorRules" |
| | | > |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="é¨ä½" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="location" |
| | | > |
| | | <a-input |
| | | v-model="model.location" |
| | | placeholder="请è¾å
¥é¨ä½" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="示æå¾" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="sketchMap" |
| | | > |
| | | <j-image-upload |
| | | :isMultiple="false" |
| | | v-model="model.sketchMap" |
| | | ></j-image-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <!-- <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="维修项ç®" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="maintenanceItem" |
| | | > |
| | | <a-input |
| | | v-model="model.maintenanceItem" |
| | | placeholder="请è¾å
¥ç»´ä¿®é¡¹ç®" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> --> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="ç»´ä¿®è¦æ±" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="maintenanceRequire" |
| | | > |
| | | <a-input |
| | | v-model="model.maintenanceRequire" |
| | | placeholder="请è¾å
¥ç»´ä¿®è¦æ±" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="æ¹æ³" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="maintenanceWay" |
| | | > |
| | | <a-input |
| | | v-model="model.maintenanceWay" |
| | | placeholder="请è¾å
¥ç»´ä¿®æ¹æ³" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="å·¥å
·" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="maintenanceTooling" |
| | | > |
| | | <a-input |
| | | v-model="model.maintenanceTooling" |
| | | placeholder="请è¾å
¥ç»´ä¿®å·¥å
·" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="å®å
¨è¦æ±" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="safetyRequirement" |
| | | > |
| | | <a-input |
| | | v-model="model.safetyRequirement" |
| | | placeholder="请è¾å
¥å®å
¨è¦æ±" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <!-- <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="ç»´ä¿®å¨æ" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="repairCycle" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | v-model="model.repairCycle" |
| | | placeholder="请è¾å
¥ç»´ä¿®å¨æ" |
| | | :min="0" |
| | | :max="99999" |
| | | ></a-input-number> |
| | | </a-form-model-item> |
| | | </a-col> --> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="å·¥æ¶å®é¢" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="timeQuota" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | v-model="model.timeQuota" |
| | | placeholder="请è¾å
¥å·¥æ¶å®é¢" |
| | | :min="0" |
| | | :max="99999" |
| | | ></a-input-number> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="ç»´ä¿ä¸ä¸" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="mamaintenanceSpecialtyId" |
| | | > |
| | | <j-dict-select-tag |
| | | placeholder="è¯·éæ©ç»´ä¿ä¸ä¸" |
| | | :triggerChange="true" |
| | | dictCode="mom_eam_maintenance_specialty,name,id,del_flag!='1'" |
| | | v-model="model.mamaintenanceSpecialtyId" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: "RepairOrderDetailModal", |
| | | components: { |
| | | }, |
| | | props: { |
| | | mainId: { |
| | | type: String, |
| | | required: false, |
| | | default: '' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | width: 800, |
| | | visible: false, |
| | | model: { |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | location: [ |
| | | { required: true, message: '请è¾å
¥é¨ä½!' }, |
| | | { max: 32, message: 'è¶
è¿æå¤§è¾å
¥éå¶,请缩åé¿åº¦' } |
| | | ], |
| | | sketchMap: [ |
| | | { required: true, message: '请ä¸ä¼ !' }, |
| | | ], |
| | | // maintenanceItem: [{ required: true, message: '请è¾å
¥ç»´ä¿®é¡¹ç®!' }, |
| | | // { max: 32, message: 'è¶
è¿æå¤§è¾å
¥éå¶,请缩åé¿åº¦' } |
| | | // ], |
| | | maintenanceRequire: [{ required: true, message: '请è¾å
¥ç»´ä¿®è¦æ±!' }, |
| | | { max: 32, message: 'è¶
è¿æå¤§è¾å
¥éå¶,请缩åé¿åº¦' } |
| | | ], |
| | | maintenanceTooling: [{ required: true, message: '请è¾å
¥ç»´ä¿®å·¥å
·!' }, |
| | | { max: 32, message: 'è¶
è¿æå¤§è¾å
¥éå¶,请缩åé¿åº¦' } |
| | | ], |
| | | safetyRequirement: [{ required: true, message: '请è¾å
¥å®å
¨è¦æ±!' }, |
| | | { max: 32, message: 'è¶
è¿æå¤§è¾å
¥éå¶,请缩åé¿åº¦' } |
| | | ], |
| | | timeQuota: [{ required: true, message: '请è¾å
¥å·¥æ¶å®é¢!' }, |
| | | |
| | | ], |
| | | // repairCycle: [{ required: true, message: '请è¾å
¥ç»´ä¿®å¨æ!' }], |
| | | // mamaintenanceSpecialtyId: [{ required: true, message: 'è¯·éæ©ç»´ä¿ä¸ä¸!' }, |
| | | // ], |
| | | maintenanceWay: [{ required: true, message: '请è¾å
¥æ¹æ³!' }, |
| | | { max: 32, message: 'è¶
è¿æå¤§è¾å
¥éå¶,请缩åé¿åº¦' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: "/eam/repairOrder/addRepairOrderDetail", |
| | | edit: "/eam/repairOrder/editRepairOrderDetail", |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add; |
| | | method = 'post'; |
| | | } else { |
| | | httpurl += this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | this.model['repairOrderId'] = this.mainId |
| | | httpAction(httpurl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-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.parameterCode" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="åæ°åç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥åæ°åç§°" |
| | | v-model="queryParam.parameterName" |
| | | ></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="parameterId" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="false" |
| | | :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 { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | |
| | | export default { |
| | | name: 'ParameterSelect', |
| | | 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: '忰代ç ', |
| | | dataIndex: 'parameterCode', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åæ°åç§°', |
| | | dataIndex: 'parameterName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '表å', |
| | | dataIndex: 'saveTableName', |
| | | align: 'center' |
| | | }, |
| | | ], |
| | | url: { |
| | | list: '/eam/predictiveworkplanparameter/listPredictiveWorkPlanParameter' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | searchQuery() { |
| | | this.loadData() |
| | | }, |
| | | |
| | | list(equipmentId) { |
| | | this.queryParam.equipmentId = equipmentId |
| | | this.visible = true |
| | | this.loadData() |
| | | }, |
| | | loadData() { |
| | | let that = this |
| | | getAction(this.url.list, this.queryParam).then((res) => { |
| | | if (res.success) { |
| | | that.dataSource = res.result |
| | | } |
| | | }) |
| | | }, |
| | | 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.parameterId != null && that.selectedRowRecord.parameterId != '') { |
| | | that.$emit('sendParameter', { 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="900" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ¡ä»¶" |
| | | > |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'è¯·éæ©æ¡ä»¶'" |
| | | :triggerChange="true" |
| | | dictCode="conditional_relation" |
| | | v-decorator="['parameterCondition', validatorRules.parameterCondition]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="忰代ç " |
| | | > |
| | | <a-input-search |
| | | placeholder="è¯·éæ©åæ°ä»£ç " |
| | | enter-button |
| | | @search="onSearchParameterCode()" |
| | | v-decorator="['parameterCode',validatorRules.parameterCode]" |
| | | :read-only="true" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="åæ°åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['parameterName', validatorRules.parameterName]" |
| | | placeholder="请è¾å
¥åæ°åç§°"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="表å" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['saveTableName', validatorRules.saveTableName]" |
| | | placeholder="请è¾å
¥è¡¨å"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-model-item label='åæ°åä½' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='mainUnitId'> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :placeholder="'è¯·éæ©åæ°åä½'" |
| | | v-model='model.parameterUnit' |
| | | dictCode="mom_base_unit,name,id,del_flag!='1'" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="åæ°ä¸éå¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥åæ°ä¸éå¼" |
| | | v-decorator="['upperLimitValue', validatorRules.upperLimitValue]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="åæ°ä¸éå¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥åæ°ä¸éå¼" |
| | | v-decorator="['lowerLimitValue', validatorRules.lowerLimitValue]" |
| | | /> |
| | | </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 |
| | | :disabled="disableSubmit || confirmLoading" |
| | | :loading="confirmLoading" |
| | | @click="handleOk" |
| | | type="primary" |
| | | >ç¡®å® |
| | | </a-button> |
| | | </template> |
| | | <parameter-select ref="parameterSelect" @sendParameter='sendParameter'></parameter-select> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import { postAction, requestPut } from '@/api/manage' |
| | | import ParameterSelect from './ParameterSelect' |
| | | |
| | | export default { |
| | | name: 'PredictiveSparePartsModal', |
| | | components: { |
| | | ParameterSelect |
| | | }, |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | visible: false, |
| | | codeDisable: true, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 } |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | parameterCondition: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©æ¡ä»¶!' } |
| | | ] |
| | | }, |
| | | parameterCode: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥åæ°ä»£ç !' } |
| | | ] |
| | | }, |
| | | upperLimitValue: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥åæ°ä¸éå¼!' } |
| | | ] |
| | | }, |
| | | lowerLimitValue: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥åæ°ä¸éå¼!' } |
| | | ] |
| | | } |
| | | }, |
| | | url: { |
| | | add: '/eam/predictiveworkplanparameter/add', |
| | | edit: '/eam/predictiveworkplanparameter/edit' |
| | | }, |
| | | //æ°å¢ãç¼è¾ãå é¤ãæ¹éå 餿使¹åæ°æ®åå·æ°å
³èçç»ä»¶ççå¬å±æ§ |
| | | alterFlag: '', |
| | | planId: '', |
| | | equipmentId: '' |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | |
| | | add() { |
| | | this.edit({}) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.disableSubmit = false |
| | | this.model.sparePartId = record.sparePartId |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, |
| | | 'sparePartNum', |
| | | 'sparePartName', |
| | | 'sparePartModel', |
| | | 'sparePartSpecification', |
| | | 'mainUnitName', |
| | | 'constructorName', |
| | | 'supportingQuantity', |
| | | 'ratedLife', |
| | | 'lifeWarning')) |
| | | }) |
| | | if (record.id) { |
| | | this.codeDisable = true |
| | | } else { |
| | | this.codeDisable = false |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | //ä¿åå¹¶æ°å¢æé®è§¦å |
| | | |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.workPlanId = this.planId |
| | | 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') |
| | | that.alterFlag = new Date() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onSearchParameterCode() { |
| | | this.$refs.parameterSelect.list(this.equipmentId) |
| | | this.$refs.parameterSelect.title = 'éæ©å¤ä»¶' |
| | | }, |
| | | sendParameter(data) { |
| | | let record = data.record |
| | | this.model.parameterId = record.parameterId |
| | | this.form.setFieldsValue({ |
| | | parameterName: record.parameterName, |
| | | parameterCode: record.parameterCode, |
| | | saveTableName: record.saveTableName |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="planId != '' && 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> |
| | | <predictive-parameter-modal ref="modalForm" @ok="modalFormOk"></predictive-parameter-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { deleteAction } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import PredictiveParameterModal from './PredictiveParameterModal' |
| | | |
| | | export default { |
| | | name: 'PredictiveParameters', |
| | | components: { |
| | | Tooltip, |
| | | PredictiveParameterModal |
| | | }, |
| | | 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: function(val) { |
| | | this.clearList() |
| | | 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' |
| | | }, |
| | | { |
| | | title: '忰代ç ', |
| | | dataIndex: 'parameterCode', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åæ°åç§°', |
| | | dataIndex: 'parameterName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åæ°åä½', |
| | | dataIndex: 'unitName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åæ°ä¸é', |
| | | dataIndex: 'upperLimitValue', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åæ°ä¸é', |
| | | dataIndex: 'lowerLimitValue', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 250, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | 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('请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="planId != '' && 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> |
| | | <predictive-spare-parts-modal ref="modalForm" @ok="modalFormOk"></predictive-spare-parts-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction, deleteAction } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import PredictiveSparePartsModal from './PredictiveSparePartsModal' |
| | | |
| | | export default { |
| | | name: 'PredictiveSpareParts', |
| | | components: { |
| | | Tooltip, |
| | | PredictiveSparePartsModal |
| | | }, |
| | | 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: function(val) { |
| | | this.clearList() |
| | | 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' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | dataIndex: 'sparePartName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶è§æ ¼', |
| | | dataIndex: 'sparePartSpecification', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åå·', |
| | | dataIndex: 'sparePartModel', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | dataIndex: 'mainUnitName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'é
奿°é', |
| | | dataIndex: 'supportingQuantity', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'é¢å®å¯¿å½/å°æ¶', |
| | | dataIndex: 'ratedLife', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'å¯¿å½æ§å¶é', |
| | | dataIndex: 'lifeWarning', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 250, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | 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('请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="900" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="å¤ä»¶ç¼å·" |
| | | > |
| | | <a-input-search |
| | | placeholder="è¯·éæ©å¤ä»¶" |
| | | enter-button |
| | | @search="onSearchSparePart()" |
| | | v-decorator="['sparePartNum',validatorRules.sparePartNum]" |
| | | :read-only="true" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="å¤ä»¶åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['sparePartName', validatorRules.sparePartName]" |
| | | placeholder="请è¾å
¥è®¾å¤åç§°"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="å¤ä»¶åå·" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['sparePartModel', validatorRules.sparePartModel]" |
| | | placeholder="请è¾å
¥è®¾å¤åå·"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="å¤ä»¶è§æ ¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['sparePartSpecification', validatorRules.sparePartSpecification]" |
| | | placeholder="请è¾å
¥è®¾å¤è§æ ¼"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="å¶é å" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['constructorName', validatorRules.constructorName]" |
| | | placeholder="请è¾å
¥å¶é å"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="åä½" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['mainUnitName', validatorRules.mainUnitName]" |
| | | placeholder="请è¾å
¥åä½"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item |
| | | :labelCol="labelCol" :wrapperCol="wrapperCol" |
| | | label="é
奿°é" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥é
奿°é" |
| | | v-decorator="['supportingQuantity', validatorRules.supportingQuantity]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item |
| | | :labelCol="labelCol" :wrapperCol="wrapperCol" |
| | | label="é¢å®å¯¿å½/å°æ¶" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥é¢å®å¯¿å½/å°æ¶" |
| | | v-decorator="['ratedLife', validatorRules.ratedLife]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item |
| | | :labelCol="labelCol" :wrapperCol="wrapperCol" |
| | | label="å¯¿å½æ§å¶é" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥å¯¿å½æ§å¶é" |
| | | v-decorator="['lifeWarning', validatorRules.lifeWarning]" |
| | | /> |
| | | </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 |
| | | :disabled="disableSubmit || confirmLoading" |
| | | :loading="confirmLoading" |
| | | @click="handleOk" |
| | | type="primary" |
| | | >ç¡®å® |
| | | </a-button> |
| | | </template> |
| | | |
| | | <plan-spare-part-select ref="planSparePartSelect" |
| | | @sendSparePartRecord='sendSparePartRecord'></plan-spare-part-select> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import { postAction, requestPut } from '@/api/manage' |
| | | import PlanSparePartSelect from '@/views/eam/common/PlanSparePartSelect' |
| | | |
| | | export default { |
| | | name: 'PredictiveSparePartsModal', |
| | | components: { |
| | | PlanSparePartSelect |
| | | }, |
| | | props: { |
| | | mainId: { |
| | | type: String, |
| | | required: false, |
| | | default: '' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | visible: false, |
| | | codeDisable: true, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 } |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | sparePartName: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©å¤ä»¶!' } |
| | | ] |
| | | }, |
| | | supportingQuantity: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥é
奿°é!' } |
| | | ] |
| | | }, |
| | | ratedLife: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥é¢å®å¯¿å½/å°æ¶!' } |
| | | ] |
| | | }, |
| | | lifeWarning: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥å¯¿å½æ§å¶é/å°æ¶!' } |
| | | ] |
| | | } |
| | | }, |
| | | url: { |
| | | add: '/eam/predictiveworkplansparepart/add', |
| | | edit: '/eam/predictiveworkplansparepart/edit' |
| | | }, |
| | | //æ°å¢ãç¼è¾ãå é¤ãæ¹éå 餿使¹åæ°æ®åå·æ°å
³èçç»ä»¶ççå¬å±æ§ |
| | | alterFlag: '', |
| | | planId: '' |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | |
| | | add() { |
| | | this.edit({}) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.disableSubmit = false |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, |
| | | 'sparePartNum', |
| | | 'sparePartName', |
| | | 'sparePartModel', |
| | | 'sparePartSpecification', |
| | | 'mainUnitName', |
| | | 'constructorName', |
| | | 'supportingQuantity', |
| | | 'ratedLife', |
| | | 'lifeWarning')) |
| | | }) |
| | | if (record.id) { |
| | | this.codeDisable = true |
| | | } else { |
| | | this.codeDisable = false |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | //ä¿åå¹¶æ°å¢æé®è§¦å |
| | | |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.workPlanId = this.planId |
| | | 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') |
| | | that.alterFlag = new Date() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onSearchSparePart() { |
| | | this.$refs.planSparePartSelect.list() |
| | | this.$refs.planSparePartSelect.title = 'éæ©å¤ä»¶' |
| | | }, |
| | | sendSparePartRecord(data) { |
| | | let record = data.record |
| | | this.model.sparePartId = record.id |
| | | this.form.setFieldsValue({ |
| | | sparePartId: record.id, |
| | | sparePartNum: record.num, |
| | | sparePartName: record.name, |
| | | sparePartModel: record.model, |
| | | sparePartSpecification: record.specification, |
| | | mainUnitId: record.mainUnitId, |
| | | mainUnitName: record.mainUnitId_dictText, |
| | | constructorName: record.constructorId_dictText |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="planId != '' && 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> |
| | | <predictive-warn-modal ref="modalForm" @ok="modalFormOk"></predictive-warn-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { deleteAction } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import PredictiveWarnModal from './PredictiveWarnModal' |
| | | |
| | | export default { |
| | | name: 'PredictiveWarn', |
| | | components: { |
| | | Tooltip, |
| | | PredictiveWarnModal |
| | | }, |
| | | 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: function(val) { |
| | | this.clearList() |
| | | 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' |
| | | }, |
| | | { |
| | | title: 'æ¥è¦ä»£ç ', |
| | | dataIndex: 'warnCode', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ¥è¦åç§°', |
| | | dataIndex: 'warnName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ¥è¦å¨æ', |
| | | dataIndex: 'warnCycle', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ¥è¦å¨æåä½', |
| | | dataIndex: 'cycleUnitName', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ¥è¦æ¬¡æ°', |
| | | dataIndex: 'times', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 250, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | 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('请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="900" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ¡ä»¶" |
| | | > |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'è¯·éæ©æ¡ä»¶'" |
| | | :triggerChange="true" |
| | | dictCode="conditional_relation" |
| | | v-decorator="['parameterCondition', validatorRules.parameterCondition]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ¥è¦ä»£ç " |
| | | > |
| | | <a-input-search |
| | | placeholder="è¯·éæ©æ¥è¦ä»£ç " |
| | | enter-button |
| | | @search="onSearchWarnCode()" |
| | | v-decorator="['warnCode',validatorRules.warnCode]" |
| | | :read-only="true" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="æ¥è¦åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" v-decorator="['warnName', validatorRules.warnName]" |
| | | placeholder="请è¾å
¥æ¥è¦åç§°"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="æ¥è¦å¨æ" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥æ¥è¦å¨æ" |
| | | v-decorator="['warnCycle', validatorRules.warnCycle]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-model-item label='æ¥è¦å¨æåä½' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='mainUnitId'> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :placeholder="'è¯·éæ©æ¥è¦å¨æåä½'" |
| | | v-decorator="['cycleUnit', validatorRules.cycleUnit]" |
| | | dictCode="warn_cycle_unit" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24/2"> |
| | | <a-form-item label="æ¥è¦æ¬¡æ°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥æ¥è¦æ¬¡æ°" |
| | | v-decorator="['times', validatorRules.times]" |
| | | /> |
| | | </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 |
| | | :disabled="disableSubmit || confirmLoading" |
| | | :loading="confirmLoading" |
| | | @click="handleOk" |
| | | type="primary" |
| | | >ç¡®å® |
| | | </a-button> |
| | | </template> |
| | | <warn-select ref="warnSelect" @sendWarn='sendWarn'></warn-select> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import { postAction, requestPut } from '@/api/manage' |
| | | import WarnSelect from './WarnSelect' |
| | | |
| | | export default { |
| | | name: 'PredictiveWarnModal', |
| | | components: { |
| | | WarnSelect |
| | | }, |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | visible: false, |
| | | codeDisable: true, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 } |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | parameterCondition: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©æ¡ä»¶!' } |
| | | ] |
| | | }, |
| | | warnCode: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥æ¥è¦ä»£ç !' } |
| | | ] |
| | | }, |
| | | warnCycle: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥æ¥è¦å¨æ!' } |
| | | ] |
| | | }, |
| | | cycleUnit: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©æ¥è¦å¨æåä½!' } |
| | | ] |
| | | }, |
| | | times: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥æ¥è¦æ¬¡æ°!' } |
| | | ] |
| | | } |
| | | }, |
| | | url: { |
| | | add: '/eam/predictiveworkplanwarn/add', |
| | | edit: '/eam/predictiveworkplanwarn/edit' |
| | | }, |
| | | //æ°å¢ãç¼è¾ãå é¤ãæ¹éå 餿使¹åæ°æ®åå·æ°å
³èçç»ä»¶ççå¬å±æ§ |
| | | alterFlag: '', |
| | | planId: '', |
| | | equipmentId: '' |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit({}) |
| | | }, |
| | | edit(record) { |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.disableSubmit = false |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, |
| | | 'sparePartNum', |
| | | 'sparePartName', |
| | | 'sparePartModel', |
| | | 'sparePartSpecification', |
| | | 'mainUnitName', |
| | | 'constructorName', |
| | | 'supportingQuantity', |
| | | 'ratedLife', |
| | | 'lifeWarning')) |
| | | }) |
| | | if (record.id) { |
| | | this.codeDisable = true |
| | | } else { |
| | | this.codeDisable = false |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | //ä¿åå¹¶æ°å¢æé®è§¦å |
| | | |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.workPlanId = this.planId |
| | | 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') |
| | | that.alterFlag = new Date() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onSearchWarnCode() { |
| | | this.$refs.warnSelect.list(this.equipmentId) |
| | | this.$refs.warnSelect.title = 'éæ©å¤ä»¶' |
| | | }, |
| | | sendWarn(data) { |
| | | let record = data.record |
| | | this.model.warnId = record.warnCode |
| | | this.model.mdcEquipmentId = record.mdcEquipmentId |
| | | this.form.setFieldsValue({ |
| | | warnCode: record.warnCode, |
| | | warnName: record.warnName |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="1500" |
| | | :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 |
| | | allowClear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'请è¾å
¥æ¹æ¡ç¼ç '" |
| | | v-decorator="[ 'num', validatorRules.num]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | label="æ¹æ¡åç§°" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <a-input |
| | | allowClear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'请è¾å
¥æ¹æ¡åç§°'" |
| | | v-decorator="[ 'name', validatorRules.name]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | label="çæ§ç±»å" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'è¯·éæ©çæ§ç±»å'" |
| | | :triggerChange="true" |
| | | dictCode="monitor_type" |
| | | v-decorator="['monitorType', validatorRules.monitorType]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | label="设å¤åç§°" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <a-input-search |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©è®¾å¤" |
| | | enter-button |
| | | @search="onEquipmentList()" |
| | | :read-only="true" |
| | | v-decorator="['equipmentName', validatorRules.equipmentName]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | label="ç»´ä¿æ¹å¼" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'è¯·éæ©ç»´ä¿æ¹å¼'" |
| | | :triggerChange="true" |
| | | dictCode="maintenance_method" |
| | | v-decorator="['maintenanceMethod', validatorRules.maintenanceMethod]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | label="派工æ¹å¼" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="disableSubmit" |
| | | :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 |
| | | label="责任çç»" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <a-input |
| | | allow-clear |
| | | :disabled="true" |
| | | :placeholder="disableSubmit?'':'请è¾å
¥è´£ä»»çç»'" |
| | | v-decorator="['teamName', {} ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | label="çæ¬" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <a-input |
| | | allowClear |
| | | :disabled="true" |
| | | :placeholder="disableSubmit?'':'请è¾å
¥çæ¬å·'" |
| | | v-decorator="[ 'planVersion', validatorRules.planVersion]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | v-if="this.isRevise == true" |
| | | :span="12" |
| | | > |
| | | <a-form-item |
| | | label="åå²çæ¬" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <a-input |
| | | allowClear |
| | | :disabled="true" |
| | | :placeholder="disableSubmit?'':'请è¾å
¥åå²çæ¬å·'" |
| | | v-decorator="[ 'historyVersion', validatorRules.historyVersion]" |
| | | /> |
| | | </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" |
| | | >ç¡®å® |
| | | </a-button> |
| | | </template> |
| | | |
| | | <equipment-list |
| | | ref="EquipmentList" |
| | | @sendEquipmentRecord='sendEquipmentRecord' |
| | | ></equipment-list> |
| | | |
| | | <!-- <j-select-maintenance-standard-modal ref="maintenanceStandardModalForm"></j-select-maintenance-standard-modal>--> |
| | | </a-modal> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, postAction, requestPut, deleteAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import JMultiSelectTag from '@/components/dict/JMultiSelectTag' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | // import JSelectMaintenanceStandardModal from './JSelectMaintenanceStandardModal' |
| | | |
| | | 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 EquipmentList from '.././dailyInspectionStandard/EquipmentList' |
| | | |
| | | export default { |
| | | name: 'MaintenanceStandardModal', |
| | | components: { |
| | | JMultiSelectTag, |
| | | Tooltip, |
| | | // JSelectMaintenanceStandardModal, |
| | | // UploadModel, |
| | | PdfView, |
| | | preview, |
| | | EquipmentList |
| | | }, |
| | | data() { |
| | | return {title: 'æä½', |
| | | visible: false, |
| | | visible4Confirm: false, |
| | | disableSubmit: false, |
| | | codeDisable: true, |
| | | isRevise: false, |
| | | model: {}, |
| | | upload: {}, |
| | | treeData: [], |
| | | 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: '请è¾å
¥ç¼ç !' } |
| | | ] |
| | | }, |
| | | teamName: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©è´£ä»»çç»!' } |
| | | ] |
| | | }, |
| | | useDepartName: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©å¯¹è±¡é¨é¨!' } |
| | | ] |
| | | }, |
| | | equipmentName: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤!' } |
| | | ] |
| | | }, |
| | | assignMode: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©æ´¾å·¥æ¹å¼!' } |
| | | ] |
| | | }, |
| | | version: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥çæ¬!' } |
| | | ] |
| | | }, |
| | | historyVersion: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥åå²çæ¬!' } |
| | | ] |
| | | } |
| | | }, |
| | | url: { |
| | | list: '/eam/maintenanceStandardDetail/getMaintenanceStandardDetailListByIds', |
| | | add: '/eam/predictiveworkplan/add', |
| | | edit: '/eam/predictiveworkplan/edit', |
| | | addDetail: '/eam/maintenanceStandardDetail/add', |
| | | revise: '/eam/maintenanceStandard/revise', |
| | | getReviseVersion: '/eam/maintenanceStandard/getReviseVersion', |
| | | loadOptions: '/sys/sysDepart/loadDepartTreeOptions' |
| | | }, |
| | | |
| | | dataSource: [], |
| | | departId: '' |
| | | } |
| | | }, |
| | | |
| | | mounted() { |
| | | |
| | | }, |
| | | |
| | | created() { |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | add() { |
| | | this.edit({ maintenanceStandardDetaillist: [] }) |
| | | }, |
| | | |
| | | edit(record) { |
| | | let that = this |
| | | this.initOptions() |
| | | this.dataSource = [] |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | if (record.maintenanceStandardDetaillist != undefined) { |
| | | const temp = [...record.maintenanceStandardDetaillist] |
| | | // for (let i = 0; i < temp.length; i++) { |
| | | // let r = temp[i].upload; |
| | | // r.src = this.getSrc(temp[i].upload); |
| | | // } |
| | | that.dataSource = temp |
| | | } |
| | | that.$nextTick(() => { |
| | | that.model.equipmentId = record.id |
| | | that.model.teamId = record.teamId |
| | | if (!record.status) { |
| | | that.model.status = 1 |
| | | } |
| | | that.form.setFieldsValue(pick(that.model, 'num', 'equipmentName', 'useDepartName', 'teamName', 'assignMode', 'planVersion', 'remark')) |
| | | }) |
| | | if (record.id) { |
| | | this.codeDisable = true |
| | | that.$nextTick(() => { |
| | | if (that.isRevise) { |
| | | requestPut(that.url.getReviseVersion, record).then((res) => { |
| | | if (res.success) { |
| | | that.form.setFieldsValue({ planVersion: res.result, historyVersion: record.version }) |
| | | } |
| | | }) |
| | | } |
| | | }, 200) |
| | | } else { |
| | | this.codeDisable = false |
| | | that.$nextTick(() => { |
| | | that.form.setFieldsValue({ 'planVersion': '1.0' }) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | initOptions() { |
| | | getAction(this.url.loadOptions).then(res => { |
| | | if (res.success) { |
| | | this.treeData = res.result |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onEquipmentList() { |
| | | this.$refs.EquipmentList.list() |
| | | this.$refs.EquipmentList.title = 'éæ©è®¾å¤ä¿¡æ¯' |
| | | }, |
| | | sendEquipmentRecord(data) { |
| | | this.dataSource = [] |
| | | let record = data.record |
| | | this.model.equipmentId = record.id |
| | | this.model.teamId = record.teamId |
| | | this.form.setFieldsValue({ |
| | | equipmentName: record.num + '/' + record.name + '/' + record.model, |
| | | teamName: record.teamId_dictText |
| | | }) |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | 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) { |
| | | formData.planVersion = '1' |
| | | obj = postAction(this.url.add, formData) |
| | | } else { |
| | | if (this.isRevise) { |
| | | formData.planVersion = '1' |
| | | obj = postAction(this.url.revise, 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() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getUuiD(randomLength) { |
| | | return Number( |
| | | Math.random() |
| | | .toString() |
| | | .substr(2, randomLength) + Date.now() |
| | | ).toString(36) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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.warnCode" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="æ¥è¦åç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥æ¥è¦åç§°" |
| | | v-model="queryParam.warnName" |
| | | ></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="warnCode" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="false" |
| | | :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 { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | |
| | | export default { |
| | | name: 'WarnSelect', |
| | | 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: 'æ¥è¦ä»£ç ', |
| | | dataIndex: 'warnCode', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ¥è¦åç§°', |
| | | dataIndex: 'warnName', |
| | | align: 'center' |
| | | }, |
| | | ], |
| | | url: { |
| | | list: '/eam/predictiveworkplanwarn/listPredictiveWorkPlanWarn' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | searchQuery() { |
| | | this.loadData() |
| | | }, |
| | | |
| | | list(equipmentId) { |
| | | this.queryParam.equipmentId = equipmentId |
| | | this.visible = true |
| | | this.loadData() |
| | | }, |
| | | loadData() { |
| | | let that = this |
| | | getAction(this.url.list, this.queryParam).then((res) => { |
| | | if (res.success) { |
| | | that.dataSource = res.result |
| | | } |
| | | }) |
| | | }, |
| | | 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.warnCode != null && that.selectedRowRecord.warnCode != '') { |
| | | that.$emit('sendWarn', { 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> |