|
@@ -2,28 +2,60 @@
|
|
<a-spin :spinning="confirmLoading">
|
|
<a-spin :spinning="confirmLoading">
|
|
<j-form-container :disabled="formDisabled">
|
|
<j-form-container :disabled="formDisabled">
|
|
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
<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="contentcode">
|
|
|
|
- <a-input v-model="model.contentcode" placeholder="请输入点检内容编号" ></a-input>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :span="24">
|
|
|
|
- <a-form-model-item label="点检内容名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contentname">
|
|
|
|
- <a-input v-model="model.contentname" 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">
|
|
|
|
- <j-search-select-tag v-model="model.equipmentid" dict="ems_tpm_equipment,equipmentname,id" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :span="24">
|
|
|
|
- <a-form-model-item label="状态:启用:0、禁用:1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
|
|
|
|
- <j-dict-select-tag type="list" v-model="model.status" dictCode="spotcheck_content_status" placeholder="请选择状态:启用:0、禁用:1" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
|
|
+ <div class="cmms-dialog-item-title">点检内容基本信息</div>
|
|
|
|
+ <div style="height: 100%;width:100%;display: flex;">
|
|
|
|
+ <div style="height: 100%;width:92%;">
|
|
|
|
+ <a-row>
|
|
|
|
+ <!-- <a-col :span="12">
|
|
|
|
+ <a-form-model-item label="点检内容编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contentcode">
|
|
|
|
+ <a-input v-model="model.contentcode" placeholder="请输入点检内容编号" ></a-input>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col> -->
|
|
|
|
+ <a-col :span="12">
|
|
|
|
+ <a-form-model-item label="点检内容名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contentname">
|
|
|
|
+ <a-input v-model="model.contentname" placeholder="请输入点检内容名称" ></a-input>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="12">
|
|
|
|
+ <a-form-model-item label="选择设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
|
|
|
|
+ <j-search-select-tag v-model="model.equipmentid" dict="ems_tpm_equipment,equipmentname,id" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="12">
|
|
|
|
+ <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
|
|
|
|
+ <a-textarea v-model="model.remark" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 3 }" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <!-- <a-col :span="12">
|
|
|
|
+ <a-form-model-item label="状态:启用:0、禁用:1" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
|
|
|
|
+ <j-dict-select-tag type="list" v-model="model.status" dictCode="spotcheck_content_status" placeholder="请选择状态:启用:0、禁用:1" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col> -->
|
|
|
|
+ </a-row>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="height: 100%;width:8%;padding-top:0.25%;">
|
|
|
|
+ <a-button type="primary" icon="search" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="cmms-dialog-item-title u-flex-jab">
|
|
|
|
+ <div>设备点检设置</div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-button @click="handleAddSpotItem" type="link" icon="plus">点检项</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <a-table
|
|
|
|
+ ref="table"
|
|
|
|
+ size="middle"
|
|
|
|
+ :scroll="{x:true}"
|
|
|
|
+ bordered
|
|
|
|
+ rowKey="id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :dataSource="dataSource"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ class="j-table-force-nowrap">
|
|
|
|
+ </a-table>
|
|
|
|
+ <cmms-spotcheck-content-modal-add ref="modalForm" @ok="modalFormOk" :modelForm="model" :dataList="dataSource" @customEvent="handleCustomEvent"></cmms-spotcheck-content-modal-add>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
</j-form-container>
|
|
</j-form-container>
|
|
</a-spin>
|
|
</a-spin>
|
|
@@ -31,12 +63,19 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
|
|
|
+ import '@/assets/less/TableExpand.less'
|
|
|
|
+ import { mixinDevice } from '@/utils/mixin'
|
|
|
|
+ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
|
+
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
+import CmmsSpotcheckContentModalAdd from './CmmsSpotcheckContentModalAdd.vue'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'CmmsSpotcheckContentForm',
|
|
name: 'CmmsSpotcheckContentForm',
|
|
|
|
+ mixins:[JeecgListMixin, mixinDevice],
|
|
components: {
|
|
components: {
|
|
|
|
+ CmmsSpotcheckContentModalAdd
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
//表单禁用
|
|
//表单禁用
|
|
@@ -49,10 +88,10 @@
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
model:{
|
|
model:{
|
|
- },
|
|
|
|
|
|
+ },
|
|
labelCol: {
|
|
labelCol: {
|
|
xs: { span: 24 },
|
|
xs: { span: 24 },
|
|
- sm: { span: 5 },
|
|
|
|
|
|
+ sm: { span: 8 },
|
|
},
|
|
},
|
|
wrapperCol: {
|
|
wrapperCol: {
|
|
xs: { span: 24 },
|
|
xs: { span: 24 },
|
|
@@ -60,8 +99,54 @@
|
|
},
|
|
},
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
validatorRules: {
|
|
validatorRules: {
|
|
|
|
+ contentname: [
|
|
|
|
+ { required: true, message: '请输入点检内容名称!'},
|
|
|
|
+ ],
|
|
|
|
+ equipmentid: [
|
|
|
|
+ { required: true, message: '请选择设备!'},
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
|
|
+ columns: [
|
|
|
|
+ // {
|
|
|
|
+ // title: '#',
|
|
|
|
+ // dataIndex: '',
|
|
|
|
+ // key:'rowIndex',
|
|
|
|
+ // width:60,
|
|
|
|
+ // align:"center",
|
|
|
|
+ // customRender:function (t,r,index) {
|
|
|
|
+ // return parseInt(index)+1;
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
|
|
+ title:'点检项ID',
|
|
|
|
+ align:"center",
|
|
|
|
+ dataIndex: 'id'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title:'点检项编号',
|
|
|
|
+ align:"center",
|
|
|
|
+ dataIndex: 'itemcode'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title:'点检项名称',
|
|
|
|
+ align:"center",
|
|
|
|
+ dataIndex: 'itemname'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title:'标准',
|
|
|
|
+ align:"center",
|
|
|
|
+ dataIndex: 'conditions',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title:'备注',
|
|
|
|
+ align:"center",
|
|
|
|
+ dataIndex: 'remark'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ dataSource: [],
|
|
|
|
+ loading:false,
|
|
url: {
|
|
url: {
|
|
|
|
+ list: "/cmmsSpotcheckItem/cmmsSpotcheckItem/listbyequipmentid/{equipmentid}",
|
|
add: "/cmmsSpotcheckContent/cmmsSpotcheckContent/add",
|
|
add: "/cmmsSpotcheckContent/cmmsSpotcheckContent/add",
|
|
edit: "/cmmsSpotcheckContent/cmmsSpotcheckContent/edit",
|
|
edit: "/cmmsSpotcheckContent/cmmsSpotcheckContent/edit",
|
|
queryById: "/cmmsSpotcheckContent/cmmsSpotcheckContent/queryById"
|
|
queryById: "/cmmsSpotcheckContent/cmmsSpotcheckContent/queryById"
|
|
@@ -114,6 +199,26 @@
|
|
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 新增点检项
|
|
|
|
+ handleAddSpotItem(){
|
|
|
|
+ console.log(this.model.equipmentid)
|
|
|
|
+ if (this.model.equipmentid == undefined) {
|
|
|
|
+ this.$message.error("请先选择设备!");
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.modalForm.add();
|
|
|
|
+ this.$refs.modalForm.title = "选择点检项";
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 处理子组件传过来的数据
|
|
|
|
+ handleCustomEvent(data) {
|
|
|
|
+ // 处理从子组件传递过来的数据
|
|
|
|
+ console.log("Received Data:", data);
|
|
|
|
+ this.dataSource = data;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</script>
|
|
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+@import "~@/assets/less/uStyle.less";
|
|
|
|
+</style>
|