| | |
| | | } |
| | | }) |
| | | } |
| | | export const getPliceman = () => { |
| | | return request({ |
| | | url: '/api/policeman/policeman/all', |
| | | method: 'get', |
| | | params: { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | |
| | | prop: "serialNumber", |
| | | }, |
| | | { |
| | | label: "联系方式", |
| | | prop: "contact", |
| | | }, |
| | | { |
| | | label: "所属辖区", |
| | | prop: "deptId", |
| | | type: "tree", |
| | |
| | | </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 { |
| | |
| | | { |
| | | label: "值班员", |
| | | prop: "person", |
| | | type:"select", |
| | | dicUrl:"/api/policeman/policeman/all", |
| | | props:{ |
| | | label:"name", |
| | | value:"id" |
| | | type: "select", |
| | | dicUrl: "", |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | } |
| | | }, |
| | | { |
| | |
| | | { |
| | | label: "值班岗位", |
| | | prop: "station", |
| | | row:true, |
| | | span:24 |
| | | row: true, |
| | | span: 24 |
| | | }, |
| | | { |
| | | label: "开始时间", |
| | |
| | | { |
| | | label: "带班领导", |
| | | prop: "leads", |
| | | type:"select", |
| | | dicUrl:"/api/policeman/policeman/all", |
| | | props:{ |
| | | label:"name", |
| | | value:"id" |
| | | type: "select", |
| | | dicUrl: "", |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | } |
| | | }, |
| | | { |
| | |
| | | }, |
| | | ] |
| | | }, |
| | | data: [] |
| | | data: [], |
| | | policemanList: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }); |
| | | 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) { |
| | |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | |
| | | 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 |
| | | }) |
| | | } |
| | | } |
| | | }; |