|
|
@ -12,325 +12,241 @@ |
|
|
|
<div class="listconadd"> |
|
|
|
<el-form ref="form_obj" :model="addForm" :rules="rules" class="formadd"> |
|
|
|
<div class="title"> |
|
|
|
<div>编辑质物监测信息</div> |
|
|
|
<div>设置定时任务</div> |
|
|
|
</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>质物编码</span> |
|
|
|
<span>隔几年执行一次</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop=""> |
|
|
|
<el-input v-model="addForm.manufacturerName" maxlength="20" placeholder="请填写质物编码" class="addinputw" |
|
|
|
clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>质物位置</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="addForm.manufacturerAs" maxlength="20" placeholder="请填写质物位置 " class="addinputw" |
|
|
|
clearable /> |
|
|
|
<el-input v-model="addForm.year" maxlength="20" placeholder="请填写单位(年),例:0/1(每年执行一次)" class="addinputw" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>拍照时间</span> |
|
|
|
<span>隔几月执行一次</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop=""> |
|
|
|
<!-- <el-date-picker type="datatime" placeholder="选择日期" v-model="addForm.manufacturerCode" style="width: 410px;" |
|
|
|
maxlength="20"></el-date-picker> --> |
|
|
|
<el-date-picker style="width: 80%;" |
|
|
|
v-model="addForm.value1" |
|
|
|
type="datetime" |
|
|
|
placeholder="选择日期时间"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>拍照图片</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-upload |
|
|
|
class="upload-demo" |
|
|
|
action="https://jsonplaceholder.typicode.com/posts/" |
|
|
|
:on-preview="handlePreview" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
multiple |
|
|
|
:limit="3" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:file-list="fileList"> |
|
|
|
<el-button size="small" type="primary">添加图片</el-button> |
|
|
|
</el-upload> |
|
|
|
<el-input v-model="addForm.month" maxlength="20" placeholder="请填写单位(月),例:0/1(每月执行一次)" class="addinputw" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<!-- <el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>质物类型</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="addForm.manufacturerCode" filterable clearable placeholder="请选择质物类型" |
|
|
|
style="width: 410px;"> |
|
|
|
<el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" |
|
|
|
class="addinputw" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>拍照时间</span> |
|
|
|
<span>隔几天执行一次</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop=""> |
|
|
|
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerCode" style="width: 410px;" |
|
|
|
maxlength="20"></el-date-picker> |
|
|
|
<el-input v-model="addForm.day" maxlength="20" placeholder="请填写单位(天),例:0/1(每天执行一次)" class="addinputw" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> --> |
|
|
|
<!-- <el-row> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>出厂时间</span> |
|
|
|
<span>隔几小时执行一次</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop=""> |
|
|
|
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerCode" style="width: 410px;" |
|
|
|
maxlength="20"></el-date-picker> |
|
|
|
<el-input v-model="addForm.hour" maxlength="20" placeholder="请填写单位(时),例:0/1(每时执行一次)" class="addinputw" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>供货商</span> |
|
|
|
<span>隔几分钟执行一次</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop=""> |
|
|
|
<el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20" placeholder="请填写供应商编码" |
|
|
|
class="addinputw" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> --> |
|
|
|
<!-- <el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>生产厂家</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="addForm.manufacturerTelePhone" maxlength="20" placeholder="请填写生产厂家编码" |
|
|
|
class="addinputw" clearable /> |
|
|
|
<el-input v-model="addForm.divide" maxlength="20" placeholder="请填写单位(分),例:0/1(每分执行一次)" class="addinputw" |
|
|
|
clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>保修截止日期</span> |
|
|
|
<span>隔几秒钟执行一次</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerFax" style="width: 410px;" |
|
|
|
maxlength="20"></el-date-picker> |
|
|
|
<el-form-item prop=""> |
|
|
|
<el-input v-model="addForm.second" maxlength="20" placeholder="请填写单位(秒),例:0/1(每秒执行一次)" class="addinputw" |
|
|
|
clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> --> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
// import req from '@/api/shebeitaizhang/shebeitaizhang' |
|
|
|
// import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'shebeitaizhangAdd', |
|
|
|
data() { |
|
|
|
var checkSubmit = (rule, value, callback) => { |
|
|
|
const Submit = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ |
|
|
|
if (Submit.test(value)) { |
|
|
|
return callback() |
|
|
|
} |
|
|
|
callback(new Error('请输入手机号')) |
|
|
|
import { updateCron } from "@/api/deviceImage/deviceImage" |
|
|
|
export default { |
|
|
|
name: 'shebeitaizhangAdd', |
|
|
|
data() { |
|
|
|
var checkSubmit = (rule, value, callback) => { |
|
|
|
const Submit = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ |
|
|
|
if (Submit.test(value)) { |
|
|
|
return callback() |
|
|
|
} |
|
|
|
var checkChuanzhen = (rule, value, callback) => { |
|
|
|
const BanGongDianHua = /\d{3}-\d{8}|\d{4}-\d{7}/ |
|
|
|
if (value) { |
|
|
|
// 如果没有通过验证!! |
|
|
|
if (!BanGongDianHua.test(value)) { |
|
|
|
callback(new Error('请输入正确的传真格式')) |
|
|
|
} |
|
|
|
callback() |
|
|
|
} else { |
|
|
|
callback() |
|
|
|
callback(new Error('请输入手机号')) |
|
|
|
} |
|
|
|
var checkChuanzhen = (rule, value, callback) => { |
|
|
|
const BanGongDianHua = /\d{3}-\d{8}|\d{4}-\d{7}/ |
|
|
|
if (value) { |
|
|
|
// 如果没有通过验证!! |
|
|
|
if (!BanGongDianHua.test(value)) { |
|
|
|
callback(new Error('请输入正确的传真格式')) |
|
|
|
} |
|
|
|
callback() |
|
|
|
} else { |
|
|
|
callback() |
|
|
|
} |
|
|
|
return { |
|
|
|
fileList: [], |
|
|
|
tableKey: 0, |
|
|
|
index: 0, |
|
|
|
viewState: 1, |
|
|
|
viewTitle: '', |
|
|
|
dialogStatus: '', |
|
|
|
sid: '', |
|
|
|
isShow: true, |
|
|
|
supplierType_list: [ |
|
|
|
} |
|
|
|
return { |
|
|
|
fileList: [], |
|
|
|
tableKey: 0, |
|
|
|
index: 0, |
|
|
|
viewState: 1, |
|
|
|
viewTitle: '', |
|
|
|
dialogStatus: '', |
|
|
|
sid: '', |
|
|
|
isShow: true, |
|
|
|
supplierType_list: [ |
|
|
|
{ title: '摄像头', id: '1' }, |
|
|
|
{ title: '电子围栏', id: '2' }, |
|
|
|
{ title: '门禁', id: '3' }, |
|
|
|
{ title: '机器人', id: '4' } |
|
|
|
], |
|
|
|
addForm: { |
|
|
|
manufacturerName: '', |
|
|
|
manufacturerAs: '', |
|
|
|
manufacturerCode: '', |
|
|
|
supplierType: '', |
|
|
|
supplierTypeValue: '', |
|
|
|
manufacturerAddress: '', |
|
|
|
manufacturerTelePhone: '', |
|
|
|
manufacturerFax: '', |
|
|
|
contactName: '', |
|
|
|
contactMobile: '', |
|
|
|
contactTelePhone: '', |
|
|
|
weChatID: '', |
|
|
|
zipCode: '', |
|
|
|
email: '', |
|
|
|
createOrg: '', |
|
|
|
useOrg: '' |
|
|
|
}, |
|
|
|
baseManufacturerBankDto: [], |
|
|
|
rules: { |
|
|
|
manufacturerName: [{ |
|
|
|
required: true, |
|
|
|
message: '请填写供应商名称', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
supplierTypeValue: [{ |
|
|
|
required: true, |
|
|
|
message: '请选择分类', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
manufacturerAddress: [{ |
|
|
|
required: true, |
|
|
|
message: '请填写供应商通讯地址', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
manufacturerFax: [{ |
|
|
|
required: true, |
|
|
|
validator: checkChuanzhen, |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
contactName: [{ |
|
|
|
required: true, |
|
|
|
message: '请填写联系人名字', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
contactMobile: [{ |
|
|
|
required: true, |
|
|
|
validator: checkSubmit, |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
manufacturerCode: [{ |
|
|
|
required: true, |
|
|
|
message: '编码不能为空', |
|
|
|
trigger: 'blur' |
|
|
|
}] |
|
|
|
}, |
|
|
|
submitdisabled: false |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//图片添加开始 |
|
|
|
handleRemove(file, fileList) { |
|
|
|
console.log(file, fileList); |
|
|
|
}, |
|
|
|
handlePreview(file) { |
|
|
|
console.log(file); |
|
|
|
}, |
|
|
|
handleExceed(files, fileList) { |
|
|
|
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`); |
|
|
|
}, |
|
|
|
//图片添加结束 |
|
|
|
init() { |
|
|
|
typeValues({ type: 'supplierType' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.supplierType_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
{ title: '电子围栏', id: '2' }, |
|
|
|
{ title: '门禁', id: '3' }, |
|
|
|
{ title: '机器人', id: '4' } |
|
|
|
], |
|
|
|
addForm: { |
|
|
|
manufacturerName: '', |
|
|
|
manufacturerAs: '', |
|
|
|
manufacturerCode: '', |
|
|
|
supplierType: '', |
|
|
|
supplierTypeValue: '', |
|
|
|
manufacturerAddress: '', |
|
|
|
manufacturerTelePhone: '', |
|
|
|
manufacturerFax: '', |
|
|
|
contactName: '', |
|
|
|
contactMobile: '', |
|
|
|
contactTelePhone: '', |
|
|
|
weChatID: '', |
|
|
|
zipCode: '', |
|
|
|
email: '', |
|
|
|
createOrg: '', |
|
|
|
useOrg: '' |
|
|
|
}, |
|
|
|
changeSupplierType(value) { |
|
|
|
let bb = null |
|
|
|
this.supplierType_list.forEach((e) => { |
|
|
|
if (e.dictValue === value) { |
|
|
|
bb = { |
|
|
|
key: e.dictKey, |
|
|
|
value: e.dictValue |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.addForm.supplierType = bb.key |
|
|
|
baseManufacturerBankDto: [], |
|
|
|
rules: { |
|
|
|
manufacturerName: [{ |
|
|
|
required: true, |
|
|
|
message: '请填写供应商名称', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
supplierTypeValue: [{ |
|
|
|
required: true, |
|
|
|
message: '请选择分类', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
manufacturerAddress: [{ |
|
|
|
required: true, |
|
|
|
message: '请填写供应商通讯地址', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
manufacturerFax: [{ |
|
|
|
required: true, |
|
|
|
validator: checkChuanzhen, |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
contactName: [{ |
|
|
|
required: true, |
|
|
|
message: '请填写联系人名字', |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
contactMobile: [{ |
|
|
|
required: true, |
|
|
|
validator: checkSubmit, |
|
|
|
trigger: 'blur' |
|
|
|
}], |
|
|
|
manufacturerCode: [{ |
|
|
|
required: true, |
|
|
|
message: '编码不能为空', |
|
|
|
trigger: 'blur' |
|
|
|
}] |
|
|
|
}, |
|
|
|
handleSave() { |
|
|
|
this.$refs['form_obj'].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
const formobj = { |
|
|
|
baseManufacturerBankDto: this.baseManufacturerBankDto, |
|
|
|
addForm: this.addForm |
|
|
|
} |
|
|
|
if (this.dialogStatus === 'add') { |
|
|
|
req.save(formobj).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
this.handleReturn('true') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
} else if (this.dialogStatus === 'edit') { |
|
|
|
req.update(formobj, this.sid).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
this.handleReturn('true') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
return false |
|
|
|
submitdisabled: false |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//图片添加开始 |
|
|
|
handleRemove(file, fileList) { |
|
|
|
console.log(file, fileList); |
|
|
|
}, |
|
|
|
handlePreview(file) { |
|
|
|
console.log(file); |
|
|
|
}, |
|
|
|
handleExceed(files, fileList) { |
|
|
|
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); |
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
}, |
|
|
|
//图片添加结束 |
|
|
|
init() { |
|
|
|
typeValues({ type: 'supplierType' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.supplierType_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeSupplierType(value) { |
|
|
|
let bb = null |
|
|
|
this.supplierType_list.forEach((e) => { |
|
|
|
if (e.dictValue === value) { |
|
|
|
bb = { |
|
|
|
key: e.dictKey, |
|
|
|
value: e.dictValue |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.dialogStatus = '' |
|
|
|
this.sid = '' |
|
|
|
this.addForm = {} |
|
|
|
this.baseManufacturerBankDto = [] |
|
|
|
this.isShow = true |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.addForm.supplierType = bb.key |
|
|
|
}, |
|
|
|
showAdd() { }, |
|
|
|
handleSave() { |
|
|
|
updateCron(this.addForm).then(resp => { |
|
|
|
this.submitdisabled = false |
|
|
|
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|
|
|
this.handleReturn('true') |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.dialogStatus = '' |
|
|
|
this.sid = '' |
|
|
|
this.addForm = {} |
|
|
|
this.baseManufacturerBankDto = [] |
|
|
|
this.isShow = true |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
.divStyle { |
|
|
|
padding: 7px; |
|
|
|
font-weight: bold; |
|
|
|
font-size: 16px; |
|
|
|
background-color: #0294d7; |
|
|
|
text-align: left; |
|
|
|
color: #ffffff; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
.divStyle { |
|
|
|
padding: 7px; |
|
|
|
font-weight: bold; |
|
|
|
font-size: 16px; |
|
|
|
background-color: #0294d7; |
|
|
|
text-align: left; |
|
|
|
color: #ffffff; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
</style> |
|
|
|