|
@@ -10,13 +10,13 @@
|
|
|
</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 label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
|
|
|
+ <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id" placeholder="请选择设备" @change="handleChange"/>
|
|
|
</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="tpm_equipment,equipmentname,id" />
|
|
|
+ <a-form-model-item label="点检内容名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contentname">
|
|
|
+ <a-input v-model="model.contentname" placeholder="请输入所属点检内容名称" :disabled="disableds" ></a-input>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<!-- <a-col :span="12">
|
|
@@ -36,20 +36,27 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="点检描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
|
|
|
- <a-input v-model="model.description" placeholder="请输入点检描述" ></a-input>
|
|
|
+ <!-- <a-input v-model="model.description" placeholder="请输入点检描述" ></a-input> -->
|
|
|
+ <a-textarea v-model="model.description" placeholder="请输入点检描述" :auto-size="{ minRows: 2, maxRows: 3 }" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-model-item label="点检备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
|
|
|
- <a-input v-model="model.remark" placeholder="请输入点检备注" ></a-input>
|
|
|
+ <!-- <a-input v-model="model.remark" placeholder="请输入点检备注" ></a-input> -->
|
|
|
+ <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="故障照片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
|
|
|
+ <j-image-upload text="上传" v-model="model.files" isMultiple></j-image-upload>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<div class="cmms-dialog-item-title u-flex-jab">
|
|
|
<div>点检列表</div>
|
|
|
<div>
|
|
|
- <a-button type="link">一键正常</a-button>
|
|
|
- <a-button type="link">一键异常</a-button>
|
|
|
+ <a-button @click="allT" type="link">一键正常</a-button>
|
|
|
+ <a-button @click="allF" type="link">一键异常</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<a-table
|
|
@@ -66,10 +73,10 @@
|
|
|
<template slot="iresult" slot-scope="text, record,index">
|
|
|
<a-form-model-item :prop="'cmmsSpotcheckTitemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
|
|
|
<a-radio-group name="radioGroup" v-model="record.iresult">
|
|
|
- <a-radio :value="0">
|
|
|
+ <a-radio value="0">
|
|
|
正常
|
|
|
</a-radio>
|
|
|
- <a-radio :value="1">
|
|
|
+ <a-radio value="1">
|
|
|
异常
|
|
|
</a-radio>
|
|
|
</a-radio-group>
|
|
@@ -102,18 +109,20 @@
|
|
|
default: false,
|
|
|
required: false
|
|
|
},
|
|
|
- dataList: {
|
|
|
- type: Object,
|
|
|
- default: function(){
|
|
|
- return {} // 使用工厂函数返回默认值
|
|
|
- }
|
|
|
- },
|
|
|
+ // dataList: {
|
|
|
+ // type: Object,
|
|
|
+ // default: function(){
|
|
|
+ // return {} // 使用工厂函数返回默认值
|
|
|
+ // }
|
|
|
+ // },
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
model:{
|
|
|
cmmsSpotcheckTitemList: []
|
|
|
},
|
|
|
+ // 单个禁填
|
|
|
+ disableds: false,
|
|
|
labelCol: {
|
|
|
xs: { span: 24 },
|
|
|
sm: { span: 5 },
|
|
@@ -194,13 +203,25 @@
|
|
|
},
|
|
|
methods: {
|
|
|
add () {
|
|
|
- // this.edit(this.modelDefault);
|
|
|
- console.log(222,this.dataList)
|
|
|
- this.model = this.dataList
|
|
|
+ this.edit(this.modelDefault);
|
|
|
+ this.model.id = ""
|
|
|
+ this.disableds = true
|
|
|
+ // 第二版
|
|
|
+ // this.model = this.dataList
|
|
|
+ // this.model.id = ""
|
|
|
},
|
|
|
edit (record) {
|
|
|
- this.model = Object.assign({}, record);
|
|
|
- this.visible = true;
|
|
|
+ this.disableds = true
|
|
|
+ getAction(`/cmmsSpotcheck/cmmsSpotcheck/getInfoBySpotcheckid/${record.id}`).then((res) => {
|
|
|
+ this.model = res.result
|
|
|
+ const b = res.result.files.map((res) => {
|
|
|
+ return res.url
|
|
|
+ })
|
|
|
+ this.model.files = b.join(',')
|
|
|
+ this.visible = true;
|
|
|
+ })
|
|
|
+ // this.model = Object.assign({}, record);
|
|
|
+ // this.visible = true;
|
|
|
},
|
|
|
submitForm () {
|
|
|
const that = this;
|
|
@@ -217,7 +238,13 @@
|
|
|
httpurl+=this.url.edit;
|
|
|
method = 'put';
|
|
|
}
|
|
|
- console.log(99,this.model)
|
|
|
+ const a = this.model.files.split(',')
|
|
|
+ this.model.files = a.map((res) => {
|
|
|
+ return {
|
|
|
+ url: res
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(88,this.model)
|
|
|
httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
if(res.success){
|
|
|
that.$message.success(res.message);
|
|
@@ -229,9 +256,28 @@
|
|
|
that.confirmLoading = false;
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
+ handleChange(value){
|
|
|
+ console.log(value)
|
|
|
+ getAction(`/cmmsSpotcheck/cmmsSpotcheck/getInfoByEquipmentid/${value}`).then((res) => {
|
|
|
+ this.model = res.result
|
|
|
+ })
|
|
|
+ },
|
|
|
+ allT() {
|
|
|
+ this.model.cmmsSpotcheckTitemList = this.model.cmmsSpotcheckTitemList.map((res) => {
|
|
|
+ var data = res
|
|
|
+ data.iresult = "0"
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ allF() {
|
|
|
+ this.model.cmmsSpotcheckTitemList = this.model.cmmsSpotcheckTitemList.map((res) => {
|
|
|
+ var data = res
|
|
|
+ data.iresult = "1"
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|