1、看板页面图表完成100%
2、调整全局页脚
3、新增设备信息维护、零件与物料信息等页面
| | |
| | | import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | // -------------------------------------驱å¨åæ°ç®¡ç页é¢---------------------------------------- |
| | | // è·åæ§å¶ç³»ç»ç±»å |
| | | getDriveTypeApi: () => getAction('/mdc/mdcDriveTypeParamConfig/getDriveParamOptions'), |
| | | // -------------------------------------车é´çæ¿é¡µé¢-------------------------------------------- |
| | |
| | | <template> |
| | | <div class="footer"> |
| | | <div class="links"> |
| | | <a href="http://www.jeecg.com" target="_blank">JEECG é¦é¡µ</a> |
| | | <a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank"> |
| | | <a-icon type="github"/> |
| | | </a> |
| | | <a href="https://ant.design/">Ant Design</a> |
| | | <a href="https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/">Vue Antd</a> |
| | | </div> |
| | | <div class="copyright"> |
| | | Copyright |
| | | <a-icon type="copyright"/> |
| | | 2019 <span>JEECG弿ºç¤¾åº åºå</span> |
| | | 2024 <span>2015-2025 çµç§æºè½</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "LayoutFooter" |
| | | name: 'LayoutFooter' |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .footer { |
| | | padding: 0 16px; |
| | | margin: 48px 0 24px; |
| | | text-align: center; |
| | | |
| | | .links { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ç¼å·" v-model="queryParam.equipmentId"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="设å¤åç§°"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤åç§°" v-model="queryParam.equipmentName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="车é´åç§°"> |
| | | <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="è¯·éæ©è½¦é´" |
| | | :treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="驱å¨ç±»å"> |
| | | <a-auto-complete |
| | | v-model="queryParam.controlSystemType" |
| | | :data-source="driveTypeList" |
| | | placeholder="è¯·éæ©æ§å¶ç³»ç»ç±»å" |
| | | :filter-option="filterOption" |
| | | :allowClear="true" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <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-col> |
| | | </a-row> |
| | | </a-form> |
| | | </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" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :scroll="{x:'max-content',y:465}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | <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 href="javascript:;" @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> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <EquipmentInfoMaintenanceModal ref="modalForm" @ok="modalFormOk"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { queryProductionTreeList } from '@/api/api' |
| | | import { getAction } from '@/api/manage' |
| | | import EquipmentInfoMaintenanceModal from './modules/EquipmentInfoMaintenance/EquipmentInfoMaintenanceModal' |
| | | |
| | | export default { |
| | | name: 'EquipmentInfoMaintenance', |
| | | components: { EquipmentInfoMaintenanceModal }, |
| | | mixins: [JeecgListMixin], |
| | | data() { |
| | | return { |
| | | queryParam: {}, |
| | | url: { |
| | | list: '/mdc/mdcEquipment/list', |
| | | queryDriveType: '/mdc/mdcDriveTypeParamConfig/getDriveParamOptions' |
| | | }, |
| | | workshopTreeData: [], |
| | | treeDefaultExpandedKeys: [], |
| | | driveTypeList:[], |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '设å¤ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentId', |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | align: 'center', |
| | | width: 280, |
| | | dataIndex: 'equipmentName' |
| | | }, |
| | | { |
| | | title: '车é´', |
| | | align: 'center', |
| | | width: 280, |
| | | dataIndex: 'productionName' |
| | | }, |
| | | { |
| | | title: '驱å¨ç±»å', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'driveType' |
| | | }, |
| | | { |
| | | title: 'éç¹è®¾å¤æ è®°', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'isImportant' |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®æ è®°', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'maintainType' |
| | | }, |
| | | { |
| | | title: '空转å¯ç¨/åç¨', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'isSpace' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' }, |
| | | align: 'center', |
| | | width: 150, |
| | | fixed: 'right' |
| | | } |
| | | |
| | | ] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getWorkshopListByApi() |
| | | this.getDriveTypeByApi() |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è°ç¨æ¥å£è·åæ¥è¯¢åºåè½¦é´æ å表 |
| | | */ |
| | | getWorkshopListByApi() { |
| | | queryProductionTreeList().then(res => { |
| | | if (res.success) { |
| | | this.workshopTreeData = res.result |
| | | this.treeDefaultExpandedKeys = [...res.result].map(item => item.key) |
| | | } |
| | | }) |
| | | }, |
| | | /** |
| | | * è°ç¨æ¥å£è·åæ§å¶ç³»ç»ç±»å |
| | | */ |
| | | getDriveTypeByApi() { |
| | | getAction(this.url.queryDriveType).then((res) => { |
| | | this.driveTypeList = res.result.map(item => item.value) |
| | | }) |
| | | }, |
| | | /** |
| | | * èæ³è¾å
¥æ¡çéåè½ |
| | | * @param input è¾å
¥çå
容 |
| | | * @param option é
ç½® |
| | | * @returns {boolean} 夿æ¯å¦çé |
| | | */ |
| | | filterOption(input, option) { |
| | | return ( |
| | | option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 |
| | | ) |
| | | }, |
| | | |
| | | handleEdit: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | |
| | | // è°ç¨æ½å±è¡¨åç»ä»¶ä¸çæ¸
é¤è¡¨åéªè¯æ¹æ³ |
| | | this.$refs.modalForm.removeValidate() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card> |
| | | ç©ºè½¬æ°æ®ç»´æ¤ |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'IdleDataMaintenance', |
| | | components: {}, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="é¶ä»¶å·"> |
| | | <a-input placeholder="请è¾å
¥é¶ä»¶å·" v-model="queryParam.partsCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="ç©æå·"> |
| | | <a-input placeholder="请è¾å
¥ç©æå·" v-model="queryParam.materialCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="æ·»å æ¶é´"> |
| | | <a-date-picker style="width: 200px" v-model="queryParam.operateTime" format='YYYY-MM-DD' |
| | | valueFormat="YYYY-MM-DD"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <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-col> |
| | | </a-row> |
| | | |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" style="border-top: 5px"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('é¶ä»¶ä¸ç©æä¿¡æ¯')">导åº</a-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay" @click="handleMenuClick"> |
| | | <a-menu-item key="1"> |
| | | <a-icon type="delete" @click="batchDel"/> |
| | | å é¤ |
| | | </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" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :scroll="{x:'max-content',y:465}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | <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 href="javascript:;" @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> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <PartsAndMaterialInfoModal ref="modalForm" @ok="modalFormOk"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import PartsAndMaterialInfoModal from './modules/PartsAndMaterialInfo/PartsAndMaterialInfoModal' |
| | | |
| | | export default { |
| | | name: 'PartsAndMaterialInfo', |
| | | components: { PartsAndMaterialInfoModal }, |
| | | mixins: [JeecgListMixin], |
| | | data() { |
| | | return { |
| | | queryParam: {}, |
| | | url: { |
| | | list: '/mdc/mdcEquipment/list', |
| | | exportXlsUrl: '' |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'é¶ä»¶å·', |
| | | align: 'center', |
| | | dataIndex: 'partsCode', |
| | | width: 400 |
| | | }, |
| | | { |
| | | title: 'ç©æå·', |
| | | align: 'center', |
| | | width: 400, |
| | | dataIndex: 'materialCode' |
| | | }, |
| | | { |
| | | title: 'æ·»å æ¶é´', |
| | | align: 'center', |
| | | width: 400, |
| | | dataIndex: 'operateTime' |
| | | }, |
| | | { |
| | | title: 'æä½å', |
| | | align: 'center', |
| | | width: 350, |
| | | dataIndex: 'operator' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' }, |
| | | align: 'center', |
| | | width: 150, |
| | | fixed: 'right' |
| | | } |
| | | |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | handleAdd: function() { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = 'æ°å¢' |
| | | |
| | | // è°ç¨æ½å±è¡¨åç»ä»¶ä¸çæ¸
é¤è¡¨åéªè¯æ¹æ³ |
| | | this.$refs.modalForm.removeValidate() |
| | | }, |
| | | handleEdit: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | |
| | | // è°ç¨æ½å±è¡¨åç»ä»¶ä¸çæ¸
é¤è¡¨åéªè¯æ¹æ³ |
| | | this.$refs.modalForm.removeValidate() |
| | | }, |
| | | handleMenuClick(e) { |
| | | if (e.key == 1) { |
| | | this.batchDel() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :maskClosable="true" |
| | | :width="modalWidth" |
| | | @cancel="visible=false" |
| | | :visible="visible"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :form="form" :model="model" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="isImportant" label="éç¹è®¾å¤"> |
| | | <a-select v-model="model.isImportant"> |
| | | <a-select-option :value="1">æ®é</a-select-option> |
| | | <a-select-option :value="2">éç¹</a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="maintainType" label="维修设å¤"> |
| | | <a-select v-model="model.maintainType"> |
| | | <a-select-option :value="1">æ£å¸¸</a-select-option> |
| | | <a-select-option :value="2">大修,项修</a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | |
| | | |
| | | <template slot="footer"> |
| | | <a-popconfirm title="ç¡®å®æ¾å¼æä½ï¼" @confirm="visible=false" okText="ç¡®å®" cancelText="åæ¶"> |
| | | <a-button style="margin-right: .8rem">åæ¶</a-button> |
| | | </a-popconfirm> |
| | | <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">æäº¤</a-button> |
| | | </template> |
| | | |
| | | </a-modal> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import api from '@/api/mdc' |
| | | |
| | | export default { |
| | | name: 'EquipmentInfoMaintenanceModal', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | modalWidth: 700, |
| | | form: this.$form.createForm(this), |
| | | title: 'æä½', |
| | | visible: false, |
| | | model: { |
| | | isImportant: '', |
| | | maintainType: '' |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | confirmLoading: false |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.visible = true |
| | | this.model = { |
| | | partsCode: '', |
| | | materialCode: '' |
| | | } |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'isImportant', 'maintainType')) |
| | | }) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.visible = true |
| | | this.model = Object.assign({}, record) |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'isImportant', 'maintainType')) |
| | | }) |
| | | }, |
| | | |
| | | handleSubmit() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let obj |
| | | if (this.title == 'æ°å¢') { |
| | | obj = api.addParamThresholdApi(this.model) |
| | | } else { |
| | | obj = api.editParamThresholdApi(this.model) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | this.visible = false |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¼è¾ææ¥ç详æ
æ°æ®æ¶æ¸
餿½å±è¡¨åéªè¯ |
| | | */ |
| | | removeValidate() { |
| | | if (this.$refs.form) this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'IdleDataMaintenanceModal', |
| | | components: {}, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :maskClosable="true" |
| | | :width="modalWidth" |
| | | @cancel="visible=false" |
| | | :visible="visible"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol"> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="partsCode" label="é¶ä»¶å·"> |
| | | <a-input placeholder="请è¾å
¥é¶ä»¶å·" v-model="model.partsCode"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item prop="materialCode" label="ç©æå·"> |
| | | <a-input placeholder="请è¾å
¥ç©æå·" v-model="model.materialCode"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | |
| | | |
| | | <template slot="footer"> |
| | | <a-popconfirm title="ç¡®å®æ¾å¼æä½ï¼" @confirm="visible=false" okText="ç¡®å®" cancelText="åæ¶"> |
| | | <a-button style="margin-right: .8rem">åæ¶</a-button> |
| | | </a-popconfirm> |
| | | <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">æäº¤</a-button> |
| | | </template> |
| | | |
| | | </a-modal> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import api from '@/api/mdc' |
| | | |
| | | export default { |
| | | name: 'PartsAndMaterialInfoModal', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | modalWidth: 700, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | partsCode: [ |
| | | { |
| | | required: true, message: '请è¾å
¥é¶ä»¶å·' |
| | | } |
| | | ], |
| | | materialCode: [ |
| | | { |
| | | required: true, message: '请è¾å
¥ç©æå·' |
| | | } |
| | | ] |
| | | }, |
| | | title: 'æä½', |
| | | visible: false, |
| | | model: { |
| | | partsCode: '', |
| | | materialCode: '' |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | confirmLoading: false, |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.visible = true |
| | | this.model = { |
| | | partsCode: '', |
| | | materialCode: '' |
| | | } |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'partsCode', 'materialCode')) |
| | | }) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.visible = true |
| | | this.model = Object.assign({}, record) |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'partsCode', 'materialCode')) |
| | | }) |
| | | }, |
| | | |
| | | handleSubmit() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let obj |
| | | if (this.title == 'æ°å¢') { |
| | | obj = api.addParamThresholdApi(this.model) |
| | | } else { |
| | | obj = api.editParamThresholdApi(this.model) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | this.visible = false |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * ç¼è¾ææ¥ç详æ
æ°æ®æ¶æ¸
餿½å±è¡¨åéªè¯ |
| | | */ |
| | | removeValidate() { |
| | | if (this.$refs.form) this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |