¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | <a-select |
| | | showSearch |
| | | labelInValue |
| | | :disabled="disabled" |
| | | :getPopupContainer="getParentContainer" |
| | | @search="loadData" |
| | | :placeholder="placeholder" |
| | | v-model="selectedAsyncValue" |
| | | style="width: 100%" |
| | | :filterOption="false" |
| | | @change="handleAsyncChange" |
| | | allowClear |
| | | :notFoundContent="loading ? undefined : null" |
| | | mode="default" |
| | | > |
| | | <template #suffixIcon> |
| | | <a-icon type="search" /> |
| | | </template> |
| | | <a-spin v-if="loading" slot="notFoundContent" size="small" /> |
| | | <a-select-option v-for="d in options" :key="d.value" :value="d.value">{{ d.text }}</a-select-option> |
| | | </a-select> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import debounce from 'lodash/debounce' |
| | | import { getAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'MaintenanceEquipmentSelect', |
| | | props: { |
| | | disabled: Boolean, |
| | | value: [String, Number], |
| | | placeholder: { |
| | | type: String, |
| | | default: 'è¯·éæ©', |
| | | required: false |
| | | }, |
| | | pageSize: { |
| | | type: Number, |
| | | default: 20, |
| | | required: false |
| | | }, |
| | | }, |
| | | data() { |
| | | this.loadData = debounce(this.loadData, 800)//æ¶æ |
| | | this.lastLoad = 0 |
| | | return { |
| | | loading: false, |
| | | selectedValue: undefined, |
| | | selectedAsyncValue: undefined, |
| | | options: [] |
| | | } |
| | | }, |
| | | created() { |
| | | // this.initDictData() |
| | | }, |
| | | watch: { |
| | | 'value': { |
| | | immediate: true, |
| | | handler(val) { |
| | | if (!val) { |
| | | this.initDictData(); |
| | | } else { |
| | | this.initSelectValue() |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | initSelectValue() { |
| | | if(!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key!=this.value){ |
| | | console.log("è¿æè¯·æ±åå°") |
| | | getAction(`/eam/maintenanceStandard/listByUser`, { id: this.value }).then(res=>{ |
| | | if(res.success){ |
| | | if(res.result && res.result.length > 0){ |
| | | let obj = { |
| | | key : this.value, |
| | | label: res.result[0].text |
| | | } |
| | | this.selectedAsyncValue = {...obj}; |
| | | } |
| | | this.options = res.result; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | loadData(value) { |
| | | console.log('æ°æ®å è½½', value) |
| | | this.lastLoad += 1 |
| | | const currentLoad = this.lastLoad |
| | | this.options = [] |
| | | this.loading = true |
| | | // åå
¸codeæ ¼å¼ï¼table,text,code |
| | | getAction(`/eam/maintenanceStandard/listByUser`, { keyword: value, pageSize: this.pageSize }).then(res => { |
| | | this.loading = false |
| | | if (res.success) { |
| | | if (currentLoad != this.lastLoad) { |
| | | return |
| | | } |
| | | this.options = res.result |
| | | console.log('ææ¯ç¬¬ä¸ä¸ª', res) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | |
| | | }) |
| | | |
| | | }, |
| | | initDictData() { |
| | | //弿¥ä¸å¼å§ä¹å è½½ä¸ç¹æ°æ® |
| | | this.loading = true |
| | | getAction(`/eam/maintenanceStandard/listByUser`, { pageSize: this.pageSize, keyword: '' }).then(res => { |
| | | this.loading = false |
| | | if (res.success) { |
| | | this.options = [...res.result] |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | }, |
| | | handleAsyncChange(selectedObj) { |
| | | //update-begin-author:scott date:20201222 for:ãæç´¢ãæç´¢æ¥è¯¢ç»ä»¶ï¼å 餿¡ä»¶ï¼é»è®¤ä¸æè¿æ¯ä¸æ¬¡çç¼åæ°æ®ï¼ä¸å¥½ JT-191 |
| | | if (selectedObj) { |
| | | this.selectedAsyncValue = selectedObj |
| | | //update-begin---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é------------ |
| | | this.selectedValue = selectedObj.key |
| | | //update-end---author:wangshuai ---date:20221115 forï¼[issues/4213]JSearchSelectTagæ¹é æ¯æå¤é------------ |
| | | } else { |
| | | this.selectedAsyncValue = null |
| | | this.selectedValue = null |
| | | this.options = null |
| | | this.loadData('') |
| | | } |
| | | this.callback() |
| | | //update-end-author:scott date:20201222 for:ãæç´¢ãæç´¢æ¥è¯¢ç»ä»¶ï¼å 餿¡ä»¶ï¼é»è®¤ä¸æè¿æ¯ä¸æ¬¡çç¼åæ°æ®ï¼ä¸å¥½ JT-191 |
| | | }, |
| | | callback() { |
| | | this.$emit('change', this.selectedValue) |
| | | }, |
| | | getParentContainer(node) { |
| | | if (typeof this.getPopupContainer === 'function') { |
| | | return this.getPopupContainer(node) |
| | | } else if (!this.popContainer) { |
| | | return node.parentNode |
| | | } else { |
| | | return document.querySelector(this.popContainer) |
| | | } |
| | | } |
| | | |
| | | }, |
| | | model: { |
| | | prop: 'value', |
| | | event: 'change' |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </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-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="å·¥åå·"> |
| | | <a-input placeholder="请è¾å
¥å·¥åå·" v-model="queryParam.orderNum"></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> |
| | | </a-col> |
| | | <template v-if="toggleSearchStatus"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç¹æ£æ¥æ"> |
| | | <j-date placeholder="è¯·éæ©ç¹æ£æ¥æ" v-model="queryParam.inspectionDate"></j-date> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç¹æ£æ¶é´"> |
| | | <j-date placeholder="è¯·éæ©ç¹æ£æ¶é´" v-model="queryParam.operateTime"></j-date> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <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> |
| | | <a @click="handleToggleSearch" style="margin-left: 8px"> |
| | | {{ toggleSearchStatus ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
| | | </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('eam_inspection_order')">导åº</a-button>--> |
| | | <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> |
| | | <!-- <a-button type="primary" icon="import">导å
¥</a-button>--> |
| | | <!-- </a-upload>--> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @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-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>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"></eam-inspection-order-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EamInspectionOrderModal from './modules/EamInspectionOrderModal' |
| | | |
| | | export default { |
| | | name: 'EamInspectionOrderList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | EamInspectionOrderModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'eam_inspection_order管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'å·¥åå·', |
| | | align:"center", |
| | | dataIndex: 'orderNum' |
| | | }, |
| | | { |
| | | title:'设å¤ç¼å·', |
| | | align:"center", |
| | | dataIndex: 'equipmentId' |
| | | }, |
| | | { |
| | | title:'æ åç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'standardId' |
| | | }, |
| | | { |
| | | title:'ç¹æ£æ¥æ', |
| | | align:"center", |
| | | dataIndex: 'inspectionDate', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'ç¹æ£æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'operateTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'ç¹æ£äºº', |
| | | align:"center", |
| | | dataIndex: 'operator' |
| | | }, |
| | | { |
| | | title:'ç¹æ£è¿ææ¶é´', |
| | | align:"center", |
| | | dataIndex: 'expirationTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'å建æ¹å¼', |
| | | align:"center", |
| | | dataIndex: 'creationMethod' |
| | | }, |
| | | { |
| | | title:'ç¹æ£ç¶æ', |
| | | align:"center", |
| | | dataIndex: 'inspectionStatus_dictText' |
| | | }, |
| | | { |
| | | title:'çç»é¿ç¡®è®¤', |
| | | align:"center", |
| | | dataIndex: 'confirmUser' |
| | | }, |
| | | { |
| | | title:'确认æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'confirmTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'夿³¨', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamInspectionOrder/list", |
| | | delete: "/eam/eamInspectionOrder/delete", |
| | | deleteBatch: "/eam/eamInspectionOrder/deleteBatch", |
| | | exportXlsUrl: "/eam/eamInspectionOrder/exportXls", |
| | | importExcelUrl: "eam/eamInspectionOrder/importExcel", |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'orderNum',text:'å·¥åå·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentId',text:'设å¤ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'standardId',text:'æ åID',dictCode:''}) |
| | | fieldList.push({type:'date',value:'inspectionDate',text:'ç¹æ£æ¥æ'}) |
| | | fieldList.push({type:'date',value:'operateTime',text:'ç¹æ£æ¶é´'}) |
| | | fieldList.push({type:'string',value:'operator',text:'ç¹æ£äºº',dictCode:''}) |
| | | fieldList.push({type:'date',value:'expirationTime',text:'ç¹æ£è¿ææ¶é´'}) |
| | | fieldList.push({type:'string',value:'creationMethod',text:'å建æ¹å¼',dictCode:''}) |
| | | fieldList.push({type:'string',value:'inspectionStatus',text:'ç¹æ£ç¶æ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'confirmUser',text:'设å¤ç®¡çå确认',dictCode:''}) |
| | | fieldList.push({type:'date',value:'confirmTime',text:'确认æ¶é´'}) |
| | | fieldList.push({type:'string',value:'remark',text:'夿³¨',dictCode:''}) |
| | | fieldList.push({type:'string',value:'imageFiles',text:'ç
§çæä»¶ids;id以éå·åé',dictCode:''}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </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="24"> |
| | | <a-form-model-item label="å 餿 è®°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> |
| | | <a-input-number v-model="model.delFlag" placeholder="请è¾å
¥å 餿 è®°" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="å·¥åID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId"> |
| | | <a-input v-model="model.orderId" placeholder="请è¾å
¥å·¥åID" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç¹æ£é¡¹ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="itemId"> |
| | | <a-input v-model="model.itemId" placeholder="请è¾å
¥ç¹æ£é¡¹ID" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç¹æ£ç»æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionResult"> |
| | | <a-input v-model="model.inspectionResult" placeholder="请è¾å
¥ç¹æ£ç»æ" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="å¼å¸¸æè¿°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="exceptionDescription"> |
| | | <a-input v-model="model.exceptionDescription" placeholder="请è¾å
¥å¼å¸¸æè¿°" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: 'EamInspectionOrderDetailForm', |
| | | components: { |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/eam/eamInspectionOrderDetail/add", |
| | | edit: "/eam/eamInspectionOrderDetail/edit", |
| | | queryById: "/eam/eamInspectionOrderDetail/queryById" |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | 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; |
| | | }, |
| | | 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'; |
| | | } |
| | | 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> |
| | | <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="24"> |
| | | <a-form-model-item label="å·¥åå·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum"> |
| | | <a-input v-model="model.orderNum" placeholder="请è¾å
¥å·¥åå·" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="设å¤ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> |
| | | <a-input v-model="model.equipmentId" placeholder="请è¾å
¥è®¾å¤ID" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="æ åID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardId"> |
| | | <a-input v-model="model.standardId" placeholder="请è¾å
¥æ åID" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç¹æ£æ¥æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> |
| | | <j-date placeholder="è¯·éæ©ç¹æ£æ¥æ" v-model="model.inspectionDate" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç¹æ£æ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime"> |
| | | <j-date placeholder="è¯·éæ©ç¹æ£æ¶é´" v-model="model.operateTime" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç¹æ£äºº" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator"> |
| | | <a-input v-model="model.operator" placeholder="请è¾å
¥ç¹æ£äºº" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç¹æ£è¿ææ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expirationTime"> |
| | | <j-date placeholder="è¯·éæ©ç¹æ£è¿ææ¶é´" v-model="model.expirationTime" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="å建æ¹å¼" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="creationMethod"> |
| | | <a-input v-model="model.creationMethod" placeholder="请è¾å
¥å建æ¹å¼" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç¹æ£ç¶æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionStatus"> |
| | | <j-dict-select-tag type="list" v-model="model.inspectionStatus" dictCode="" placeholder="è¯·éæ©ç¹æ£ç¶æ" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="设å¤ç®¡çå确认" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmUser"> |
| | | <a-input v-model="model.confirmUser" placeholder="请è¾å
¥è®¾å¤ç®¡çå确认" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="确认æ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime"> |
| | | <j-date placeholder="è¯·éæ©ç¡®è®¤æ¶é´" v-model="model.confirmTime" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-textarea v-model="model.remark" rows="4" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç
§çæä»¶" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imageFiles"> |
| | | <j-image-upload isMultiple v-model="model.imageFiles" ></j-image-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: 'EamInspectionOrderForm', |
| | | components: { |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/eam/eamInspectionOrder/add", |
| | | edit: "/eam/eamInspectionOrder/edit", |
| | | queryById: "/eam/eamInspectionOrder/queryById" |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | 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; |
| | | }, |
| | | 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'; |
| | | } |
| | | 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="1200" |
| | | :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 :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="æ åç¼ç "> |
| | | <a-input placeholder="ç¼ç ç³»ç»èªå¨çæ" v-model="model.standardCode" disabled /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设å¤ç¼å·"> |
| | | <MaintenanceEquipmentSelect placeholder="请è¾å
¥è®¾å¤ç¼å·æåç§°æç´¢" v-model="model.equipmentId" :disabled="editable"></MaintenanceEquipmentSelect> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="æ ååç§°"> |
| | | <a-input placeholder="请è¾å
¥æ ååç§°" disabled v-model="model.standardName" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="ç¹æ£æ¥æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> |
| | | <j-date placeholder="è¯·éæ©ç¹æ£æ¥æ" v-model="model.inspectionDate" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="ä¿å
»å¨æ"> |
| | | <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="ç¹æ£è¿ææ¶é´" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> |
| | | <j-date placeholder="è¯·éæ©ç¹æ£è¿ææ¶é´" v-model="model.expirationTime" disabled style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="夿³¨" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> |
| | | <a-textarea v-model="model.remark" rows="3" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | | :rowSelection="false" |
| | | :bordered="true" |
| | | :alwaysEdit="true" |
| | | :toolbar="false" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="detail.columns" |
| | | style="margin-top: 8px;"/> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' |
| | | |
| | | export default { |
| | | name: "EamMaintenanceStandardModal", |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | MaintenanceEquipmentSelect, |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | visible: false, |
| | | model: {}, |
| | | editable: false, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | standardName: [ |
| | | { required: true, message: '请è¾å
¥æ ååç§°!' } |
| | | ], |
| | | maintenanceCategory: [ |
| | | { required: true, message: 'è¯·éæ©ä¿å
»åç±»!' } |
| | | ], |
| | | initialDate: [ |
| | | { required: true, message: 'è¯·éæ©åå§æ¥æ!' } |
| | | ], |
| | | maintenancePeriod: [ |
| | | { required: true, message: '请è¾å
¥ä¿å
»å¨æï¼åä½ï¼å¤©!' } |
| | | ], |
| | | equipmentId: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/maintenanceStandard/add", |
| | | edit: "/eam/maintenanceStandard/edit", |
| | | detail: "/eam/eamMaintenanceStandardDetail/queryList", |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | key: 'itemCode', |
| | | width: '10%', |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹', |
| | | key: 'itemName', |
| | | width: '20%', |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'ä¿å
»è¦æ±', |
| | | key: 'itemDemand', |
| | | width: '30%', |
| | | align:"center", |
| | | }, |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.model = {}; |
| | | this.visible = true; |
| | | this.editable = false; |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.editable = true; |
| | | if(record && record.referenceFile) { |
| | | let obj = JSON.parse(record.referenceFile); |
| | | this.model.fileList = [obj]; |
| | | }else { |
| | | this.model.fieldList = []; |
| | | } |
| | | this.loadDetail(record.id); |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | async handleOk () { |
| | | const that = this; |
| | | let errMap = await that.$refs.editableDetailTable.validateTable(); |
| | | if(errMap){ |
| | | this.$message.warning("æ°æ®æ ¡éªå¤±è´¥ï¼"); |
| | | return; |
| | | } |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | let tableData = that.$refs.editableDetailTable.getTableData(); |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData(); |
| | | that.model.tableDetailList = [...tableData]; |
| | | that.model.removeDetailList = [...removeData]; |
| | | |
| | | 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'); |
| | | that.close(); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | //å 载详æ
æ°æ® |
| | | loadDetail(standardId) { |
| | | this.detail.dataSource = []; |
| | | if (standardId) { |
| | | getAction(this.url.detail, { standardId: standardId }).then(res => { |
| | | if (res.success) { |
| | | this.detail.dataSource = [...res.result]; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |