zhanghua
2023-01-30 5173f8e31d106abd003e123c8679cf53c7940b33
src/views/systemSetting/device/handheldTerminal/components/dialogForm.vue
@@ -73,6 +73,10 @@
</template>
  <script>
import { validatePhone, validateName } from "@/utils/validate";
import { createNamespacedHelpers } from "vuex";
const { mapActions } = createNamespacedHelpers("handheldTerminal");
export default {
  data() {
    const checkName = (rule, value, callback) => {
@@ -189,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;
        }
@@ -268,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 {
@@ -314,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>