|
@@ -68,18 +68,6 @@
|
|
|
placeholder="请输入联系地址"></el-input>
|
|
placeholder="请输入联系地址"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
-
|
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
- <el-form-item label="备注信息"
|
|
|
|
|
- label-width="120px">
|
|
|
|
|
- <el-input v-model="testlistform.Remarks"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- :rows=3
|
|
|
|
|
- placeholder="请输入备注信息"
|
|
|
|
|
- style="width:100%"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<span slot="footer">
|
|
<span slot="footer">
|
|
@@ -93,18 +81,9 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-// import {
|
|
|
|
|
-// classificationlist,
|
|
|
|
|
-// personnelGetCode,
|
|
|
|
|
-// getSavepersonnel,
|
|
|
|
|
-// getsupplierlist
|
|
|
|
|
-// } from '@/api/personnel'
|
|
|
|
|
import PersonnelApi from '@/api/personnel'
|
|
import PersonnelApi from '@/api/personnel'
|
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
|
import uploadajax from '@/assets/js/uploadajax.js'
|
|
import uploadajax from '@/assets/js/uploadajax.js'
|
|
|
-// import { addTrigger,
|
|
|
|
|
-// gettriggerlist
|
|
|
|
|
-// } from '@/api/trigger'
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'personneladd',
|
|
name: 'personneladd',
|
|
|
data () {
|
|
data () {
|
|
@@ -141,212 +120,69 @@ export default {
|
|
|
TimeNotification: false, // 有效期提醒
|
|
TimeNotification: false, // 有效期提醒
|
|
|
classificationlist: [],
|
|
classificationlist: [],
|
|
|
getsupplierlist: [],
|
|
getsupplierlist: [],
|
|
|
- statelist: [{
|
|
|
|
|
- stateName: '正常',
|
|
|
|
|
- Id: 1
|
|
|
|
|
- }, {
|
|
|
|
|
- stateName: '维修',
|
|
|
|
|
- Id: 2
|
|
|
|
|
- }, {
|
|
|
|
|
- stateName: '停用',
|
|
|
|
|
- Id: 3
|
|
|
|
|
- }],
|
|
|
|
|
- timeType: [{
|
|
|
|
|
- stateName: '天',
|
|
|
|
|
- Id: 1
|
|
|
|
|
- }, {
|
|
|
|
|
- stateName: '周',
|
|
|
|
|
- Id: 2
|
|
|
|
|
- }, {
|
|
|
|
|
- stateName: '月',
|
|
|
|
|
- Id: 3
|
|
|
|
|
- }, {
|
|
|
|
|
- stateName: '年',
|
|
|
|
|
- Id: 4
|
|
|
|
|
- }],
|
|
|
|
|
rulestestlistform: {
|
|
rulestestlistform: {
|
|
|
-
|
|
|
|
|
- // Code: [{
|
|
|
|
|
- // required: true,
|
|
|
|
|
- // message: '请输入设备编码',
|
|
|
|
|
- // trigger: 'blur'
|
|
|
|
|
- // }],
|
|
|
|
|
- // Name: [{
|
|
|
|
|
- // 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'
|
|
|
|
|
- // }]
|
|
|
|
|
|
|
+ PersonnelName: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入人员姓名',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }],
|
|
|
|
|
+ PersonneCode: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入人员编号',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }],
|
|
|
|
|
+ Telephone: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入电话',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }],
|
|
|
|
|
+ Mailbox: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入邮箱',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }],
|
|
|
|
|
+ CardId: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入身份证号',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }],
|
|
|
|
|
+ Address: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入联系地址',
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }]
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created () {
|
|
created () {
|
|
|
- // let _this = this
|
|
|
|
|
- // this.getclassificationlist()
|
|
|
|
|
- // this.getSupplier()
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- // 操作规程文件上传
|
|
|
|
|
- uploadrequest (option) {
|
|
|
|
|
- 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: '未上传成功!请刷新界面重新上传!'
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .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 () {
|
|
savedata () {
|
|
|
PersonnelApi.AddPersonnel(this.testlistform, {})
|
|
PersonnelApi.AddPersonnel(this.testlistform, {})
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- // response
|
|
|
|
|
- console.log('--------', res)
|
|
|
|
|
- // if (res.info.code === 0) {
|
|
|
|
|
- // _this.$message({
|
|
|
|
|
- // type: 'success',
|
|
|
|
|
- // message: res.info.message
|
|
|
|
|
-
|
|
|
|
|
- // })
|
|
|
|
|
- // // window.history.go(-1)
|
|
|
|
|
- // } else {
|
|
|
|
|
- // _this.$message({
|
|
|
|
|
- // type: 'warning',
|
|
|
|
|
- // message: res.info.message
|
|
|
|
|
- // })
|
|
|
|
|
- // }
|
|
|
|
|
- // this.handleCloseAdd()
|
|
|
|
|
this.$emit('closeAddDialog')
|
|
this.$emit('closeAddDialog')
|
|
|
this.dialogvisible = false
|
|
this.dialogvisible = false
|
|
|
this.fileList = []
|
|
this.fileList = []
|
|
|
// 刷新
|
|
// 刷新
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
- // handle error
|
|
|
|
|
console.error(err)
|
|
console.error(err)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- // // 保存
|
|
|
|
|
- // getCode (formName) {
|
|
|
|
|
- // let _this = this
|
|
|
|
|
- // this.$refs[formName].validate((valid) => {
|
|
|
|
|
- // personnelGetCode(_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 () {
|
|
refreshData () {
|
|
|
this.$emit('refreshData')
|
|
this.$emit('refreshData')
|
|
|
},
|
|
},
|
|
|
- // // 获取设备大类
|
|
|
|
|
- // getclassificationlist () {
|
|
|
|
|
- // let _this = this
|
|
|
|
|
- // let params = {
|
|
|
|
|
-
|
|
|
|
|
- // code: 'PersonnelItem'
|
|
|
|
|
- // }
|
|
|
|
|
- // 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 () {
|
|
closedialog () {
|
|
|
this.dialogvisible = false
|
|
this.dialogvisible = false
|
|
|
},
|
|
},
|
|
|
handleCloseAdd () {
|
|
handleCloseAdd () {
|
|
|
this.$refs['testlistform'].resetFields()
|
|
this.$refs['testlistform'].resetFields()
|
|
|
- // this.$refs['uploader'].clearFiles()
|
|
|
|
|
- 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.Model = ''
|
|
|
|
|
- this.testlistform.Remarks = ''
|
|
|
|
|
- this.testlistform.Classification = ''
|
|
|
|
|
|
|
+ this.testlistform.PersonnelName = ''
|
|
|
|
|
+ this.testlistform.PersonneCode = ''
|
|
|
|
|
+ this.testlistform.Telephone = ''
|
|
|
|
|
+ this.testlistform.Mailbox = ''
|
|
|
|
|
+ this.testlistform.CardId = ''
|
|
|
|
|
+ this.testlistform.Address = ''
|
|
|
this.$emit('closeAddDialog')
|
|
this.$emit('closeAddDialog')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -373,19 +209,6 @@ export default {
|
|
|
var time = dates.getFullYear() + '-' + month + '-' + day
|
|
var time = dates.getFullYear() + '-' + month + '-' + day
|
|
|
return time
|
|
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)
|
|
|
|
|
- // })
|
|
|
|
|
- // }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|