| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="å 餿 è®°"> |
| | | <a-input placeholder="请è¾å
¥å 餿 è®°" v-model="queryParam.delFlag"></a-input> |
| | | <a-form-item label="ç»´ä¿®ç¼ç "> |
| | | <a-input placeholder="请è¾å
¥ç»´ä¿®ç¼ç " v-model="queryParam.repairCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="设å¤ID"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ID" v-model="queryParam.equipmentId"></a-input> |
| | | <a-form-item label="项ç®åç§°"> |
| | | <a-input placeholder="请è¾å
¥é¡¹ç®åç§°" v-model="queryParam.repairName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <template v-if="toggleSearchStatus"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç»´ä¿®ç¶æ"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©ç»´ä¿®ç¶æ" v-model="queryParam.repairStatus" dictCode="major_partial_repair_status"/> |
| | | </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.repairType"></a-input> |
| | | <a-select v-model="queryParam.repairType" placeholder="è¯·éæ©ç»´ä¿®ç±»å"> |
| | | <a-select-option value="大修">大修</a-select-option> |
| | | <a-select-option value="项修">项修</a-select-option> |
| | | </a-select> |
| | | </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.planStartTime"></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.planEndTime"></a-input> |
| | | <a-form-item label="计åå¼å§æ¥æ"> |
| | | <a-range-picker |
| | | v-model="planDateRange" |
| | | @change="selectDateChange" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | |
| | | </a> |
| | | </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 type="primary" icon="download" @click="handleExportXls('大修项修')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('eam_major_partial_repair')">导åº</a-button>--> |
| | | <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
| | | <!-- <a-button type="primary" icon="import">导å
¥</a-button>--> |
| | | <!-- </a-upload>--> |
| | | <!-- é«çº§æ¥è¯¢åºå --> |
| | | <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
| | | <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-item key="1" @click="batchSubmit"><a-icon type="form"/>æäº¤</a-menu-item> |
| | | <a-menu-item key="2" @click="batchConfirm"><a-icon type="check"/>确认</a-menu-item> |
| | | <a-menu-item key="3" @click="batchRepeal"><a-icon type="close"/>ä½åº</a-menu-item> |
| | | <a-menu-item key="4" @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> |
| | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | <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="handleDetail(record)">详æ
</a> |
| | | <span v-if="record.repairStatus === 'PENDING_SUBMISSION'"> |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm title="ç¡®å®è¦æäº¤å?" @confirm="() => handleSubmit(record.id)"> |
| | | <a>æäº¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | <span v-if="record.repairStatus === 'PENDING_CONFIRMATION'"> |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm title="è¦å®æç¡®è®¤å?" @confirm="() => handleConfirm(record.id)"> |
| | | <a>确认</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | <span v-if="record.repairStatus === 'CONFIRMED'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleFill(record)">å¡«æ¥</a> |
| | | </span> |
| | | |
| | | <span v-if="record.repairStatus === 'PENDING_SUBMISSION'"> |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <eamMajorPartialRepair-modal ref="modalForm" @ok="modalFormOk"></eamMajorPartialRepair-modal> |
| | | <eam-major-partial-repair-modal ref="modalForm" @ok="modalFormOk"></eam-major-partial-repair-modal> |
| | | <eam-major-partial-repair-detail-modal ref="modalDetailForm" @ok="modalFormOk"></eam-major-partial-repair-detail-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal' |
| | | import EamMajorPartialRepairDetailModal from './modules/EamMajorPartialRepairDetailModal' |
| | | import { getAction } from '../../../api/manage' |
| | | |
| | | export default { |
| | | name: "EamMajorPartialRepairList", |
| | | mixins:[JeecgListMixin], |
| | | name: 'EamMajorPartialRepairList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | EamMajorPartialRepairModal |
| | | EamMajorPartialRepairModal, |
| | | EamMajorPartialRepairDetailModal |
| | | }, |
| | | data () { |
| | | return { |
| | |
| | | } |
| | | }, |
| | | { |
| | | title: 'å 餿 è®°', |
| | | title:'ç»´ä¿®ç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'delFlag' |
| | | dataIndex: 'repairCode' |
| | | }, |
| | | { |
| | | title: '设å¤ID', |
| | | title:'项ç®åç§°', |
| | | align:"center", |
| | | dataIndex: 'equipmentId' |
| | | dataIndex: 'repairName' |
| | | }, |
| | | { |
| | | title:'ç»´ä¿®ç¶æ', |
| | | align:"center", |
| | | dataIndex: 'repairStatus_dictText' |
| | | }, |
| | | { |
| | | title: '维修类å', |
| | |
| | | dataIndex: 'repairType' |
| | | }, |
| | | { |
| | | title: '计åå¼å§æ¶é´', |
| | | title:'ç³è¯·äºº', |
| | | align:"center", |
| | | dataIndex: 'planStartTime' |
| | | dataIndex: 'applicant_dictText' |
| | | }, |
| | | { |
| | | title: '计åç»ææ¶é´', |
| | | title:'ç³è¯·è½¦é´', |
| | | align:"center", |
| | | dataIndex: 'planEndTime' |
| | | dataIndex: 'applicantProduction_dictText' |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®ç¼ç ', |
| | | title:'计åå¼å§æ¥æ', |
| | | align:"center", |
| | | dataIndex: 'repairCode' |
| | | dataIndex: 'planStartDate' |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®åç§°', |
| | | title:'计åç»ææ¥æ', |
| | | align:"center", |
| | | dataIndex: 'repairName' |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®ç¶æ', |
| | | align:"center", |
| | | dataIndex: 'repairStatus' |
| | | dataIndex: 'planEndDate' |
| | | }, |
| | | { |
| | | title: 'å®é
å¼å§æ¶é´', |
| | |
| | | align:"center", |
| | | dataIndex: 'totalAmount' |
| | | }, |
| | | { |
| | | title: 'éä»¶', |
| | | align:"center", |
| | | dataIndex: 'attachment' |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®æè¿°', |
| | | align:"center", |
| | | dataIndex: 'repairDescription' |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®æ¹å¼', |
| | | align:"center", |
| | | dataIndex: 'repairMethod' |
| | | }, |
| | | { |
| | | title: 'å§å¤å
¬å¸', |
| | | align:"center", |
| | | dataIndex: 'outsourcedCompany' |
| | | }, |
| | | // { |
| | | // title:'æ
éæè¿°', |
| | | // align:"center", |
| | | // dataIndex: 'faultDescription' |
| | | // }, |
| | | // { |
| | | // title:'ç³è¯·åå ', |
| | | // align:"center", |
| | | // dataIndex: 'applicantReason' |
| | | // }, |
| | | { |
| | | title: '责任人', |
| | | align:"center", |
| | | dataIndex: 'responsiblePerson' |
| | | dataIndex: 'responsiblePerson_dictText' |
| | | }, |
| | | { |
| | | title:'夿³¨', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | scopedSlots: { customRender: 'action' }, |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamMajorPartialRepair/list", |
| | | delete: "/eam/eamMajorPartialRepair/delete", |
| | | deleteBatch: "/eam/eamMajorPartialRepair/deleteBatch", |
| | | exportXlsUrl: "eam/eamMajorPartialRepair/exportXls", |
| | | exportXlsUrl: "/eam/eamMajorPartialRepair/exportXls", |
| | | importExcelUrl: "eam/eamMajorPartialRepair/importExcel", |
| | | submit: "eam/eamMajorPartialRepair/submit", |
| | | submitBatch: "eam/eamMajorPartialRepair/submitBatch", |
| | | confirm: "eam/eamMajorPartialRepair/confirm", |
| | | confirmBatch: "eam/eamMajorPartialRepair/confirmBatch", |
| | | repeal: "eam/eamMajorPartialRepair/repeal", |
| | | repealBatch: "eam/eamMajorPartialRepair/repealBatch" |
| | | }, |
| | | planDateRange: [], |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | |
| | | searchReset() { |
| | | this.planDateRange = [] |
| | | this.queryParam = {} |
| | | this.loadData(1); |
| | | }, |
| | | selectDateChange(value, dateString) { |
| | | if (dateString && dateString.length === 2) { |
| | | this.queryParam.planStartDate = dateString[0] |
| | | this.queryParam.planEndDate = dateString[1] |
| | | } |
| | | }, |
| | | handleFill(record) { |
| | | this.$refs.modalDetailForm.open(record); |
| | | this.$refs.modalDetailForm.title = "å¡«æ¥"; |
| | | this.$refs.modalDetailForm.disableSubmit = false; |
| | | }, |
| | | handleSubmit(id) { |
| | | getAction(this.url.submit,{id:id}).then((res)=>{ |
| | | if(res.success){ |
| | | this.loadData(); |
| | | this.$message.success(res.message); |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }) |
| | | }, |
| | | handleConfirm(id) { |
| | | getAction(this.url.confirm,{id:id}).then((res)=>{ |
| | | if(res.success){ |
| | | this.loadData(); |
| | | this.$message.success(res.message); |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }) |
| | | }, |
| | | batchSubmit() { |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'è¯·éæ©ä¸æ¡è®°å½' |
| | | }) |
| | | return |
| | | } else { |
| | | var ids = '' |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ',' |
| | | } |
| | | var that = this |
| | | this.$confirm({ |
| | | title: '确认æäº¤', |
| | | content: 'æ¯å¦æäº¤é䏿°æ®ï¼åªæå¾
æäº¤ç¶æçæ°æ®æå¯æäº¤æå?', |
| | | onOk: function () { |
| | | that.loading = true |
| | | getAction(that.url.submitBatch, { ids: ids }).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | // that.$message.success(res.message); |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.loadData() |
| | | that.onClearSelected() |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | batchConfirm() { |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'è¯·éæ©ä¸æ¡è®°å½' |
| | | }) |
| | | return |
| | | } else { |
| | | var ids = '' |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ',' |
| | | } |
| | | var that = this |
| | | this.$confirm({ |
| | | title: 'æ¯å¦ç¡®è®¤', |
| | | content: 'æ¯å¦ç¡®è®¤é䏿°æ®ï¼åªæå¾
ç¡®è®¤ç¶æçæ°æ®æå¯ç¡®è®¤æå?', |
| | | onOk: function () { |
| | | that.loading = true |
| | | getAction(that.url.confirmBatch, { ids: ids }).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | // that.$message.success(res.message); |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.loadData() |
| | | that.onClearSelected() |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | batchRepeal() { |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'è¯·éæ©ä¸æ¡è®°å½' |
| | | }) |
| | | return |
| | | } else { |
| | | var ids = '' |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ',' |
| | | } |
| | | var that = this |
| | | this.$confirm({ |
| | | title: 'æ¯å¦ä½åº', |
| | | content: 'æ¯å¦ä½åºé䏿°æ®ï¼åªæå¾
æäº¤ç¶æçæ°æ®æå¯ä½åºæå?', |
| | | onOk: function () { |
| | | that.loading = true |
| | | getAction(that.url.repealBatch, { ids: ids }).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | // that.$message.success(res.message); |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.loadData() |
| | | that.onClearSelected() |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'repairCode',text:'ç»´ä¿®ç¼ç ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'repairName',text:'项ç®åç§°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'repairStatus',text:'ç»´ä¿®ç¶æ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'repairType',text:'维修类å',dictCode:''}) |
| | | fieldList.push({type:'string',value:'applicant',text:'ç³è¯·äºº',dictCode:''}) |
| | | fieldList.push({type:'string',value:'applicantProduction',text:'ç³è¯·è½¦é´',dictCode:''}) |
| | | fieldList.push({type:'date',value:'planStartDate',text:'计åå¼å§æ¥æ'}) |
| | | fieldList.push({type:'date',value:'planEndDate',text:'计åç»ææ¥æ'}) |
| | | fieldList.push({type:'date',value:'actualStartTime',text:'å®é
å¼å§æ¶é´'}) |
| | | fieldList.push({type:'date',value:'actualEndTime',text:'å®é
ç»ææ¶é´'}) |
| | | fieldList.push({type:'BigDecimal',value:'totalAmount',text:'æ»éé¢',dictCode:''}) |
| | | fieldList.push({type:'string',value:'faultDescription',text:'æ
éæè¿°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'applicantReason',text:'ç³è¯·åå ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'responsiblePerson',text:'责任人',dictCode:''}) |
| | | fieldList.push({type:'string',value:'remark',text:'夿³¨',dictCode:''}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | | :rowSelection="false" |
| | | :bordered="false" |
| | | :alwaysEdit="true" |
| | | :toolbar="false" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="equipmentColumns" |
| | | style="margin-top: 8px;" /> |
| | | |
| | | </j-modal> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import { getAction, postAction } from '../../../../api/manage' |
| | | |
| | | export default { |
| | | name: 'EamMajorPartialRepairDetailModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | data() { |
| | | return { |
| | | title: '', |
| | | width: 1200, |
| | | visible: false, |
| | | disableSubmit: false, |
| | | equipmentOptions: [], |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [] |
| | | }, |
| | | url: { |
| | | queryDetailList: '/eam/eamMajorPartialRepairDetail/list', |
| | | fillResult: '/eam/eamMajorPartialRepair/fillResult' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | equipmentColumns() { |
| | | return [ |
| | | { |
| | | title: '设å¤', |
| | | key: 'equipmentId_dictText', |
| | | type: JVXETypes.normal, |
| | | width: '25%', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'åä»·', |
| | | key: 'unitPrice', |
| | | type: JVXETypes.normal, |
| | | width: '10%', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®ç»æ', |
| | | key: 'repairResult', |
| | | type: JVXETypes.textarea, |
| | | width: '30%', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: 'ç»´ä¿®ç»æä¸è½ä¸ºç©ºï¼' }] |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®æè¿°', |
| | | key: 'repairDescription', |
| | | type: JVXETypes.textarea, |
| | | width: '30%', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: 'ç»´ä¿®æè¿°ä¸è½ä¸ºç©ºï¼' }] |
| | | } |
| | | ]; |
| | | } |
| | | }, |
| | | methods: { |
| | | open(record) { |
| | | this.visible = true |
| | | getAction(this.url.queryDetailList, { repairId: record.id }).then((res) => { |
| | | if (res.success) { |
| | | if (res.result.total) { |
| | | this.detail.dataSource = res.result.records |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | async handleOk() { |
| | | // ð 触åè¡¨æ ¼æ ¡éª |
| | | const errMap = await this.$refs.editableDetailTable.validateTable(); |
| | | |
| | | if (errMap) { |
| | | return; |
| | | } |
| | | |
| | | // æ ¡éªéè¿ï¼è·åè¡¨æ ¼æ°æ® |
| | | const tableData = this.$refs.editableDetailTable.getTableData(); |
| | | |
| | | postAction(this.url.fillResult, tableData).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | // ð æäº¤æååå
³éå¼¹çª |
| | | this.submitCallback(); |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.visible = false |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="8"> |
| | | <a-form-model-item label="ç»´ä¿®ç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairCode"> |
| | | <a-input v-model="model.repairCode" placeholder="ç³»ç»èªå¨çæ" disabled ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="项ç®åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairName"> |
| | | <a-input v-model="model.repairName" placeholder="请è¾å
¥é¡¹ç®åç§°" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8" v-if="disabled"> |
| | | <a-form-model-item label="ç»´ä¿®ç¶æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairStatus"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©ç»´ä¿®ç¶æ" v-model="model.repairStatus" dictCode="major_partial_repair_status" disabled/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="维修类å" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairType"> |
| | | <a-select v-model="model.repairType" placeholder="è¯·éæ©ç»´ä¿®ç±»å"> |
| | | <a-select-option value="大修">大修</a-select-option> |
| | | <a-select-option value="项修">项修</a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="ç³è¯·äºº" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant"> |
| | | <j-search-select-tag placeholder="è¯·éæ©ç³è¯·äºº" v-model="model.applicant" dict="sys_user,realname, username, del_flag=0 and status=1"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="ç³è¯·è½¦é´" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicantProduction"> |
| | | <a-tree-select v-model="model.applicantProduction" |
| | | style="width: 100%" |
| | | :tree-data="treeData" |
| | | :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" |
| | | placeholder="è¯·éæ©ç³è¯·è½¦é´" |
| | | allow-clear |
| | | tree-default-expand-all |
| | | > |
| | | </a-tree-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="计åå¼å§æ¥æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planStartDate"> |
| | | <j-date placeholder="è¯·éæ©è®¡åå¼å§æ¥æ" v-model="model.planStartDate" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="计åç»ææ¥æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planEndDate"> |
| | | <j-date placeholder="è¯·éæ©è®¡åç»ææ¥æ" v-model="model.planEndDate" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8" v-if="disabled"> |
| | | <a-form-model-item label="å®é
å¼å§æ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualStartTime"> |
| | | <j-date :show-time="true" dateFormat="YYYY-MM-DD HH" placeholder="è¯·éæ©å®é
å¼å§æ¶é´" v-model="model.actualStartTime" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8" v-if="disabled"> |
| | | <a-form-model-item label="å®é
ç»ææ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualEndTime"> |
| | | <j-date :show-time="true" dateFormat="YYYY-MM-DD HH" placeholder="è¯·éæ©å®é
ç»ææ¶é´" v-model="model.actualEndTime" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8" v-if="disabled"> |
| | | <a-form-model-item label="æ»éé¢" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalAmount"> |
| | | <a-input-number :min=0 :precision="2" v-model="model.totalAmount" placeholder="请è¾å
¥æ»éé¢" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="ç³è¯·åå " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicantReason"> |
| | | <a-input v-model="model.applicantReason" placeholder="请è¾å
¥ç³è¯·åå " ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responsiblePerson"> |
| | | <j-search-select-tag placeholder="è¯·éæ©è´£ä»»äºº" v-model="model.responsiblePerson" dict="sys_user,realname, username, del_flag=0 and status=1"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="æ
éæè¿°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultDescription"> |
| | | <a-textarea v-model="model.faultDescription" placeholder="请è¾å
¥æ
éæè¿°" ></a-textarea> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-textarea v-model="model.remark" placeholder="请è¾å
¥å¤æ³¨" ></a-textarea> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane key="1" tab="ç»´ä¿®æç»"> |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :bordered="true" |
| | | :alwaysEdit="true" |
| | | :toolbar="true" |
| | | :toolbar-config="detailToolbarConfig" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="equipmentColumns" |
| | | style="margin-top: 8px;"/> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | |
| | | export default { |
| | | name: 'EamMajorPartialRepairForm', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 7 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | repairName: { required: true, message: '请è¾å
¥é¡¹ç®åç§°!' }, |
| | | repairType: { required: true, message: 'è¯·éæ©ç»´ä¿®ç±»å!' }, |
| | | applicant: { required: true, message: 'è¯·éæ©ç³è¯·äºº!' }, |
| | | applicantProduction: { required: true, message: '请è¾å
¥ç³è¯·è½¦é´!' }, |
| | | planStartDate: { required: true, message: 'è¯·éæ©è®¡åå¼å§æ¥æ!' }, |
| | | planEndDate: { required: true, message: 'è¯·éæ©è®¡åç»ææ¥æ!' }, |
| | | applicantReason: { required: true, message: '请è¾å
¥ç³è¯·åå !' }, |
| | | responsiblePerson: { required: true, message: '请è¾å
¥è´£ä»»äºº!' }, |
| | | faultDescription: { required: true, message: '请è¾å
¥æ
éæè¿°!' } |
| | | }, |
| | | treeData: [], |
| | | equipmentOptions: [], |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | | }, |
| | | url: { |
| | | add: "/eam/eamMajorPartialRepair/add", |
| | | edit: "/eam/eamMajorPartialRepair/edit", |
| | | queryById: "/eam/eamMajorPartialRepair/queryById", |
| | | queryDetailList: "/eam/eamMajorPartialRepairDetail/list", |
| | | queryEquipmentList: "/eam/equipment/asyncLoadEquipment", |
| | | loadWorkShopOptions:'/mdc/mdcProduction/loadProductionTreeOptions' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | detailToolbarConfig() { |
| | | return { |
| | | // 妿æ¯è¯¦æ
页ï¼å䏿¾ç¤º add æé® |
| | | btns: this.disabled ? ['remove', 'clearSelection'] : ['add', 'remove', 'clearSelection'], |
| | | slots: ['prefix', 'suffix'] |
| | | }; |
| | | }, |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | equipmentColumns() { |
| | | return [ |
| | | { |
| | | title: '设å¤', |
| | | key: 'equipmentId', |
| | | type: JVXETypes.select, |
| | | options: this.equipmentOptions, |
| | | width: '20%', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: '设å¤ä¸è½ä¸ºç©ºï¼' }] |
| | | }, |
| | | { |
| | | title: 'åä»·', |
| | | key: 'unitPrice', |
| | | type: JVXETypes.inputNumber, |
| | | width: '10%', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: 'åä»·ä¸è½ä¸ºç©ºï¼' }] |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®ç»æ', |
| | | key: 'repairResult', |
| | | type: JVXETypes.textarea, |
| | | width: '20%', |
| | | align: 'center', |
| | | visible: this.disabled |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®æè¿°', |
| | | key: 'repairDescription', |
| | | type: JVXETypes.textarea, |
| | | width: '30%', |
| | | align: 'center', |
| | | visible: this.disabled |
| | | } |
| | | ]; |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | this.loadWorkShopTree() |
| | | }, |
| | | methods: { |
| | | loadWorkShopTree() { |
| | | //å 载车é´éæ©æ |
| | | getAction(this.url.loadWorkShopOptions).then(res => { |
| | | if (res.success) { |
| | | this.treeData = [...res.result] |
| | | }else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | add () { |
| | | this.edit(this.modelDefault) |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true |
| | | if (this.model.id) { |
| | | getAction(this.url.queryDetailList, { repairId: this.model.id }).then((res) => { |
| | | if (res.success) { |
| | | console.log(res.result) |
| | | if (res.result.total) { |
| | | this.detail.dataSource = res.result.records |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | getAction(this.url.queryEquipmentList, {}).then((res) => { |
| | | if (res.success) { |
| | | this.equipmentOptions = res.result.map(item => { |
| | | return { |
| | | label: item.text, |
| | | value: item.value |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | submitForm () { |
| | | 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'; |
| | | } |
| | | const detailList = this.$refs.editableDetailTable.getTableData() |
| | | if (detailList.length === 0 || !detailList[0].equipmentId) { |
| | | this.$message.warning('请添å ç»´ä¿®æç»ï¼') |
| | | that.confirmLoading = false; |
| | | return |
| | | } |
| | | this.model.eamMajorPartialRepairDetailList = this.$refs.editableDetailTable.getTableData() |
| | | 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; |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="800" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag" label="å 餿 è®°"> |
| | | <a-input-number v-model="model.delFlag"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设å¤ID"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ID" v-model="model.equipmentId" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairType" label="维修类å"> |
| | | <a-input placeholder="请è¾å
¥ç»´ä¿®ç±»å" v-model="model.repairType" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planStartTime" label="计åå¼å§æ¶é´"> |
| | | <a-input placeholder="请è¾å
¥è®¡åå¼å§æ¶é´" v-model="model.planStartTime" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planEndTime" label="计åç»ææ¶é´"> |
| | | <a-input placeholder="请è¾å
¥è®¡åç»ææ¶é´" v-model="model.planEndTime" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairCode" label="ç»´ä¿®ç¼ç "> |
| | | <a-input placeholder="请è¾å
¥ç»´ä¿®ç¼ç " v-model="model.repairCode" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairName" label="ç»´ä¿®åç§°"> |
| | | <a-input placeholder="请è¾å
¥ç»´ä¿®åç§°" v-model="model.repairName" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairStatus" label="ç»´ä¿®ç¶æ"> |
| | | <a-input placeholder="请è¾å
¥ç»´ä¿®ç¶æ" v-model="model.repairStatus" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualStartTime" label="å®é
å¼å§æ¶é´"> |
| | | <a-input placeholder="请è¾å
¥å®é
å¼å§æ¶é´" v-model="model.actualStartTime" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualEndTime" label="å®é
ç»ææ¶é´"> |
| | | <a-input placeholder="请è¾å
¥å®é
ç»ææ¶é´" v-model="model.actualEndTime" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalAmount" label="æ»éé¢"> |
| | | <a-input placeholder="请è¾å
¥æ»éé¢" v-model="model.totalAmount" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="attachment" label="éä»¶"> |
| | | <a-input placeholder="请è¾å
¥éä»¶" v-model="model.attachment" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairDescription" label="ç»´ä¿®æè¿°"> |
| | | <a-input placeholder="请è¾å
¥ç»´ä¿®æè¿°" v-model="model.repairDescription" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairMethod" label="ç»´ä¿®æ¹å¼"> |
| | | <a-input placeholder="请è¾å
¥ç»´ä¿®æ¹å¼" v-model="model.repairMethod" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outsourcedCompany" label="å§å¤å
¬å¸"> |
| | | <a-input placeholder="请è¾å
¥å§å¤å
¬å¸" v-model="model.outsourcedCompany" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responsiblePerson" label="责任人"> |
| | | <a-input placeholder="请è¾å
¥è´£ä»»äºº" v-model="model.responsiblePerson" /> |
| | | </a-form-model-item> |
| | | |
| | | </a-form-model> |
| | | </a-spin> |
| | | <eam-major-partial-repair-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></eam-major-partial-repair-form> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import moment from "moment" |
| | | |
| | | import EamMajorPartialRepairForm from './EamMajorPartialRepairForm' |
| | | export default { |
| | | name: "EamMajorPartialRepairModal", |
| | | name: 'EamMajorPartialRepairModal', |
| | | components: { |
| | | EamMajorPartialRepairForm |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | title:'', |
| | | width:1200, |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules:{ |
| | | }, |
| | | url: { |
| | | add: "/eam/eamMajorPartialRepair/add", |
| | | edit: "/eam/eamMajorPartialRepair/edit", |
| | | }, |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | //åå§åé»è®¤å¼ |
| | | this.edit({}); |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.add(); |
| | | }) |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.edit(record); |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | httpAction(httpurl,this.model,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } |
| | | }) |
| | | this.$refs.realForm.submitForm(); |
| | | }, |
| | | submitCallback(){ |
| | | this.$emit('ok'); |
| | | this.visible = false; |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |