Commit e323d0fd by 张杰

v1.4版本需求

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