Commit e323d0fd by 张杰

v1.4版本需求

1 parent f20736b6
<template>
<div>
<el-input placeholder="请输入内容" v-model="plateNo" maxlength="6" @input="onInput">
<el-input placeholder="请输入内容" v-model="plateNo" maxlength="6" @input="onInput" :disabled="disabled">
<template slot="prepend">
<el-popover v-model="showPopover" ref="popover" placement="bottom-start" width="490" trigger="click">
<el-popover v-model="showPopover" ref="popover" placement="bottom-start" width="490" trigger="manual" :disabled="disabled">
<div>
<div class="province-select">
<el-tag class="el_tag" v-for="item in provinceArr" :key="item" :effect="plateProvince==item ?'dark':'light'" :type="plateProvince==item?'primary':'info'" @click="selectProvince(item)">{{ item }}</el-tag>
......@@ -12,7 +12,7 @@
</div>
</div>
<template slot="reference">
<div class="plate_show">
<div class="plate_show" @click="openKeyboard">
<span class="plate_name" v-if="!plateProvince && !plateLetter">请选择</span>
<span class="plate_name">{{plateProvince}}</span>
<span class="plate_name">{{plateLetter}}</span>
......@@ -32,10 +32,15 @@ export default {
type: String,
default: "",
},
disabled: {
type: Boolean,
default: false,
},
},
model: {
prop: "",
},
data() {
return {
provinceArr: [
......@@ -108,26 +113,23 @@ export default {
watch: {
value: {
handler: function (n, o) {
console.log(n)
console.log(n);
this.value = n;
if(!n){
this.plateNo = ''
this.plateProvince = ''
this.plateLetter = ''
if (!n) {
this.plateNo = "";
this.plateProvince = "";
this.plateLetter = "";
}
if(n){
this.plateProvince = n.substr(0,1)
this.plateLetter = n.substr(1,1)
this.plateNo = n.substr(2,n.length-2)
if (n) {
this.plateProvince = n.substr(0, 1);
this.plateLetter = n.substr(1, 1);
this.plateNo = n.substr(2, n.length - 2);
}
},
},
},
created() {
},
created() {},
methods: {
// 选择省份
selectProvince(e) {
......@@ -153,6 +155,15 @@ export default {
}`;
this.$emit("input", plate);
},
// 打开键盘
openKeyboard() {
console.log(this.disabled);
if (this.disabled) {
return false;
}
this.showPopover = !this.showPopover;
},
},
};
</script>
......
......@@ -88,7 +88,7 @@
<el-form-item label="设备型号:" :prop="'snList.' + index + '.deviceClassifyName'" :rules="[{ required: true, message: '未识别到正确设备型号', trigger:['blur','change']}]">
<el-input v-model="item.deviceClassifyName" disabled></el-input>
</el-form-item>
<span class="device_tips" :class="!item.checkResult?'cred':''">{{item.checkResult?'验证通过':'验证不通过'}}</span>
<span class="device_tips" :class="!item.checkResult?'cred':''" v-if="item.sn">{{item.checkResult?'验证通过':'验证不通过'}}</span>
<el-button type="primary" size="mini" class="el_btn" @click="lookLocation(item,index)">查看定位</el-button>
</div>
<map-location :info="getMapInfo(item)" :key="`map_${index}`" v-if="item.showMap"></map-location>
......@@ -194,7 +194,7 @@ import OrderProgress from "./progress";
import ImageUpload from "./image";
/**
* type 1:查看工单,不可编辑 2:编辑工单 3:激活工单
* type 1:查看工单,不可编辑 2:编辑工单 3:激活工单 4:审核工单
* id 工单id
*/
export default {
......@@ -491,16 +491,14 @@ export default {
// 循环设备
let arr = [];
if (n.devices) {
if (n.devices && n.devices.length > 0) {
arr = n.devices;
} else {
for (var i = 0; i < m.deviceCnt; i++) {
arr.push({ id: moment().format("x") });
}
}
// m.snList = arr;
console.log(m);
m.snList = arr;
this.editForm = m;
this.batchCheckDevices(arr);
setTimeout(() => {
......@@ -707,17 +705,26 @@ export default {
initRules() {
let _id = "orderInfo";
switch (this.type) {
case 4:
// 审核工单
this.formRules = this.activeRules;
this.isDisabled = true;
_id = "deviceInfo";
break;
case 3:
// 激活工单
this.formRules = this.activeRules;
this.isDisabled = true;
_id = "deviceInfo";
break;
case 2:
// 编辑工单
this.formRules = this.editFormRules;
this.isDisabled = false;
_id = "orderInfo";
break;
default:
// 查看工单
this.formRules = this.editFormRules;
this.isDisabled = false;
_id = "orderInfo";
......@@ -779,6 +786,9 @@ export default {
// 批量查询校验sn
batchCheckDevices(arr) {
let _this = this;
if(this.type != 4){
return false;
}
if (!arr || arr.length <= 0) {
return false;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!