fangyuan
2022-12-16 9ff66017debadfc89bc0c1b796684a4d1dbe2bc3
src/views/systemSetting/device/handheldTerminal/index.vue
@@ -23,10 +23,7 @@
    <main>
      <div class="main-content">
        <div class="main-title">
          <el-button
            class="el-icon-plus"
            type="primary"
            @click="dialogCreate = true"
          <el-button class="el-icon-plus button-addition" type="primary" @click="handleAdd"
            >添加</el-button
          >
        </div>
@@ -53,7 +50,7 @@
          </el-table-column>
          <el-table-column prop="phone" label="联系方式" min-width="10">
          </el-table-column>
          <el-table-column prop="pDepartName" label="所属部门" min-width="10">
          <el-table-column prop="pdepartName" label="所属部门" min-width="10">
          </el-table-column>
          <el-table-column prop="departName" label="所属大队" min-width="10">
          </el-table-column>
@@ -68,7 +65,7 @@
          <el-table-column prop="operation" label="操作" min-width="20">
            <template slot-scope="scope">
              <div class="btn">
              <div class="operation">
                <span @click="handleEdit(scope.row)">编辑</span>
                <span class="line">|</span>
                <span @click="handleDelete(scope.row)">删除</span>
@@ -105,7 +102,7 @@
        width="60%"
        :before-close="handleClose"
      >
        <MyForm :info="handheldTerminal" :closeDialog="setTableData"></MyForm>
        <MyForm :info="handheldTerminal" @closeDialog="handleCallBack"></MyForm>
      </el-dialog>
    </footer>
  </div>
@@ -142,31 +139,47 @@
      pageSize: 10,
      currentPage: 1,
      renderFlag: false,
      handheldTerminal: {
        id: 0,
        name: "",
        code: "",
        user: "",
        phone: "",
        departId: 0,
      },
      handheldTerminal: {},
    };
  },
  created() {
    this.setTableData();
  },
  methods: {
    ...mapActions([
      "getHandheldTerminalList",
      "saveHandheldTerminal",
      "updateHandheldTerminal",
    ]),
    ...mapActions(["getHandheldTerminalList", "deleteHandheldTerminal"]),
    handleAdd() {
      this.handheldTerminal = {
        id: 0,
        name: "",
        code: "",
        user: "",
        phone: "",
        departId: 0,
        departName: "",
      };
      this.dialogCreate = true;
    },
    handleEdit(row) {
      this.handheldTerminal = row;
      this.dialogCreate = true;
    },
    handleDelete(row) {},
    handleDelete(row) {
      this.$confirm("确认删除?").then((_) => {
        this.deleteHandheldTerminal(row.id).then((res) => {
          this.$message({
            type: "success",
            message: "删除成功!",
          });
          this.setTableData();
        });
      });
    },
    handleCallBack(e) {
      this.currentPage = 1;
      this.dialogCreate = false;
      this.setTableData();
    },
    formatSate(row, column) {
      return row.state == 1 ? "在线" : "离线";
    },
@@ -183,6 +196,7 @@
    // 弹窗关闭
    handleClose(done) {
      this.$confirm("确认关闭?").then((_) => {
        this.dialogCreate = false;
        done();
      });
    },
@@ -194,8 +208,8 @@
        pageSize,
        state: context,
      }).then((res) => {
          this.list = res.records;
          this.totalNum = res.total;
        this.list = res.records;
        this.totalNum = res.total;
      });
    },
    handleStateChange(e) {