From 76352e8fc60ef625c147fa82a16b7435c66fc169 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期四, 20 三月 2025 14:51:10 +0800 Subject: [PATCH] art: 设备管理-设备台账列表 --- src/views/eam/equipment/modules/EamEquipmentModal.vue | 347 ++++++++++++++++++++++++++ src/components/jeecg/index.js | 2 src/components/jeecg/LxSwitch.vue | 71 +++++ src/views/eam/equipment/EamEquipmentList.vue | 355 +++++++++++++++++++++++++++ 4 files changed, 775 insertions(+), 0 deletions(-) diff --git a/src/components/jeecg/LxSwitch.vue b/src/components/jeecg/LxSwitch.vue new file mode 100644 index 0000000..7aa4fe4 --- /dev/null +++ b/src/components/jeecg/LxSwitch.vue @@ -0,0 +1,71 @@ +<template> + <a-switch + :checkedChildren="checkedChildren" + :unCheckedChildren="unCheckedChildren" + :defaultChecked="defaultChecked" + :checked="value === '1'" + @change="handleChange" + :disabled="disabled" + :loading="loading" + :size="size" + /> +</template> + +<script> +export default { + name: 'LxSwitch', + props: { + checkedChildren: { + type: String, + default: '', + required: false + }, + value: { + type: String, + required: false + }, + unCheckedChildren: { + type: String, + default: '', + required: false + }, + defaultChecked: { + type: Boolean, + required: false, + default: false + }, + loading: { + type: Boolean, + required: false, + default: false + }, + disabled: { + type: Boolean, + required: false, + default: false + }, + size: { + type: String, + required: false, + default: 'default' + } + }, + data() { + let dateStr = this.value + return { + decorator: '', + momVal: !dateStr ? null : moment(dateStr, this.dateFormat) + } + }, + methods: { + handleChange(checked) { + this.$emit('change', checked ? '1' : '0') + } + }, + //2.2鏂板 鍦ㄧ粍浠跺唴瀹氫箟 鎸囧畾鐖剁粍浠惰皟鐢ㄦ椂鍊欑殑浼犲�煎睘鎬у拰浜嬩欢绫诲瀷 杩欎釜鐗涢�� + model: { + prop: 'value', + event: 'change' + } +} +</script> \ No newline at end of file diff --git a/src/components/jeecg/index.js b/src/components/jeecg/index.js index c7974d5..9f72112 100644 --- a/src/components/jeecg/index.js +++ b/src/components/jeecg/index.js @@ -29,6 +29,7 @@ import JEasyCron from '@/components/jeecg/JEasyCron' import LxUpload from './LxUpload.vue' import LxFilePreview from './LxFilePreview.vue' +import LxSwitch from './LxSwitch.vue' //jeecgbiz import JSelectDepart from '../jeecgbiz/JSelectDepart.vue' import JSelectMultiUser from '../jeecgbiz/JSelectMultiUser.vue' @@ -75,6 +76,7 @@ Vue.component('JUpload', JUpload) Vue.component('LxUpload', LxUpload) Vue.component('LxFilePreview', LxFilePreview) + Vue.component('LxSwitch', LxSwitch) //jeecgbiz Vue.component('JSelectDepart', JSelectDepart) diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue new file mode 100644 index 0000000..2c13c29 --- /dev/null +++ b/src/views/eam/equipment/EamEquipmentList.vue @@ -0,0 +1,355 @@ +<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.equipmentCode"></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.equipmentName"></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="璁惧鍨嬪彿"> + <a-input placeholder="璇疯緭鍏ヨ澶囧瀷鍙�" v-model="queryParam.equipmentModel"></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.equipmentSpecification"></a-input> + </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="info" @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> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <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-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" + :scroll="{ x: 'max-content' }" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="equipmentImportance" slot-scope="text"> + <lx-switch v-model="text" disabled checked-children='鏄�' un-checked-children='鍚�' /> + </span> + + <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-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipment-modal ref="modalForm" @ok="modalFormOk"></eamEquipment-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentModal from './modules/EamEquipmentModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' + +export default { + name: 'EamEquipmentList', + mixins: [JeecgListMixin], + components: { + EamEquipmentModal + }, + data() { + return { + description: '璁惧鍙拌处绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + width: 100, + dataIndex: 'equipmentCode', + ellipsis: true, + fixed: 'left' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + width: 100, + dataIndex: 'equipmentName', + ellipsis: true, + fixed: 'left' + }, + { + title: '鍏抽敭璁惧鏍囪瘑', + align: 'center', + width : 100, + dataIndex: 'equipmentImportance', + scopedSlots: { customRender: 'equipmentImportance' } + }, + { + title: '鎶�鏈姸鎬�', + align: 'center', + width : 100, + dataIndex: 'technologyStatus_dictText' + }, + { + title: '鎿嶄綔绯荤粺', + align: 'center', + width : 100, + dataIndex: 'operationSystem' + }, + { + title: '浣跨敤閮ㄩ棬', + align: 'center', + width : 100, + dataIndex: 'orgId' + }, + { + title: '璁惧绠$悊鍛�', + align: 'center', + width : 100, + dataIndex: 'equipmentManager' + }, + { + title: '璁惧鍒嗙被', + align: 'center', + width : 100, + dataIndex: 'equipmentCategory_dictText' + }, + { + title: '璁惧鍨嬪彿', + align: 'center', + width : 100, + dataIndex: 'equipmentModel' + }, + { + title: '璁惧瑙勬牸', + align: 'center', + width : 100, + dataIndex: 'equipmentSpecification' + }, + { + title: '涓昏酱杩炴帴灏哄', + align: 'center', + width : 100, + dataIndex: 'spindleConnectDimension' + }, + { + title: '鎬诲姛鐜�', + align: 'center', + width : 100, + dataIndex: 'equipmentPower' + }, + { + title: '瀹夎浣嶇疆', + align: 'center', + width : 100, + dataIndex: 'installationPosition' + }, + { + title: '璧勪骇鐘舵��', + align: 'center', + width : 100, + dataIndex: 'assetStatus_dictText' + }, + { + title: '绔嬮」鍗″彿', + align: 'center', + width : 100, + dataIndex: 'cardNumber' + }, + { + title: '鍑哄巶缂栧彿', + align: 'center', + width : 100, + dataIndex: 'factoryNumber' + }, + { + title: '鏈哄簥鍘傚', + align: 'center', + width : 100, + dataIndex: 'manufacturingEnterprise' + }, + { + title: '鏉ユ簮鍥藉', + align: 'center', + width : 100, + dataIndex: 'originCountry' + }, + { + title: '鍑哄巶鏃ユ湡', + align: 'center', + width : 100, + dataIndex: 'leaveFactoryDate' + }, + { + title: '楠屾敹鏃ユ湡', + align: 'center', + width : 100, + dataIndex: 'acceptanceCheckDate' + }, + { + title: '璐ㄤ繚寮�濮嬫棩鏈�', + align: 'center', + width : 100, + dataIndex: 'warrantyStartDate' + }, + { + title: '璐ㄤ繚缁撴潫鏃ユ湡', + align: 'center', + width : 100, + dataIndex: 'warrantyEndDate' + }, + { + title: '鏄惁瀹炴柦MDC', + align: 'center', + width : 100, + dataIndex: 'mdcFlag' + }, + { + title: '鏄惁鏈夊伐鑹哄弬鏁�', + align: 'center', + width : 100, + dataIndex: 'processParametersFlag' + }, + { + title: '鏄惁鏈夌簿搴﹀弬鏁�', + align: 'center', + width : 100, + dataIndex: 'precisionParametersFlag' + }, + { + title: '鏄惁涓虹壒绉嶈澶�', + align: 'center', + width : 100, + dataIndex: 'specialEquipment' + }, + { + title: '閲嶉噺', + align: 'center', + dataIndex: 'equipmentWeight' + }, + { + title: '璁惧绔彛', + align: 'center', + width: 100, + dataIndex: 'equipmentPort' + }, + { + title: '鍧愭爣鏁伴噺', + align: 'center', + width: 100, + dataIndex: 'coordinateNum' + }, + { + title: '澶囨敞', + align: 'center', + width: 100, + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + width: 150, + scopedSlots: { customRender: 'action' }, + fixed: 'right' + } + ], + url: { + list: '/eam/equipment/list', + delete: '/eam/equipment/delete', + deleteBatch: '/eam/equipment/deleteBatch', + exportXlsUrl: 'eam/equipment/exportXls', + importExcelUrl: 'eam/equipment/importExcel' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: {} +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentModal.vue new file mode 100644 index 0000000..dcdab11 --- /dev/null +++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue @@ -0,0 +1,347 @@ +<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-divider + orientation="center" + style="font-size: large;font-style: italic;color: #66aeed;" + > 璁惧鍩虹淇℃伅 + </a-divider> + <a-row :gutter="24"> + <a-col :span="18"> + <a-row> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentCode" label="璁惧缂栧彿"> + <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentName" label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentModel" label="璁惧鍨嬪彿"> + <a-input placeholder="璇疯緭鍏ヨ澶囧瀷鍙�" v-model="model.equipmentModel" /> + </a-form-model-item> + </a-col> + </a-row> + <a-row> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentSpecification" + label="璁惧瑙勬牸"> + <a-input placeholder="璇疯緭鍏ヨ澶囪鏍�" v-model="model.equipmentSpecification" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentCategory" + label="璁惧鍒嗙被"> + <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨璁惧鍒嗙被" v-model="model.equipmentCategory" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationSystem" + label="鎿嶄綔绯荤粺"> + <a-input placeholder="璇疯緭鍏ユ搷浣滅郴缁�" v-model="model.operationSystem" /> + </a-form-model-item> + </a-col> + </a-row> + <a-row> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentImportance" + label="鍏抽敭璁惧鏍囪瘑"> + <lx-switch + checked-children='鏄�' + un-checked-children='鍚�' + v-model="model.equipmentImportance" + /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentPower" label="鎬诲姛鐜�"> + <a-input placeholder="璇疯緭鍏ユ�诲姛鐜�" v-model="model.equipmentPower" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cardNumber" label="绔嬮」鍗″彿"> + <a-input placeholder="璇疯緭鍏ョ珛椤瑰崱鍙�" v-model="model.cardNumber" /> + </a-form-model-item> + </a-col> + </a-row> + </a-col> + <a-col :span="6"> + <j-image-upload></j-image-upload> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentWeight" label="閲嶉噺"> + <a-input placeholder="璇疯緭鍏ラ噸閲�" v-model="model.equipmentWeight" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentPort" label="璁惧绔彛"> + <a-input placeholder="璇疯緭鍏ヨ澶囩鍙�" v-model="model.equipmentPort" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="coordinateNum" label="鍧愭爣鏁伴噺"> + <a-input-number v-model="model.coordinateNum" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetStatus" label="璧勪骇鐘舵��"> + <j-dict-select-tag dict-code="asset_status" placeholder="璇烽�夋嫨璧勪骇鐘舵��" v-model="model.assetStatus" disabled/> + </a-form-model-item> + </a-col> + </a-row> + <a-divider + orientation="center" + style="font-size: large;font-style: italic;color: #66aeed;" + > 鍑哄巶淇℃伅 + </a-divider> + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryNumber" label="鍑哄巶缂栧彿"> + <a-input placeholder="璇疯緭鍏ュ嚭鍘傜紪鍙�" v-model="model.factoryNumber" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaveFactoryDate" label="鍑哄巶鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨鍑哄巶鏃ユ湡" v-model="model.leaveFactoryDate" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="acceptanceCheckDate" + label="楠屾敹鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨楠屾敹鏃ユ湡" v-model="model.acceptanceCheckDate" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="installationPosition" + label="瀹夎浣嶇疆"> + <a-input placeholder="璇疯緭鍏ュ畨瑁呬綅缃�" v-model="model.installationPosition" /> + </a-form-model-item> + </a-col> + + </a-row> + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spindleConnectDimension" + label="涓昏酱杩炴帴灏哄"> + <a-input placeholder="璇疯緭鍏ヤ富杞磋繛鎺ュ昂瀵�" v-model="model.spindleConnectDimension" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specialEquipment" + label="鏄惁鐗圭璁惧"> + <lx-switch + checked-children='鏄�' + un-checked-children='鍚�' + v-model="model.specialEquipment" + /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufacturingEnterprise" + label="鍒堕�犲巶瀹�"> + <a-input placeholder="璇疯緭鍏ュ埗閫犲巶瀹�" v-model="model.manufacturingEnterprise" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originCountry" label="鏉ユ簮鍥藉"> + <a-input placeholder="璇疯緭鍏ユ潵婧愬浗瀹�" v-model="model.originCountry" /> + </a-form-model-item> + </a-col> + </a-row> + <a-divider + orientation="center" + style="font-size: large;font-style: italic;color: #66aeed;" + > 浣跨敤淇℃伅 + </a-divider> + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgId" label="浣跨敤閮ㄩ棬"> + <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄩ儴闂�" v-model="model.orgId" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentManager" label="璁惧绠$悊鍛�"> + <a-input placeholder="璇疯緭鍏ヨ澶囩鐞嗗憳" v-model="model.equipmentManager" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technologyStatus" label="鎶�鏈姸鎬�"> + <j-dict-select-tag dict-code="technology_status" placeholder="璇烽�夋嫨鎶�鏈姸鎬�" v-model="model.technologyStatus" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mdcFlag" label="鏄惁瀹炴柦MDC"> + <lx-switch + checked-children='鏄�' + un-checked-children='鍚�' + v-model="model.mdcFlag" + /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warrantyStartDate" + label="璐ㄤ繚寮�濮嬫棩鏈�"> + <a-date-picker placeholder="璇烽�夋嫨寮�濮嬫棩鏈�" v-model="model.warrantyStartDate" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warrantyEndDate" + label="璐ㄤ繚缁撴潫鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨缁撴潫鏃ユ湡" v-model="model.warrantyEndDate" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processParametersFlag" + label="鏈夋棤宸ヨ壓鍙傛暟"> + <lx-switch + checked-children='鏈�' + un-checked-children='鏃�' + v-model="model.processParametersFlag" + /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="precisionParametersFlag" + label="鏈夋棤绮惧害鍙傛暟"> + <lx-switch + checked-children='鏈�' + un-checked-children='鏃�' + v-model="model.precisionParametersFlag" + /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" /> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' +import { validateDuplicateValueInDelFlag } from '@/utils/util' + +export default { + name: 'EamEquipmentModal', + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 10 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 14 } + }, + + confirmLoading: false, + validatorRules: { + equipmentCode: [ + { required: true, message: '璇疯緭鍏ヨ澶囩紪鐮�' }, + { validator: (rule, value, callback) => validateDuplicateValueInDelFlag('eam_equipment', 'equipment_code', value, this.model.id, true, callback) } + ], + equipmentName: [ + { required: true, message: '璇疯緭鍏ヨ澶囧悕绉�' }, + ], + equipmentCategory: [ + { required: true, message: '璇烽�夋嫨璁惧鍒嗙被' }, + ], + leaveFactoryDate: [ + { required: true, message: '璇烽�夋嫨鍑哄巶鏃ユ湡' }, + ], + acceptanceCheckDate: [ + { required: true, message: '璇烽�夋嫨楠屾敹鏃ユ湡' }, + ], + technologyStatus: [ + { required: true, message: '璇烽�夋嫨鎶�鏈姸鎬�' }, + ], + }, + url: { + add: '/eam/equipment/add', + edit: '/eam/equipment/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') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + } + + } +} +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file -- Gitblit v1.9.3