¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false" :class="'cust-erp-sub-tab'"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" v-if="mainId"> |
| | | <!-- <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> --> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | <template 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)">ç¼è¾</a> |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | export default { |
| | | name: "EquipmentMaintenancePlanDetailList", |
| | | mixins:[JeecgListMixin], |
| | | components: {}, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | } |
| | | }, |
| | | watch:{ |
| | | mainId:{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['planId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'ä¿å
»è®¡å管ç页é¢', |
| | | disableMixinCreated:true, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:45, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'ä¿å
»æ å', |
| | | align:"center", |
| | | dataIndex: 'standardNum', |
| | | width:300, |
| | | }, |
| | | { |
| | | title:'设å¤ç»ä¸ç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'equipmentNum', |
| | | width:300, |
| | | }, |
| | | { |
| | | title:'设å¤åç§°', |
| | | align:"center", |
| | | dataIndex: 'equipmentName', |
| | | width:300, |
| | | }, |
| | | { |
| | | title:'设å¤åå·', |
| | | align:"center", |
| | | dataIndex: 'model', |
| | | width:300, |
| | | }, |
| | | { |
| | | title:'计åå¼å§æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'planStartTime', |
| | | width:300, |
| | | }, |
| | | { |
| | | title:'计åç»ææ¶é´', |
| | | align:"center", |
| | | dataIndex: 'planEndTime', |
| | | width:300, |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/equipmentMaintenancePlan/listEquipmentMaintenancePlanDetailByMainId", |
| | | delete: "/eam/equipmentMaintenancePlan/deleteEquipmentMaintenancePlanDetail", |
| | | deleteBatch: "/eam/equipmentMaintenancePlan/deleteBatchEquipmentMaintenancePlanDetail", |
| | | exportXlsUrl: "/eam/equipmentMaintenancePlan/exportEquipmentMaintenancePlanDetail", |
| | | importUrl: "/eam/equipmentMaintenancePlan/importEquipmentMaintenancePlanDetail", |
| | | }, |
| | | dictOptions:{ |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | importExcelUrl(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | clearList(){ |
| | | this.dataSource=[] |
| | | this.selectedRowKeys=[] |
| | | this.ipagination.current = 1 |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</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" |
| | | class="j-table-force-nowrap" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
| | | :customRow="clickThenSelect" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)" v-if="record.status==='created'||record.status==='rejected'">ç¼è¾</a> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'"/> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)" v-if="record.status==='created'||record.status==='rejected'"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'"/> |
| | | <a-popconfirm title="æäº¤åä¸å¯æ¤åï¼ç¡®å®æäº¤å?" @confirm="() => handleSubmit(record)" v-if="record.status==='created'||record.status==='rejected'"> |
| | | <a>æäº¤</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='created'||record.status==='rejected'"/> |
| | | <a-popconfirm title="éè¿åä¸å¯æ¤éï¼ç¡®å®éè¿å?" @confirm="() => handleAudit(record)" v-if="record.status==='submitted'"> |
| | | <a>éè¿</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='submitted'"/> |
| | | <a-popconfirm title="ç¡®å®é©³åå?" @confirm="() => handleReject(record)" v-if="record.status==='submitted'"> |
| | | <a>驳å</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.status==='submitted'"/> |
| | | <a-popconfirm title="ä¸ååä¸å¯æ¤éï¼ç¡®å®ä¸åå?" @confirm="() => handleDistrbute(record)" v-if="record.status==='passed'"> |
| | | <a>ä¸å</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="ä¿å
»è®¡åæç»" key="1" > |
| | | <EquipmentMaintenancePlanDetailList :mainId="equipmentMaintenancePlanDetailMainId" /> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | <equipmentMaintenancePlan-modal ref="modalForm" @ok="modalFormOk"></equipmentMaintenancePlan-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EquipmentMaintenancePlanModal from './modules/maintenancePlan/EquipmentMaintenancePlanModal' |
| | | import { getAction } from '@/api/manage' |
| | | import EquipmentMaintenancePlanDetailList from './EquipmentMaintenancePlanDetailList' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { putAction } from '../../api/manage' |
| | | |
| | | export default { |
| | | name: "EquipmentMaintenancePlanList", |
| | | mixins:[JeecgListMixin], |
| | | components: { |
| | | EquipmentMaintenancePlanDetailList, |
| | | EquipmentMaintenancePlanModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'ä¿å
»è®¡å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title:'计ååå·', |
| | | align:"center", |
| | | dataIndex: 'num', |
| | | }, |
| | | { |
| | | title:'计ååç±»å', |
| | | align:"center", |
| | | dataIndex: 'type_dictText', |
| | | width:200, |
| | | }, |
| | | { |
| | | title:'计ååç¶æ', |
| | | align:"center", |
| | | dataIndex: 'status_dictText', |
| | | width:200, |
| | | }, |
| | | { |
| | | title:'è®¾å¤æ°é', |
| | | align:"center", |
| | | dataIndex: 'equipNo', |
| | | width:200, |
| | | }, |
| | | { |
| | | title:'å建人', |
| | | align:"center", |
| | | dataIndex: 'createBy', |
| | | width:200, |
| | | }, |
| | | { |
| | | title:'å建æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'createTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | }, |
| | | width:200, |
| | | }, |
| | | { |
| | | title:'ä¿®æ¹äºº', |
| | | align:"center", |
| | | dataIndex: 'updateBy', |
| | | width:200, |
| | | }, |
| | | { |
| | | title:'ä¿®æ¹æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'updateTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | }, |
| | | width:200, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:200, |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/equipmentMaintenancePlan/list", |
| | | delete: "/eam/equipmentMaintenancePlan/delete", |
| | | deleteBatch: "/eam/equipmentMaintenancePlan/deleteBatch", |
| | | exportXlsUrl: "/eam/equipmentMaintenancePlan/exportXls", |
| | | importExcelUrl: "eam/equipmentMaintenancePlan/importExcel", |
| | | submit:"eam/equipmentMaintenancePlan/submit", |
| | | reject:"eam/equipmentMaintenancePlan/reject", |
| | | distrbute:"eam/equipmentMaintenancePlan/distrbute", |
| | | audit:"eam/equipmentMaintenancePlan/audit" |
| | | }, |
| | | dictOptions:{ |
| | | }, |
| | | /* å页忰 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '50'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | selectedMainId:'', |
| | | superFieldList:[], |
| | | equipmentMaintenancePlanDetailMainId: '', |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = []; |
| | | this.selectionRows = []; |
| | | this.selectedMainId='' |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedMainId=selectedRowKeys[0] |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | this.equipmentMaintenancePlanDetailMainId = selectionRows[0]['id'] |
| | | }, |
| | | loadData(arg) { |
| | | if(!this.url.list){ |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | this.onClearSelected() |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records; |
| | | this.ipagination.total = res.result.total; |
| | | } |
| | | if(res.code===510){ |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'num',text:'计ååå·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'type',text:'计ååç±»åï¼æ°æ®åå
¸ï¼maintenance_plan_typeï¼',dictCode:''}) |
| | | fieldList.push({type:'string',value:'status',text:'计ååç¶æ(æ°æ®åå
¸ï¼maintenance_plan_type)',dictCode:''}) |
| | | fieldList.push({type:'int',value:'equipNo',text:'è®¾å¤æ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'createBy',text:'createBy',dictCode:''}) |
| | | fieldList.push({type:'date',value:'createTime',text:'createTime'}) |
| | | fieldList.push({type:'string',value:'updateBy',text:'updateBy',dictCode:''}) |
| | | fieldList.push({type:'date',value:'updateTime',text:'updateTime'}) |
| | | this.superFieldList = fieldList |
| | | }, |
| | | handleSubmit(record){ |
| | | putAction(this.url.submit,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("æä½æå"); |
| | | }else{ |
| | | this.$message.success("æä½å¤±è´¥"); |
| | | } |
| | | }) |
| | | }, |
| | | handleAudit(record){ |
| | | putAction(this.url.audit,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("æä½æå"); |
| | | }else{ |
| | | this.$message.success("æä½å¤±è´¥"); |
| | | } |
| | | }) |
| | | }, |
| | | handleDistrbute(record){ |
| | | putAction(this.url.distrbute,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("æä½æå"); |
| | | }else{ |
| | | this.$message.success("æä½å¤±è´¥"); |
| | | } |
| | | }) |
| | | }, |
| | | handleReject(record){ |
| | | putAction(this.url.reject,record).then(res=>{ |
| | | if(res.success){ |
| | | this.$message.success("æä½æå"); |
| | | }else{ |
| | | this.$message.success("æä½å¤±è´¥"); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <j-form-container :disabled="formDisabled"> |
| | | <!-- 主表ååºå --> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-col :span="12" > |
| | | <a-form-model-item label="计ååå·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> |
| | | <a-input v-model="model.num" placeholder="请è¾å
¥è®¡ååå·" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12" > |
| | | <a-form-model-item label="计ååç±»å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type"> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | placeholder="è¯·éæ©è®¡ååç±»å" |
| | | :triggerChange="true" |
| | | dictCode="maintenance_type" |
| | | v-model="model.type" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | <!-- å表ååºå --> |
| | | <a-tabs v-model="activeKey" @change="handleChangeTabs"> |
| | | <a-tab-pane tab="ä¿å
»è®¡åæç»" :key="refKeys[0]" :forceRender="true"> |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref="refKeys[0]" |
| | | :loading="equipmentMaintenancePlanDetailTable.loading" |
| | | :columns="equipmentMaintenancePlanDetailTable.columns" |
| | | :dataSource="equipmentMaintenancePlanDetailTable.dataSource" |
| | | :maxHeight="300" |
| | | :disabled="formDisabled" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :toolbar="true" |
| | | bordered |
| | | :alwaysEdit="true" |
| | | :toolbarConfig='toolbarConfig' |
| | | > |
| | | <template slot='toolbarPrefix'> |
| | | <a-button type='primary' @click='standardSelect' :disabled="formDisabled" icon="plus">设å¤-ä¿å
»æ å |
| | | </a-button> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <standard-select @selectionRows='selectionRows' ref='standardSelectModel' ></standard-select> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { getAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import JFormContainer from '@/components/jeecg/JFormContainer' |
| | | import StandardSelect from './StandardSelect' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import dayjs from 'dayjs' |
| | | |
| | | export default { |
| | | name: 'EquipmentMaintenancePlanForm', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | JFormContainer, |
| | | StandardSelect, |
| | | dayjs |
| | | }, |
| | | data() { |
| | | return { |
| | | toolbarConfig: { |
| | | // prefix åç¼ï¼suffix åç¼ |
| | | slot: ['prefix', 'suffix'], |
| | | // add æ°å¢æé®ï¼remove å 餿é®ï¼clearSelection æ¸
ç©ºéæ©æé® |
| | | btn: ['remove', 'clearSelection'] |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | model:{ |
| | | }, |
| | | // æ°å¢æ¶å表é»è®¤æ·»å å è¡ç©ºæ°æ® |
| | | addDefaultRowNum: 1, |
| | | validatorRules: { |
| | | num: [ |
| | | { required: true, message: '请è¾å
¥ç¼ç !' }, |
| | | { min: 1, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' }, |
| | | { validator: this.validateNum }, |
| | | ], |
| | | type: [ |
| | | { required: true, message: 'è¯·éæ©è®¡ååç±»å!' }, |
| | | ], |
| | | }, |
| | | refKeys: ['equipmentMaintenancePlanDetail', ], |
| | | tableKeys:['equipmentMaintenancePlanDetail', ], |
| | | activeKey: 'equipmentMaintenancePlanDetail', |
| | | // ä¿å
»è®¡åæç» |
| | | equipmentMaintenancePlanDetailTable: { |
| | | loading: false, |
| | | dataSource: [ |
| | | ], |
| | | columns: [ |
| | | { |
| | | title: 'ä¿å
»æ åid', |
| | | key: 'standardId', |
| | | type: JVXETypes.hidden, |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | width:"230px", |
| | | }, |
| | | { |
| | | title: 'ä¿å
»æ å', |
| | | key: 'standardNum', |
| | | type: JVXETypes.normal, |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | width:"230px", |
| | | }, |
| | | { |
| | | title: '设å¤ç»ä¸ç¼ç ', |
| | | key: 'equipmentNum', |
| | | type: JVXETypes.normal, |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | width:"230px", |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | key: 'equipmentName', |
| | | type: JVXETypes.normal, |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | width:"230px", |
| | | }, |
| | | { |
| | | title: '设å¤åå·', |
| | | key: 'model', |
| | | type: JVXETypes.normal, |
| | | placeholder: '请è¾å
¥${title}', |
| | | defaultValue: '', |
| | | align:'center', |
| | | width:"230px", |
| | | }, |
| | | { |
| | | title: '计åå¼å§æ¶é´', |
| | | key: 'planStartTime', |
| | | type: JVXETypes.datetime, |
| | | placeholder: '请è¾å
¥${title}', |
| | | align:'center', |
| | | width:"250px", |
| | | validateRules: [ |
| | | { |
| | | required: true, // å¿
å¡« |
| | | message: '请è¾å
¥${title}' // æ¾ç¤ºçææ¬ |
| | | }, |
| | | { |
| | | handler({ cellValue, row, column }, callback, target) { |
| | | var start = dayjs(cellValue); |
| | | var end = dayjs(row.planEndTime); |
| | | if (!start.isBefore(end)) { |
| | | callback(false, 'ç»ææ¶é´éæ»åäºå¼å§æ¶é´') // false = æªéè¿ï¼å¯ä»¥è·èªå®ä¹æç¤º |
| | | } else { |
| | | callback(true) // true = éè¿éªè¯ |
| | | } |
| | | }, |
| | | message: '${title}é»è®¤æç¤º' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | title: '计åç»ææ¶é´', |
| | | key: 'planEndTime', |
| | | type: JVXETypes.datetime, |
| | | placeholder: '请è¾å
¥${title}', |
| | | align:'center', |
| | | width:"250px", |
| | | validateRules: [ |
| | | { |
| | | required: true, // å¿
å¡« |
| | | message: '请è¾å
¥${title}' // æ¾ç¤ºçææ¬ |
| | | }, |
| | | { |
| | | handler({ cellValue, row, column }, callback, target) { |
| | | var start = dayjs(row.planStartTime); |
| | | var end = dayjs(cellValue); |
| | | if (!start.isBefore(end)) { |
| | | callback(false, 'ç»ææ¶é´éæ»åäºå¼å§æ¶é´') // false = æªéè¿ï¼å¯ä»¥è·èªå®ä¹æç¤º |
| | | } else { |
| | | callback(true) // true = éè¿éªè¯ |
| | | } |
| | | }, |
| | | message: '${title}é»è®¤æç¤º' |
| | | } |
| | | ] |
| | | }, |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/equipmentMaintenancePlan/add", |
| | | edit: "/eam/equipmentMaintenancePlan/edit", |
| | | queryById: "/eam/equipmentMaintenancePlan/queryById", |
| | | equipmentMaintenancePlanDetail: { |
| | | list: '/eam/equipmentMaintenancePlan/listEquipmentMaintenancePlanDetailByMainId' |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | addBefore(){ |
| | | this.equipmentMaintenancePlanDetailTable.dataSource=[] |
| | | }, |
| | | getAllTable() { |
| | | let values = this.tableKeys.map(key => getRefPromise(this, key)) |
| | | return Promise.all(values) |
| | | }, |
| | | /** è°ç¨å®edit()æ¹æ³ä¹åä¼èªå¨è°ç¨æ¤æ¹æ³ */ |
| | | editAfter() { |
| | | this.$nextTick(() => { |
| | | }) |
| | | // å è½½åè¡¨æ°æ® |
| | | if (this.model.id) { |
| | | let params = { planId: this.model.id } |
| | | this.requestSubTableData(this.url.equipmentMaintenancePlanDetail.list, params, this.equipmentMaintenancePlanDetailTable) |
| | | } |
| | | }, |
| | | //æ ¡éªææä¸å¯¹ä¸å表表å |
| | | validateSubForm(allValues){ |
| | | return new Promise((resolve,reject)=>{ |
| | | Promise.all([ |
| | | ]).then(() => { |
| | | resolve(allValues) |
| | | }).catch(e => { |
| | | if (e.error === VALIDATE_FAILED) { |
| | | // å¦æææªéè¿è¡¨åéªè¯çå表ï¼å°±èªå¨è·³è½¬å°å®æå¨çtab |
| | | this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] |
| | | } else { |
| | | console.error(e) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | /** æ´çæformData */ |
| | | classifyIntoFormData(allValues) { |
| | | let main = Object.assign(this.model, allValues.formValue) |
| | | return { |
| | | ...main, // å±å¼ |
| | | equipmentMaintenancePlanDetailList: allValues.tablesValue[0].tableData, |
| | | } |
| | | }, |
| | | validateError(msg){ |
| | | this.$message.error(msg) |
| | | }, |
| | | standardSelect() { |
| | | let ids = [] |
| | | let tableData = this.$refs.equipmentMaintenancePlanDetail.getTableData() |
| | | for (let i = 0; i < tableData.length; i++) { |
| | | ids.push(tableData[i].standardId) |
| | | } |
| | | this.$refs.standardSelectModel.showModal(ids) |
| | | this.$refs.standardSelectModel.title = 'éæ©ç²¾åº¦åæ°' |
| | | this.$refs.standardSelectModel.disableSubmit = false |
| | | }, |
| | | addSelected(data) { |
| | | let tableData = this.$refs.equipmentMaintenancePlanDetail.getTableData() |
| | | var tableStr = JSON.stringify(tableData) |
| | | const addRows = [] |
| | | for (let i = 0; i < data.length; i++) { |
| | | var equipmentMaintenancePlanDetail = {} |
| | | if (tableStr.indexOf(data[i].id) == -1) { |
| | | equipmentMaintenancePlanDetail = { |
| | | standardId:data[i].id, |
| | | standardNum: data[i].num, |
| | | equipmentNum:data[i].equipmentNum, |
| | | equipmentName:data[i].equipmentName, |
| | | model:data[i].equipmentModel, |
| | | planId:this.model.id, |
| | | } |
| | | } |
| | | addRows.push(equipmentMaintenancePlanDetail) |
| | | } |
| | | this.$refs.equipmentMaintenancePlanDetail.pushRows(addRows) |
| | | }, |
| | | selectionRows(data) { |
| | | // å¢å éä¸ç设å¤å°åè¡¨ä¸ |
| | | this.addSelected(data) |
| | | }, |
| | | validateNum(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'mom_eam_equipment_maintenance_plan', |
| | | fieldName: 'num', |
| | | fieldVal: value, |
| | | dataId: this.model.id, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: '0', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("ç¼å·å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="1600" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel"> |
| | | <equipment-maintenance-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import EquipmentMaintenancePlanForm from './EquipmentMaintenancePlanForm' |
| | | |
| | | export default { |
| | | name: 'EquipmentMaintenancePlanModal', |
| | | components: { |
| | | EquipmentMaintenancePlanForm |
| | | }, |
| | | data() { |
| | | return { |
| | | title:'', |
| | | width:800, |
| | | visible: false, |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | methods:{ |
| | | add () { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.add(); |
| | | }) |
| | | }, |
| | | edit (record) { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.edit(record); |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | this.$refs.realForm.handleOk(); |
| | | }, |
| | | submitCallback(){ |
| | | this.$emit('ok'); |
| | | this.visible = false; |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </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.name" |
| | | /> |
| | | </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: 'JSelectToolingModal', |
| | | 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: 'version', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'çæ¬ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'versionStatusName', |
| | | width: 130, |
| | | }, |
| | | { |
| | | title: 'æ åç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'num', |
| | | }, |
| | | { |
| | | title: '对象é¨é¨', |
| | | align: 'center', |
| | | dataIndex: 'useDepartName', |
| | | }, |
| | | { |
| | | title: '设å¤ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'equipmentNum', |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | align: 'center', |
| | | dataIndex: 'equipmentName', |
| | | }, |
| | | { |
| | | title: '设å¤åå·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentModel', |
| | | }, |
| | | ], |
| | | selectedRowKeys: [], |
| | | oldSlelectRows: [], |
| | | 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' |
| | | }, |
| | | departTree: [], |
| | | visible: false, |
| | | loading: false, |
| | | url: { |
| | | list: '/eam/maintenanceStandard/getMaintenanceStandardList', |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.onSelectChange(selectedRows); |
| | | }, |
| | | getCheckboxProps: record => ({ |
| | | props: { |
| | | disabled: record.distable |
| | | }, |
| | | }), |
| | | selectedRowKeys: this.selectedRowKeys, |
| | | }; |
| | | }, |
| | | }, |
| | | watch: { |
| | | |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | |
| | | async loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | let that = this |
| | | this.loading = true |
| | | this.queryParam.versionStatus = '2' |
| | | this.queryParam.type = 'daily' |
| | | 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.oldSlelectRows.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; |
| | | }) |
| | | }, |
| | | showModal(oldSlelectRows) { |
| | | this.oldSlelectRows = oldSlelectRows; |
| | | 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.$emit('selectionRows', 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> |