上饶市警务平台后台管理前端
zengh
2022-12-07 b74beee46cee6b4274e68246321af4f8b2a3b9ed
1、值班联系方式联动下拉
3 files modified
78 ■■■■ changed files
src/api/scheduling/scheduling.js 9 ●●●●● patch | view | raw | blame | history
src/views/policeman/policeman.vue 4 ●●●● patch | view | raw | blame | history
src/views/scheduling/scheduling.vue 65 ●●●● patch | view | raw | blame | history
src/api/scheduling/scheduling.js
@@ -21,6 +21,15 @@
    }
  })
}
export const getPliceman = () => {
  return request({
    url: '/api/policeman/policeman/all',
    method: 'get',
    params: {
    }
  })
}
export const remove = (ids) => {
  return request({
src/views/policeman/policeman.vue
@@ -74,6 +74,10 @@
              prop: "serialNumber",
            },
            {
              label: "联系方式",
              prop: "contact",
            },
            {
              label: "所属辖区",
              prop: "deptId",
              type: "tree",
src/views/scheduling/scheduling.vue
@@ -32,7 +32,7 @@
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/scheduling/scheduling";
  import {getList, getDetail, add, update, remove, getPliceman} from "@/api/scheduling/scheduling";
  import {mapGetters} from "vuex";
  export default {
@@ -64,11 +64,11 @@
            {
              label: "值班员",
              prop: "person",
              type:"select",
              dicUrl:"/api/policeman/policeman/all",
              props:{
                label:"name",
                value:"id"
              type: "select",
              dicUrl: "",
              props: {
                label: "name",
                value: "id"
              }
            },
            {
@@ -78,8 +78,8 @@
            {
              label: "值班岗位",
              prop: "station",
              row:true,
              span:24
              row: true,
              span: 24
            },
            {
              label: "开始时间",
@@ -110,11 +110,11 @@
            {
              label: "带班领导",
              prop: "leads",
              type:"select",
              dicUrl:"/api/policeman/policeman/all",
              props:{
                label:"name",
                value:"id"
              type: "select",
              dicUrl: "",
              props: {
                label: "name",
                value: "id"
              }
            },
            {
@@ -123,7 +123,8 @@
            },
          ]
        },
        data: []
        data: [],
        policemanList: []
      };
    },
    computed: {
@@ -143,6 +144,29 @@
        });
        return ids.join(",");
      }
    },
    watch: {
      'form.person': {
        handler(res) {
          this.policemanList.forEach(e => {
            if (res == e.id) {
              this.form.contact = e.contact
            }
          })
        }
      },
      'form.leads': {
        handler(res) {
          this.policemanList.forEach(e => {
            if (res == e.id) {
              this.form.leadContact = e.contact
            }
          })
        }
      },
    },
    created() {
      this.getPolicemanAll();
    },
    methods: {
      rowSave(row, done, loading) {
@@ -235,10 +259,10 @@
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage){
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize){
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
@@ -253,6 +277,15 @@
          this.loading = false;
          this.selectionClear();
        });
      },
      getPolicemanAll() {
        getPliceman().then(res => {
          this.policemanList = res.data.data
          const securityIdColumn = this.findObject(this.option.column, "person")
          securityIdColumn.dicData = this.policemanList
          const securityIdColumns = this.findObject(this.option.column, "leads")
          securityIdColumns.dicData = this.policemanList
        })
      }
    }
  };