From d942877495ceea1575e64fb6d4e2972f6da10cac Mon Sep 17 00:00:00 2001 From: odc.xiaohui <xiaohui@Q1> Date: 星期三, 11 一月 2023 10:09:24 +0800 Subject: [PATCH] 2023/1/11 肖辉 修改UI样式 --- src/views/systemSetting/device/handheldTerminal/components/dialogForm.vue | 87 +++++++++++++++++++++---------------------- 1 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/views/systemSetting/device/handheldTerminal/components/dialogForm.vue b/src/views/systemSetting/device/handheldTerminal/components/dialogForm.vue index f231b83..0109e2a 100644 --- a/src/views/systemSetting/device/handheldTerminal/components/dialogForm.vue +++ b/src/views/systemSetting/device/handheldTerminal/components/dialogForm.vue @@ -40,7 +40,7 @@ </el-form-item> <!-- 閮ㄩ棬 --> <el-form-item class="optionItems" label="鎵�灞為儴闂�:" prop="departId"> - <el-select v-model="form.departId" placeholder="璇疯緭鍏ユ墍灞為儴闂�"> + <el-select v-model="form.departName" placeholder="璇疯緭鍏ユ墍灞為儴闂�"> <el-option :value="mylabel"> <el-tree ref="tree" @@ -73,15 +73,15 @@ </template> <script> import { validatePhone, validateName } from "@/utils/validate"; + +import { createNamespacedHelpers } from "vuex"; +const { mapActions } = createNamespacedHelpers("handheldTerminal"); + export default { data() { const checkName = (rule, value, callback) => { if (value) { - if (validateName(value)) { - callback(); - } else { - callback(new Error("璇锋纭緭鍏ュ崟鍏靛悕绉�")); - } + callback(); } else { callback(new Error("鍗曞叺鍚嶇О涓嶈兘涓虹┖")); } @@ -102,11 +102,7 @@ }; const checkUser = (rule, value, callback) => { if (value) { - if (validateName(value)) { - callback(); - } else { - callback(new Error("璇锋纭緭鍏ヤ娇鐢ㄤ汉鍛�")); - } + callback(); } else { callback(new Error("浣跨敤浜哄憳涓嶈兘涓虹┖")); } @@ -124,11 +120,10 @@ }; return { form: { - carNumber: "", - contact: "", - ownerName: "", - trajectory: "", - vehicleUser: "", + name: "", + code: "", + user: "", + phone: "", departName: "", departId: 0, }, @@ -198,37 +193,41 @@ // 鍒濆鍖栭儴闂ㄦ爲 getDepartTree(); // 鍒濆鍖栨暟鎹� - this.form = JSON.parse(JSON.stringify(this.info)); + this.form = this.info; if (!this.form.departName) { this.form.departName = this.form.pdepartName; } }, + + watch: { + info(newVal) { + this.form = newVal; //瀵圭埗缁勪欢浼犺繃鏉ョ殑鍊艰繘琛岀洃鍚紝濡傛灉鏀瑰彉涔熷瀛愮粍浠跺唴閮ㄧ殑鍊艰繘琛屾敼鍙� + }, + }, methods: { + ...mapActions(["saveHandheldTerminal", "updateHandheldTerminal"]), // 淇敼鎵ф硶杞� handleUpdateLawCar() { this.$refs.formRef.validate((valid) => { if (valid) { const { form } = this; - this.$axios({ - method: "put", - url: "sccg/car_Manage/modification_enforce", - data: { - ...form, - }, - }).then((res) => { - if (res.code === 200) { + if (form.id > 0) { + this.updateHandheldTerminal(form).then((res) => { this.$message({ type: "success", - message: "淇敼杞﹁締鎴愬姛", + message: "淇敼鎵嬫寔璁惧鎴愬姛", }); this.$emit("closeDialog", { flag: false, index: 1 }); - } else { + }); + } else { + this.saveHandheldTerminal(form).then((res) => { this.$message({ - type: "error", - message: res.message, + type: "success", + message: "淇濆瓨鎵嬫寔璁惧鎴愬姛", }); - } - }); + this.$emit("closeDialog", { flag: false, index: 1 }); + }); + } } else { return false; } @@ -277,13 +276,13 @@ <style lang="scss" scoped> .create { border-radius: 1px; - background-color: #09152f; + // background-color: #09152f; main { // border: 1px solid #fff; text-align: left; padding: 0 55px; - background-color: #09152f; + // background-color: #09152f; padding-bottom: 50px; .mainContent { @@ -323,18 +322,18 @@ } } - &::v-deep .el-textarea__inner { - background-color: #09152f; - border: 1px solid #17324c; - } + // &::v-deep .el-textarea__inner { + // background-color: #09152f; + // border: 1px solid #17324c; + // } - ::v-deep .el-form-item__label { - color: #4b9bb7; - } + // ::v-deep .el-form-item__label { + // color: #4b9bb7; + // } - ::v-deep .el-input__inner { - background-color: #09152f; - border: 1px solid #17324c; - } + // ::v-deep .el-input__inner { + // background-color: #09152f; + // border: 1px solid #17324c; + // } } </style> \ No newline at end of file -- Gitblit v1.8.0