art:设备管理-基础数据-精度参数维护 功能修改完善
| | |
| | | <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> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="参数编码"> |
| | | <a-input placeholder="请输入参数编码" v-model="queryParam.parameterCode"></a-input> |
| | | <j-input placeholder="请输入参数编码" v-model="queryParam.parameterCode"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <template v-if="toggleSearchStatus"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="检测项目"> |
| | | <a-input placeholder="请输入检测项目" v-model="queryParam.parameterName"></a-input> |
| | | <j-input placeholder="请输入检测项目" v-model="queryParam.parameterName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="参数分类"> |
| | | <j-dict-select-tag dict-code="precision_parameters_category" placeholder="请选择参数分类" v-model="queryParam.parameterCategory"></j-dict-select-tag> |
| | | </a-form-item> |
| | | </a-col> |
| | | <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> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
| | | </span> |
| | | </a-col> |
| | | |
| | |
| | | <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-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-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-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>项 |
| | | <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> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import '@/assets/less/TableExpand.less' |
| | | import EamPrecisionParametersModal from './modules/EamPrecisionParametersModal' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import '@/assets/less/TableExpand.less' |
| | | import EamPrecisionParametersModal from './modules/EamPrecisionParametersModal' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: "EamPrecisionParametersList", |
| | | mixins:[JeecgListMixin], |
| | | components: { |
| | | EamPrecisionParametersModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: '精度参数维护管理页面', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title: '删除标记', |
| | | align:"center", |
| | | dataIndex: 'delFlag' |
| | | }, |
| | | { |
| | | title: '参数编码', |
| | | align:"center", |
| | | dataIndex: 'parameterCode' |
| | | }, |
| | | { |
| | | title: '检测项目', |
| | | align:"center", |
| | | dataIndex: 'parameterName' |
| | | }, |
| | | { |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | scopedSlots: { customRender: 'action' }, |
| | | export default { |
| | | name: 'EamPrecisionParametersList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamPrecisionParametersModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: '精度参数维护管理页面', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamPrecisionParameters/list", |
| | | delete: "/eam/eamPrecisionParameters/delete", |
| | | deleteBatch: "/eam/eamPrecisionParameters/deleteBatch", |
| | | exportXlsUrl: "eam/eamPrecisionParameters/exportXls", |
| | | importExcelUrl: "eam/eamPrecisionParameters/importExcel", |
| | | }, |
| | | }, |
| | | { |
| | | title: '参数编码', |
| | | align: 'center', |
| | | dataIndex: 'parameterCode' |
| | | }, |
| | | { |
| | | title: '检测项目', |
| | | align: 'center', |
| | | dataIndex: 'parameterName' |
| | | }, |
| | | { |
| | | title: '参数分类', |
| | | align: 'center', |
| | | dataIndex: 'parameterCategory_dictText' |
| | | }, |
| | | { |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/eam/precisionParameters/list', |
| | | delete: '/eam/precisionParameters/delete', |
| | | deleteBatch: '/eam/precisionParameters/deleteBatch', |
| | | exportXlsUrl: 'eam/precisionParameters/exportXls', |
| | | importExcelUrl: 'eam/precisionParameters/importExcel' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | } |
| | | methods: {} |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="参数编码"> |
| | | <a-input placeholder="请输入参数编码" v-model="queryParam.parameterCode"></a-input> |
| | | <j-input placeholder="请输入参数编码" v-model="queryParam.parameterCode"></j-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.parameterName"></a-input> |
| | | <j-input placeholder="请输入参数名称" v-model="queryParam.parameterName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | |
| | | @ok="handleOk" |
| | | @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="parameterCode" label="参数编码"> |
| | | <a-input placeholder="请输入参数编码" v-model="model.parameterCode" /> |
| | | <a-input placeholder="参数编码自动生成" v-model="model.parameterCode" disabled /> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterName" label="检测项目"> |
| | | <a-input placeholder="请输入检测项目" v-model="model.parameterName" /> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterCategory" label="参数分类"> |
| | | <j-dict-select-tag dict-code="precision_parameters_category" placeholder="请选择参数分类" |
| | | v-model="model.parameterCategory"></j-dict-select-tag> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import moment from "moment" |
| | | import { httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: "EamPrecisionParametersModal", |
| | | data () { |
| | | return { |
| | | title:"操作", |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | export default { |
| | | name: 'EamPrecisionParametersModal', |
| | | data() { |
| | | return { |
| | | title: '操作', |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules:{ |
| | | }, |
| | | url: { |
| | | add: "/eam/eamPrecisionParameters/add", |
| | | edit: "/eam/eamPrecisionParameters/edit", |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | parameterName:[ |
| | | { required: true, message: '请输入参数名称!' } |
| | | ], |
| | | parameterCategory: [ |
| | | { required: true, message: '请选择参数分类!' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: '/eam/precisionParameters/add', |
| | | edit: '/eam/precisionParameters/edit' |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | //初始化默认值 |
| | | this.edit({}); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | 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; |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | //初始化默认值 |
| | | this.edit({}) |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | }, |
| | | 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 |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |