Commit f20736b6 by 张杰

v1.4版本需求

1 parent d9e40e1f
......@@ -82,6 +82,7 @@ export default {
viewMode: "3D", //是否为3D地图模式
});
_amap.on("complete", function () {
console.log(_this.info);
if (_this.info && (_this.info.bsLng || _this.info.gpsLng)) {
_this.drawMaker();
}
......
......@@ -85,8 +85,8 @@
<el-form-item label="设备SN号:" :prop="'snList.' + index + '.sn'" :rules="deviceRules">
<el-input v-model="item.sn" maxlength="20" placeholder="请输入设备号"></el-input>
</el-form-item>
<el-form-item label="设备型号:" :prop="'snList.' + index + '.model'" :rules="[{ required: true, message: '未识别到正确设备型号', trigger:['blur','change']}]">
<el-input v-model="item.model" disabled></el-input>
<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>
<el-button type="primary" size="mini" class="el_btn" @click="lookLocation(item,index)">查看定位</el-button>
......@@ -121,10 +121,10 @@
<div ref="carInfo" class="line_title glsx_hairline">车辆信息</div>
<div class="form_flex">
<el-form-item label="车牌号:">
<plate-number-input v-model="editForm.plateNo" :disabled="isDisabled"></plate-number-input>
<plate-number-input v-model="editForm.plateNo" :disabled="editForm.orderStatus == 2"></plate-number-input>
</el-form-item>
<el-form-item label="车架号:" prop="vin">
<el-input v-model.trim="editForm.vin" maxlength="17" placeholder="请输入" :disabled="isDisabled"></el-input>
<el-input v-model.trim="editForm.vin" maxlength="17" placeholder="请输入" :disabled="editForm.orderStatus == 2"></el-input>
</el-form-item>
</div>
<div class="form_flex">
......@@ -152,7 +152,7 @@
<!-- 安装照片 开始 -->
<div class="line_title glsx_hairline">安装照片</div>
<image-upload v-model="editForm.workOrderDocs"></image-upload>
<image-upload v-model="editForm.workOrderDocs" :status="type"></image-upload>
<!-- 安装照片 end -->
<!-- 操作日志 开始 -->
......@@ -222,7 +222,7 @@ export default {
function checkDevice(rule, value, cb) {
console.log(rule);
let idx = rule.field.split(".")[1];
if (value) {
if (value && value.length >= 6) {
let oParams = {
devices: [{ sn: value }],
workOrderId: _this.editForm.id,
......@@ -237,15 +237,15 @@ export default {
if (nd) {
_this.$set(_this.editForm.snList, idx, nd);
}
GET_CLASSIFYNAME_INFO({ sn: value }).then((response) => {
if (response.data) {
//let idx = m.findIndex((k) => k.sn == value);
let o = m[idx];
//o = Object.assign(o, res.data);
o.model = response.data;
_this.$set(_this.editForm.snList, idx, o);
}
});
// GET_CLASSIFYNAME_INFO({ sn: value }).then((response) => {
// if (response.data) {
// //let idx = m.findIndex((k) => k.sn == value);
// let o = m[idx];
// //o = Object.assign(o, res.data);
// o.model = response.data;
// _this.$set(_this.editForm.snList, idx, o);
// }
// });
cb();
} else {
cb(new Error(res.message));
......@@ -360,6 +360,14 @@ export default {
deviceCompose: [
{ required: true, message: "请选择设备套餐", trigger: "change" },
],
vin: [
{ required: true, message: "请输入车架号", trigger: "blur" },
{
pattern: Validator.CHECKVINNUMBER,
message: "17位英文和数字组合",
trigger: "blur",
},
],
},
formRules: {},
logList: [],
......@@ -490,9 +498,11 @@ export default {
arr.push({ id: moment().format("x") });
}
}
m.snList = arr;
// m.snList = arr;
console.log(m);
this.editForm = m;
this.batchCheckDevices(arr);
setTimeout(() => {
_this.initRules();
}, 100);
......@@ -656,6 +666,7 @@ export default {
oParams.activateType = type || 1;
oParams.workOrderDocs = o.workOrderDocs;
oParams.plateNo = o.plateNo;
oParams.vin = o.vin;
ACTIVATE_WORKORDER_INFO(oParams).then((res) => {
if (res.code != 200) {
......@@ -722,10 +733,32 @@ export default {
// 获取地图数据
getMapInfo(row) {
console.log(row);
let m = this.editForm;
let oParams = { ...m };
let gpsInfo = row.gpsBsData ? row.gpsBsData.gpsLocation : {};
let bsInfo = row.gpsBsData ? row.gpsBsData.bsLocation : {};
let oParams = {};
oParams.sn = row.sn;
//oParams.gpsData
oParams.name = row.ownerName;
oParams.standNo = m.vin;
// gps 信息
oParams.lng = gpsInfo.lng;
oParams.lat = gpsInfo.lat;
oParams.address = gpsInfo.address;
oParams.time = gpsInfo.dateTime;
//基站信息
oParams.bsLng = bsInfo.lng;
oParams.bsLat = bsInfo.lat;
oParams.bsAddress = row.address;
oParams.bsTime = row.dateTime;
// 定位类型
oParams.type = 2;
return oParams;
},
......@@ -742,6 +775,27 @@ export default {
this.$set(this.editForm.snList, index, row);
},
// 批量查询校验sn
batchCheckDevices(arr) {
let _this = this;
if (!arr || arr.length <= 0) {
return false;
}
let oParams = {};
let list = [];
arr.map((k) => {
if (k.sn) {
list.push({ sn: k.sn });
}
});
oParams.workOrderId = this.editForm.id;
oParams.devices = list;
VERIFY_WORKORDER_INFO(oParams).then((res) => {
let { data } = res;
_this.$set(_this.editForm, "snList", data || []);
});
},
},
};
</script>
......
......@@ -3,14 +3,14 @@
<!-- 图片列表 开始 -->
<div class="img_cell" v-for="(item,index) in imgList" :key="index">
<div class="el_img_box">
<i class="el-icon-error el_icon" @click="removeImage(item)"></i>
<i class="el-icon-error el_icon" @click="removeImage(item)" v-if="readStatus != 1"></i>
<el-image class="el_img" :src="item.path" :preview-src-list="[item.path]"></el-image>
</div>
</div>
<!-- 图片列表 end -->
<!-- 上传 开始 -->
<el-upload class="el_upload" v-if="imgList&&imgList.length<9" :action="uploadUrl" list-type="picture-card" :show-file-list="false" :on-change="onChange" :http-request="uploadRequest">
<el-upload class="el_upload" v-if="showUpload()" :action="uploadUrl" list-type="picture-card" :accept="acceptFile" :show-file-list="false" :on-change="onChange" :http-request="uploadRequest">
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传 end -->
......@@ -22,6 +22,7 @@ import axios from "axios";
import sign from "@/utils/sign";
import qs from "qs";
import { DELETE_ORDER_IMAGE } from "@/services/order";
import { showToast } from "@/utils/util";
export default {
name: "ImageUpload",
props: {
......@@ -31,11 +32,21 @@ export default {
return [];
},
},
status: {
type: [String, Number],
default: "",
},
limit: {
type: [String, Number],
default: 20,
},
},
data() {
return {
imgList: [],
uploadUrl: "",
readStatus: "",
acceptFile: ".jpg,.png",
};
},
watch: {
......@@ -45,11 +56,21 @@ export default {
},
immediate: true,
},
status: {
handler: function (n, o) {
this.readStatus = n;
},
immediate: true,
},
},
mounted() {
console.log(this.status);
},
mounted() {},
methods: {
// 监听选择图片
onChange(file, fileList) {},
onChange(file, fileList) {
console.log(file);
},
// 图片转换成base64
toBase64(file) {
......@@ -74,6 +95,12 @@ export default {
// 自定义上传
uploadRequest(e) {
let file = e.file;
if (file.size > 10 * 1024 * 1024) {
showToast({
message: "图片最大上传10M",
});
return false;
}
this.toBase64(file);
},
......@@ -117,6 +144,17 @@ export default {
DELETE_ORDER_IMAGE({ id: row.id });
}
},
// 是否可以上传
showUpload() {
if (this.readStatus == 1) {
return false;
}
if (this.imgList && this.imgList.length > this.limit) {
return false;
}
return true;
},
},
};
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!