|
|
@@ -21,7 +21,6 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="设备名称"
|
|
|
- required
|
|
|
prop="Name"
|
|
|
label-width="120px">
|
|
|
<el-input v-model="testlistform.Name"
|
|
|
@@ -62,30 +61,12 @@
|
|
|
label-width="120px"
|
|
|
prop="CalibrationTime">
|
|
|
<el-date-picker v-model="testlistform.CalibrationTime"
|
|
|
- type="date"
|
|
|
+ type="datetime"
|
|
|
style="width:100%"
|
|
|
placeholder="请选择校验日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="校验使用期限"
|
|
|
- label-width="120px">
|
|
|
- <!-- <el-input v-model="testlistform.CalibrationDeadline" placeholder="请输入校验使用期限" style="width: 49%"></el-input> -->
|
|
|
- <el-input-number v-model="testlistform.CalibrationDeadline"
|
|
|
- :min="1"
|
|
|
- style="width:59%"></el-input-number>
|
|
|
- <el-select v-model="testlistform.CalibrationDeadlineType"
|
|
|
- style="width: 39%;float:right">
|
|
|
- <el-option v-for="item in timeType"
|
|
|
- :key="item.Id"
|
|
|
- :label="item.stateName"
|
|
|
- :value="item.Id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="责任人"
|
|
|
label-width="120px">
|
|
|
@@ -208,7 +189,6 @@ export default {
|
|
|
Id: 4
|
|
|
}],
|
|
|
rulestestlistform: {
|
|
|
-
|
|
|
Code: [{
|
|
|
required: true,
|
|
|
message: '请输入设备编码',
|
|
|
@@ -218,37 +198,27 @@ export default {
|
|
|
required: true,
|
|
|
message: '请输入设备名称',
|
|
|
trigger: 'blur'
|
|
|
+ }],
|
|
|
+ Model: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入型号',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ Brand: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入品牌名称',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ State: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入设备状态',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ Classification: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入设备大类',
|
|
|
+ trigger: 'blur'
|
|
|
}]
|
|
|
- // SupplierId: [{
|
|
|
- // required: true,
|
|
|
- // message: '请选择供应商',
|
|
|
- // trigger: 'blur'
|
|
|
- // }],
|
|
|
- // Model: [{
|
|
|
- // required: true,
|
|
|
- // message: '请输入型号',
|
|
|
- // trigger: 'blur'
|
|
|
- // }],
|
|
|
- // Spec: [{
|
|
|
- // required: true,
|
|
|
- // message: '请输入规格',
|
|
|
- // trigger: 'blur'
|
|
|
- // }],
|
|
|
- // Brand: [{
|
|
|
- // required: true,
|
|
|
- // message: '请输入品牌名称',
|
|
|
- // trigger: 'blur'
|
|
|
- // }],
|
|
|
- // Classification: [{
|
|
|
- // required: true,
|
|
|
- // message: '请输入设备大类',
|
|
|
- // trigger: 'blur'
|
|
|
- // }],
|
|
|
- // State: [{
|
|
|
- // required: true,
|
|
|
- // message: '请输入设备状态',
|
|
|
- // trigger: 'blur'
|
|
|
- // }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -265,116 +235,42 @@ export default {
|
|
|
}
|
|
|
getRoomNumber(params)
|
|
|
.then(res => {
|
|
|
- // for (let type of res.info) {
|
|
|
- // _this.typeList[type.Value] = type.RoomType
|
|
|
- // }
|
|
|
_this.typeList = res.info
|
|
|
- // this.searchroomdata()
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- // 操作规程文件上传
|
|
|
- uploadrequest (option) {
|
|
|
+ savedata () {
|
|
|
let _this = this
|
|
|
- axios.post(this.$uploadFile, {})
|
|
|
- .then(function (res) {
|
|
|
- if (res.data && res.data.fid && res.data.fid !== '') {
|
|
|
- option.action = `http://${res.data.url}/${res.data.fid}`
|
|
|
- _this.uploadFile = {
|
|
|
- uid: option.file.uid,
|
|
|
- url: res.data.publicUrl,
|
|
|
- fid: res.data.fid
|
|
|
- }
|
|
|
- uploadajax(option)
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '未上传成功!请刷新界面重新上传!'
|
|
|
+ this.$refs.testlistform.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ InstrumentApi.AddInstrument(this.testlistform, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '保存成功'
|
|
|
+ })
|
|
|
+ // this.$emit('closeAddDialog')
|
|
|
+ this.dialogvisible = false
|
|
|
+ this.handleCloseAdd()
|
|
|
+ this.$refs['testlistform'].resetFields()
|
|
|
+ // this.testlistform = []
|
|
|
+ // this.fileList = []
|
|
|
+ // 刷新
|
|
|
})
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(function (error) {
|
|
|
- console.log(error)
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '未上传成功!请重新上传!'
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- handleRemove (file, fileList) {
|
|
|
- this.testlistform.FileUrl = ''
|
|
|
- this.testlistform.FileName = ''
|
|
|
- this.FileUrl = {}
|
|
|
- },
|
|
|
- handleUploadSuccess (res, file) {
|
|
|
- this.testlistform.FileUrl = `${this.uploadFile.url}/${this.uploadFile.fid}`
|
|
|
- this.testlistform.FileName = file.name
|
|
|
- this.FileUrl = URL.createObjectURL(file.raw)
|
|
|
- },
|
|
|
- savedata () {
|
|
|
- InstrumentApi.AddInstrument(this.testlistform, {})
|
|
|
- .then(res => {
|
|
|
- this.$emit('closeAddDialog')
|
|
|
- this.dialogvisible = false
|
|
|
- this.testlistform = []
|
|
|
- this.fileList = []
|
|
|
- // 刷新
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- // // 保存
|
|
|
- // getCode (formName) {
|
|
|
- // let _this = this
|
|
|
- // this.$refs[formName].validate((valid) => {
|
|
|
- // instrumentGetCode(_this.testlistform.Code)
|
|
|
- // .then(function (response) {
|
|
|
- // _this.total = response.info.items
|
|
|
- // if (_this.total === 0) {
|
|
|
- // _this.savedata()
|
|
|
- // } else {
|
|
|
- // _this.$message({
|
|
|
- // type: 'warning',
|
|
|
- // message: '设备编号已存在'
|
|
|
- // })
|
|
|
- // }
|
|
|
- // _this.refreshData()
|
|
|
- // })
|
|
|
- // .catch(function (error) {
|
|
|
- // console.log(error)
|
|
|
- // })
|
|
|
- // })
|
|
|
- // },
|
|
|
refreshData () {
|
|
|
this.$emit('refreshData')
|
|
|
},
|
|
|
- // // 获取设备大类
|
|
|
- // getclassificationlist () {
|
|
|
- // let _this = this
|
|
|
- // let params = {
|
|
|
-
|
|
|
- // code: 'InstrumentItem'
|
|
|
- // }
|
|
|
- // classificationlist(params)
|
|
|
- // .then(res => {
|
|
|
- // _this.classificationlist = res.info
|
|
|
- // })
|
|
|
- // },
|
|
|
- // 获取供应商
|
|
|
- // getSupplier () {
|
|
|
- // let _this = this
|
|
|
- // let params = {
|
|
|
- // customerName: 'Supplier'
|
|
|
- // }
|
|
|
- // getsupplierlist(params)
|
|
|
- // .then(res => {
|
|
|
- // _this.getsupplierlist = res.info
|
|
|
- // })
|
|
|
- // },
|
|
|
closedialog () {
|
|
|
this.dialogvisible = false
|
|
|
},
|
|
|
@@ -384,14 +280,10 @@ export default {
|
|
|
this.testlistform.Code = ''
|
|
|
this.testlistform.Name = ''
|
|
|
this.testlistform.Brand = ''
|
|
|
- this.testlistform.SupplierId = ''
|
|
|
- this.testlistform.FactoryNum = ''
|
|
|
this.testlistform.Responsible = ''
|
|
|
- this.testlistform.CalibrationDeadline = 1
|
|
|
- this.testlistform.MaintenCycle = 1
|
|
|
+ this.testlistform.Location = ''
|
|
|
this.testlistform.Model = ''
|
|
|
this.testlistform.Remarks = ''
|
|
|
- this.testlistform.Classification = ''
|
|
|
this.$emit('closeAddDialog')
|
|
|
},
|
|
|
|
|
|
@@ -418,20 +310,6 @@ export default {
|
|
|
var time = dates.getFullYear() + '-' + month + '-' + day
|
|
|
return time
|
|
|
}
|
|
|
- // // 查询action
|
|
|
- // getttriggernow (id, instumentid) {
|
|
|
- // gettriggerlist({}, id)
|
|
|
- // .then(res => {
|
|
|
- // let _this = this
|
|
|
- // _this.Advancetime = res.items.Advancetime
|
|
|
- // // 查询子表 有效期
|
|
|
- // _this.addTriggerl(instumentid, _this.testlistform.Code, _this.testlistform.TimeNotification, _this.testlistform.Name, _this.Advancetime, _this.testlistform.CalibrationTime, _this.testlistform.CalibrationDeadline, _this.testlistform.CalibrationDeadlineType)
|
|
|
- // })
|
|
|
- // .catch(err => {
|
|
|
- // console.error(err)
|
|
|
- // })
|
|
|
- // }
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|