¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | title="åæ®ç¼ç å表" |
| | | :bordered="false" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="åæ®ç¼ç "> |
| | | <a-input |
| | | placeholder="请è¾å
¥åæ®ç¼ç " |
| | | v-model="queryParam.num" |
| | | ></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.name" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="10" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="çæ¬ç¶æ"> |
| | | <!-- button-style="solid" --> |
| | | <!-- size="small" --> |
| | | <a-radio-group |
| | | @change="onChange" |
| | | default-value="2" |
| | | v-model="queryParam.versionStatus" |
| | | > |
| | | <a-radio-button value="1"> |
| | | æªçæ |
| | | </a-radio-button> |
| | | <a-radio-button value="2"> |
| | | å·²çæ |
| | | </a-radio-button> |
| | | <a-radio-button value="3"> |
| | | 已失æ |
| | | </a-radio-button> |
| | | </a-radio-group> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <div class="table-operator"> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | <!-- v-has="'maintenanceCycle:add'" --> |
| | | <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-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item |
| | | key="1" |
| | | @click="batchDel" |
| | | ><a-icon type="delete" />å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> --> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div |
| | | class="ant-alert ant-alert-info" |
| | | style="margin-bottom: 16px" |
| | | > |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 |
| | | <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a |
| | | style="margin-left: 24px" |
| | | @click="onClearSelected" |
| | | >æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange" |
| | | > |
| | | <!-- :scroll="{ x: 'calc(950px + 50%)', y: 900 }" --> |
| | | <!-- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" --> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a |
| | | v-if="record.versionStatus == '2'" |
| | | @click="handleRevise(record)" |
| | | >åç</a> |
| | | <!-- v-has="'maintenanceCycle:revise'" --> |
| | | <a-divider type="vertical" /> |
| | | <a |
| | | v-if="record.versionStatus == '1'" |
| | | @click="handleTakeEffect(record)" |
| | | >çæ</a> |
| | | <!-- v-has="'maintenanceCycle:takeEffect'" --> |
| | | <a-divider type="vertical" /> |
| | | <a |
| | | v-if="record.versionStatus == '1'" |
| | | @click="handleEdit(record)" |
| | | >ç¼è¾</a> |
| | | <!-- v-has="'maintenanceCycle:edit'" --> |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm |
| | | v-if="record.versionStatus == '1'" |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <!-- v-has="'maintenanceCycle:delete'" --> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | |
| | | <sys-file-name-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></sys-file-name-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import SysFileNameModal from './modules/sysFileName/SysFileNameModal' |
| | | import { deleteAction, getAction, postAction, requestPut } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'SysFileNameList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | SysFileNameModal, |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'åæ®ç¼ç ', |
| | | model: {}, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | }, |
| | | { |
| | | title: 'åæ®åç§°', |
| | | align: 'center', |
| | | dataIndex: 'name_dictText', |
| | | }, |
| | | |
| | | { |
| | | title: 'åæ®ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'num', |
| | | }, |
| | | { |
| | | title: 'çæ¬', |
| | | align: 'center', |
| | | dataIndex: 'version', |
| | | }, |
| | | { |
| | | title: 'çæ¬ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'versionStatus_dictText', |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | align: 'center', |
| | | dataIndex: 'createBy', |
| | | }, |
| | | { |
| | | title: 'åå»ºæ¥æ', |
| | | align: 'center', |
| | | dataIndex: 'createTime', |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | ], |
| | | url: { |
| | | list: '/eam/sysFileName/list', |
| | | delete: '/eam/sysFileName/delete', |
| | | deleteBatch: '/eam/sysFileName/deleteBatch', |
| | | versionTakeEffect: "/eam/sysFileName/versionTakeEffect", |
| | | }, |
| | | visible: false, |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | //åç |
| | | handleRevise: function (record) { |
| | | this.$refs.modalForm.revise(record); |
| | | this.$refs.modalForm.title = "ä¿å
»å¨æè§åçæ¬å级"; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | }, |
| | | |
| | | //çæ |
| | | handleTakeEffect(record) { |
| | | const that = this; |
| | | that.confirmLoading = true; |
| | | this.$confirm({ |
| | | title: 'åæ®ç¼ç çæ¬çæï¼', |
| | | content: 'æç¤ºï¼çæ¬çæåä¸ä¸çæ¬å°èªå¨å¤±æï¼è¯·è°¨æ
æä½ï¼', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | requestPut(that.url.versionTakeEffect, { id: record.id, name: record.name, versionStatus: '2' }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("çæ¬çææåï¼") |
| | | that.loadData(1) |
| | | } else { |
| | | that.$message.warning("çæ¬çæå¤±è´¥ï¼") |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | }, |
| | | }) |
| | | }, |
| | | |
| | | onChange(e) { |
| | | this.queryParam.versionStatus = e.target.value; |
| | | this.loadData(); |
| | | }, |
| | | |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | //update-begin---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false; |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | <!-- :title="title" --> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <span |
| | | class="ant-descriptions-title" |
| | | style="font-size: large;font-size: 15px;float: right;" |
| | | >{{this.model.receiptsNum2}}</span> |
| | | <a-divider |
| | | orientation="center" |
| | | style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;" |
| | | > ç产设å¤ç²¾åº¦æ£éªå </a-divider> |
| | | > {{this.model.receiptsName2}} </a-divider> |
| | | <!-- ç产设å¤ç²¾åº¦æ£éªå --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-item |
| | |
| | | add: "/eam/precisionInspection/precisionInspection", |
| | | getPrecisionInspection: "/eam/precisionInspection/getPrecisionInspectionList", |
| | | list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId", |
| | | getSysFileName: "/eam/sysFileName/getSysFileName", |
| | | }, |
| | | |
| | | } |
| | |
| | | |
| | | edit(record) { |
| | | let that = this; |
| | | |
| | | if (record.receipts2 == "" || record.receipts2 == null) { |
| | | this.getSysFileName() |
| | | } |
| | | this.form.resetFields(); |
| | | // record.eachTolerance = '0' |
| | | // record.partTolerance = '0' |
| | |
| | | getAction(this.url.getPrecisionInspection, { maintenanceOrderId: this.model.id }).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result[0].precisionInspectionDetails |
| | | this.model = Object.assign({}, res.result[0]); |
| | | debugger |
| | | this.model = Object.assign(this.model, res.result[0]); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | }, |
| | | |
| | | getSysFileName() { |
| | | getAction(this.url.getSysFileName, { name: '16' }).then((res) => { |
| | | if (res.success) { |
| | | this.model = Object.assign(this.model, res.result[0]); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | <!-- :title="title" --> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <span |
| | | class="ant-descriptions-title" |
| | | style="font-size: large;font-size: 15px;float: right;" |
| | | >{{this.model.receiptsNum}}</span> |
| | | <a-divider |
| | | orientation="center" |
| | | style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;" |
| | | > ç产设å¤ä¸çº§ä¿å
»éªæ¶å </a-divider> |
| | | > {{this.model.receiptsName}} </a-divider> |
| | | <!-- ç产设å¤ä¸çº§ä¿å
»éªæ¶å --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-item |
| | |
| | | add: "/eam/maintenanceThreeAcceptance/add", |
| | | getMaintenance3Receipt: "/eam/maintenanceThreeAcceptance/getMaintenanceThreeAcceptanceList", |
| | | list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId", |
| | | getSysFileName: "/eam/sysFileName/getSysFileName", |
| | | }, |
| | | } |
| | | }, |
| | |
| | | |
| | | edit(record) { |
| | | let that = this; |
| | | debugger |
| | | if (record.receipts == "" || record.receipts == null) { |
| | | this.getSysFileName() |
| | | } |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | |
| | | } |
| | | }, |
| | | |
| | | getSysFileName() { |
| | | getAction(this.url.getSysFileName, { name: '19' }).then((res) => { |
| | | if (res.success) { |
| | | this.model = Object.assign(this.model, res.result[0]); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | <!-- :title="title" --> |
| | | <!-- <a-spin :spinning="confirmLoading"> --> |
| | | <!-- <a-form :form="form"> --> |
| | | <span |
| | | class="ant-descriptions-title" |
| | | style="font-size: large;font-size: 15px;float: right;" |
| | | >{{this.model.receiptsNum}}</span> |
| | | |
| | | <a-divider |
| | | orientation="center" |
| | | style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;" |
| | | > 温度ååæ§æ£æµæ¡ä»¶ç¡®è®¤è¡¨ </a-divider> |
| | | |
| | | > {{this.model.receiptsName}} </a-divider> |
| | | <!-- 温度ååæ§æ£æµæ¡ä»¶ç¡®è®¤è¡¨ --> |
| | | <!-- <div :style="{height: '115px',float: 'left',width: '100%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}"> --> |
| | | <span |
| | | class="ant-descriptions-title" |
| | |
| | | import pick from 'lodash.pick' |
| | | import JMultiSelectTag from '@/components/dict/JMultiSelectTag' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | // import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import { getFileAccessHttpUrl } from '@/api/manage'; |
| | | |
| | | export default { |
| | | name: "StoveCategoryModal", |
| | | mixins: [JeecgListMixin], |
| | | // mixins: [JeecgListMixin], |
| | | components: { |
| | | JMultiSelectTag, |
| | | Tooltip, |
| | |
| | | @cancel="handleCancel" |
| | | :confirmLoading="confirmLoading" |
| | | > |
| | | <!-- :title="title" --> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <span |
| | | class="ant-descriptions-title" |
| | | style="font-size: large;font-size: 15px;float: right;" |
| | | >{{this.model.receiptsNum}}</span> |
| | | <a-divider |
| | | orientation="center" |
| | | style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;" |
| | | > ç产设å¤äºçº§ä¿å
»å®å·¥ç§»äº¤å </a-divider> |
| | | > {{this.model.receiptsName}} </a-divider> |
| | | <!-- ç产设å¤äºçº§ä¿å
»å®å·¥ç§»äº¤å --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-item |
| | |
| | | codeDisable: true, |
| | | dataSource: [], |
| | | model: {}, |
| | | departs: [], |
| | | // departs: [], |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | |
| | | }, |
| | | }, |
| | | url: { |
| | | add: "/eam/dailyMaintenanceOrder/add", |
| | | // add: "/eam/dailyMaintenanceOrder/add", |
| | | edit: "/eam/dailyMaintenanceOrder/approve", |
| | | getSysDeparts: "/eam/dailyMaintenanceOrder/getSysDeparts", |
| | | getSysFileName: "/eam/sysFileName/getSysFileName", |
| | | list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId", |
| | | }, |
| | | |
| | |
| | | |
| | | edit(record) { |
| | | let that = this; |
| | | this.getSysDeparts() |
| | | if (record.receipts == "" || record.receipts == null) { |
| | | this.getSysFileName() |
| | | } |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | |
| | | }, |
| | | |
| | | |
| | | getSysDeparts() { |
| | | getAction(this.url.getSysDeparts).then((res) => { |
| | | getSysFileName() { |
| | | getAction(this.url.getSysFileName, { name: '15' }).then((res) => { |
| | | if (res.success) { |
| | | this.departs = res.result |
| | | this.model = Object.assign(this.model, res.result[0]); |
| | | } |
| | | }) |
| | | }, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="name" |
| | | > |
| | | <j-dict-select-tag |
| | | placeholder="è¯·éæ©åæ®åç§°" |
| | | :triggerChange="true" |
| | | dictCode="sys_file_name" |
| | | v-model="model.name" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="åæ®ç¼ç " |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="num" |
| | | > |
| | | <a-input |
| | | v-model="model.num" |
| | | placeholder="请è¾å
¥åæ®ç¼ç " |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <!-- <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="åæ®åç§°" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="name" |
| | | > |
| | | <a-input |
| | | v-model="model.name" |
| | | placeholder="请è¾å
¥åæ®åç§°" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> --> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="çæ¬" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="version" |
| | | > |
| | | <a-input |
| | | v-model="model.version" |
| | | placeholder="请è¾å
¥çæ¬å·" |
| | | :disabled=true |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row> |
| | | |
| | | <a-col |
| | | v-if=" model.isRevise == true" |
| | | :span="24" |
| | | > |
| | | <a-form-model-item |
| | | label="åå²çæ¬" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="version" |
| | | > |
| | | <a-input |
| | | v-model="model.historyVersion" |
| | | placeholder="请è¾å
¥åå²çæ¬" |
| | | :disabled=true |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </j-form-container> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction, requestPut } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import pick from 'lodash.pick' |
| | | import JMultiSelectTag from '@/components/dict/JMultiSelectTag' |
| | | |
| | | export default { |
| | | name: 'SysFileNameForm', |
| | | components: { JMultiSelectTag }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false, |
| | | }, |
| | | // enterpriseId: { |
| | | // type: String, |
| | | // default: '', |
| | | // required: false, |
| | | // }, |
| | | // version: { |
| | | // type: Number, |
| | | // required: false, |
| | | // }, |
| | | }, |
| | | data() { |
| | | return { |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | name: [ |
| | | { required: true, message: 'è¯·éæ©åæ®åç§°!' }, |
| | | ], |
| | | num: [ |
| | | { required: true, message: '请è¾å
¥åæ®ç¼ç !' }, |
| | | ], |
| | | version: [ |
| | | { required: true, message: '请è¾å
¥çæ¬å·!' }, |
| | | ], |
| | | }, |
| | | url: { |
| | | add: '/eam/sysFileName/add', |
| | | edit: '/eam/sysFileName/edit', |
| | | revise: '/eam/sysFileName/revise', |
| | | getReviseVersion: "/eam/sysFileName/getReviseVersion", |
| | | }, |
| | | } |
| | | }, |
| | | 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 |
| | | this.model.isRevise = false; |
| | | //ä¿®æ¹æ¶ |
| | | if (record.id) { |
| | | |
| | | //æ°å¢æ¶ |
| | | } else { |
| | | this.model.version = '1.0' |
| | | this.model.versionStatus = '1' |
| | | } |
| | | }, |
| | | |
| | | //åç |
| | | revise(record) { |
| | | let that = this; |
| | | that.visible = true; |
| | | that.model = Object.assign({}, record) |
| | | that.model.isRevise = true; |
| | | that.model.historyVersion = record.version |
| | | that.model.versionStatus = '1' |
| | | requestPut(that.url.getReviseVersion, record).then((res) => { |
| | | if (res.success) { |
| | | that.model.version = res.result; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | 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 { |
| | | if (this.model.isRevise) { |
| | | httpurl += this.url.revise |
| | | 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="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <sys-file-name-form |
| | | ref="realForm" |
| | | @ok="submitCallback" |
| | | :disabled="disableSubmit" |
| | | ></sys-file-name-form> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import SysFileNameForm from './SysFileNameForm' |
| | | export default { |
| | | name: 'SysFileNameModal', |
| | | components: { |
| | | SysFileNameForm |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | width: 650, |
| | | visible: false, |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add(); |
| | | }) |
| | | }, |
| | | edit(record) { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(record); |
| | | }) |
| | | }, |
| | | revise(record) { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.revise(record); |
| | | }) |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm(); |
| | | }, |
| | | submitCallback() { |
| | | this.$emit('ok'); |
| | | this.visible = false; |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |