Commit 759a1f0d authored by Mac's avatar Mac
parents 3d7d42d3 739bf549
......@@ -31,15 +31,15 @@ var uploadMsg = {
/**
* 自定义上传文件
*/
export function UploadSelfFile(path, file, isTrans, callback) {
export function UploadSelfFile(path, file, callback) {
Loading.show({
message: '正在上传文件,请稍后...'
})
var newPath = '/Upload/' + path + "/";
let url = uploadMsg.uploadUrl + "/Upload?filePath=" + newPath;
if (isTrans && isTrans == 1) {
url += "&isTrans=1"
}
// if (isTrans && isTrans == 1) {
// url += "&isTrans=1"
// }
let formData = new FormData()
formData.append('myfile', file)
let xhr = new XMLHttpRequest()
......
......@@ -71,8 +71,17 @@
class="col-6 q-pr-lg q-pb-lg" label="校区名称" :rules="[val => !!val || '请填写校区名称']" />
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SAddress" ref="SAddress"
class="col-6 q-pb-lg" label="校区地址" :rules="[val => !!val || '请填写校区地址']" />
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SLinkMan" ref="SLinkMan"
class="col-6 q-pr-lg q-pb-lg " label="校区联系人" :rules="[val => !!val || '请填写校区联系人']" />
<q-select class="col-6 q-pb-lg q-pr-lg" clearable filled stack-label use-input option-value="Id"
option-label="EmployeeName" v-model="objOption.ManagerId" ref="ManagerId" :options="EmployeeList"
label="校区联系人" :dense="false" emit-value map-options @filter="filterFn">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SLinkTel" ref="SLinkTel"
class="col-6 q-pb-lg" label="校区联系电话" :rules="[val => !!val || '请填写校区联系电话']" />
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Remark"
......@@ -108,6 +117,10 @@
import {
getDeptTree
} from '../../api/system/dept'
//员工
import {
queryEmployee
} from '../../api/users/user'
import selectTree from '../../components/common/select-tree'
export default {
meta: {
......@@ -143,9 +156,9 @@
sortable: true
},
{
name: 'SLinkMan',
name: 'ManagerName',
label: '负责人',
field: 'SLinkMan',
field: 'ManagerName',
align: 'left',
sortable: true
},
......@@ -207,28 +220,32 @@
SName: "",
Status: '-1'
},
StatusTemp: {},
StatusTemp: "",
pageCount: 0,
persistent: false,
objOption: {
SId: 0,
SName: "",
SAddress: "",
SLinkMan: "",
SLinkTel: "",
SDomain: "",
SLogo: "",
Remark: "",
Status: '0',
Dept_Id: 0, //管理部门
ManagerId: 0, //负责人编号
},
tempManager: "",
saveLoading: false,
DeptList: [], //部门列表
returnString: [], //默认值
EmployeeList: [], //员工列表
AllemployeeList: [], //所有员工
}
},
created() {
this.queryDeptTree();
this.getEmployee();
this.StatusTemp = this.StatusOpts[0]
},
mounted() {
......@@ -236,6 +253,31 @@
this.getSchool()
},
methods: {
filterFn(val, update) {
if (val && val != '') {
update(() => {
const needle = val.toLowerCase()
this.EmployeeList = this.AllemployeeList.filter(v => v.EmployeeName.toLowerCase().indexOf(needle) > -1)
})
} else {
this.EmployeeList = JSON.parse(JSON.stringify(this.AllemployeeList));
}
},
//获取员工列表
getEmployee() {
var qMsg = {
EmployeeName: ""
}
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
var jsonData = res.Data;
if (jsonData && jsonData > 0) {
this.AllemployeeList = JOSN.parse(JSON.stringify(jsonData));
this.EmployeeList = JOSN.parse(JSON.stringify(jsonData));;
}
}
})
},
getChild(deptArray) {
var tempStr = "";
if (deptArray && deptArray != '') {
......@@ -269,13 +311,13 @@
this.objOption.SId = 0;
this.objOption.SName = "";
this.objOption.SAddress = "";
this.objOption.SLinkMan = "";
this.objOption.SLinkTel = "";
this.objOption.SDomain = "";
this.objOption.SLogo = "";
this.objOption.Remark = "";
this.objOption.Status = "0";
this.objOption.Dept_Id = 0;
this.objOption.ManagerId = 0;
}
this.persistent = true;
},
......@@ -311,14 +353,15 @@
this.saveLoading = true
this.$refs.SName.validate()
this.$refs.SAddress.validate()
this.$refs.SLinkMan.validate()
this.$refs.SLinkTel.validate()
if (
!this.$refs.SName.hasError &&
!this.$refs.SAddress.hasError &&
!this.$refs.SLinkMan.hasError &&
!this.$refs.SLinkTel.hasError
) {
if (this.tempManager && this.tempManager.Id) {
this.objOption.ManagerId = this.tempManager.Id;
}
saveSchool(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment