|
@@ -1,210 +1,232 @@
|
|
<template>
|
|
<template>
|
|
- <rx-dialog @handOk="handleSubmit" @cancel="cancel">
|
|
|
|
- <rx-layout>
|
|
|
|
- <div slot="center">
|
|
|
|
- <div class="agent-title">代理人设置基本信息</div>
|
|
|
|
- <a-form-model style="border:1px solid #e8e8e8;margin: 0 20px;" ref="knowledgeRef" :model="agentForm" layout="inline">
|
|
|
|
- <a-row>
|
|
|
|
- <a-col :span="12">
|
|
|
|
- <a-form-model-item label="代理描述:" prop="agentDesc">
|
|
|
|
- <a-input style="width:80%;" v-model="agentForm.agentDesc" placeholder="请输入代理描述" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :span="12">
|
|
|
|
- <a-form-model-item label="代理类型:" prop="agentType">
|
|
|
|
- <a-radio-group v-model="agentForm.agentType">
|
|
|
|
- <a-radio :value="1">
|
|
|
|
- 全部
|
|
|
|
- </a-radio>
|
|
|
|
- </a-radio-group>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- <a-row>
|
|
|
|
- <a-col :span="12">
|
|
|
|
- <a-form-model-item label="代理给:" prop="forUser">
|
|
|
|
- <a-input style="width:80%;" v-model="agentForm.forUser" placeholder="请输入代理人" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :span="12">
|
|
|
|
- <a-form-model-item label="状态:" prop="status">
|
|
|
|
- <a-radio-group v-model="agentForm.status">
|
|
|
|
- <a-radio :value="1">
|
|
|
|
- 启用
|
|
|
|
- </a-radio>
|
|
|
|
- <a-radio :value="2">
|
|
|
|
- 禁用
|
|
|
|
- </a-radio>
|
|
|
|
- </a-radio-group>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- <a-row>
|
|
|
|
- <a-col :span="12">
|
|
|
|
- <a-form-model-item label="开始时间:" prop="startTime">
|
|
|
|
- <a-date-picker v-model="agentForm.startTime" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :span="12">
|
|
|
|
- <a-form-model-item label="结束时间:" prop="endTime">
|
|
|
|
- <a-date-picker v-model="agentForm.endTime" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- <a-row>
|
|
|
|
- <a-form-model-item label="描述:" prop="desc">
|
|
|
|
- <a-input v-model="agentForm.desc" type="textarea" :autosize="{minRows: 3, maxRows: 6}" placeholder="请输入描" />
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-row>
|
|
|
|
- </a-form-model>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <div class="agent-title">流程代理设置基本信息</div>
|
|
|
|
+ <a-form-model style="margin: 0 20px;" ref="agentRef" :model="agentForm" layout="inline">
|
|
|
|
+ <a-row class="col-style">
|
|
|
|
+ <div>代理描述*</div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-form-model-item prop="sketch" style="width:95.8%;">
|
|
|
|
+ <a-input v-model="agentForm.sketch" placeholder="请输入代理描述" />
|
|
|
|
+ </a-form-model-item>
|
|
</div>
|
|
</div>
|
|
- </rx-layout>
|
|
|
|
-
|
|
|
|
- </rx-dialog>
|
|
|
|
|
|
+ </a-row>
|
|
|
|
+ <a-row>
|
|
|
|
+ <a-col :span="12" class="col-style" style="border-top: none;">
|
|
|
|
+ <div>代 理 给*</div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-form-model-item prop="tagerName" style="width:90%;">
|
|
|
|
+ <div @click="showAuditFlag = true">
|
|
|
|
+ <a-select v-model="agentForm.tagerName" :showArrow="false" :open="false" placeholder="请选择代理人">
|
|
|
|
+ <!-- <a-icon slot="suffixIcon" type="smile" /> -->
|
|
|
|
+ </a-select>
|
|
|
|
+ </div>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </div>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="12" class="col-style" style="border-top: none;border-left:none;">
|
|
|
|
+ <div>状  态*</div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-form-model-item prop="state" style="width:90%;">
|
|
|
|
+ <a-radio-group v-model="agentForm.state">
|
|
|
|
+ <a-radio :value="1">
|
|
|
|
+ 启用
|
|
|
|
+ </a-radio>
|
|
|
|
+ <a-radio :value="2">
|
|
|
|
+ 禁用
|
|
|
|
+ </a-radio>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </div>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ <a-row>
|
|
|
|
+ <a-col :span="12" class="col-style" style="border-top: none;">
|
|
|
|
+ <div>开始时间*</div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-form-model-item prop="startTime" style="width:90%;">
|
|
|
|
+ <a-date-picker
|
|
|
|
+ v-model="agentForm.startTime"
|
|
|
|
+ :disabled-date="disabledStartDate"
|
|
|
|
+ show-time
|
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
+ placeholder="请选择开始时间"
|
|
|
|
+ valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
+ />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </div>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :span="12" class="col-style" style="border-top: none;border-left:none;">
|
|
|
|
+ <div>结束时间*</div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-form-model-item prop="endTime" style="width:90%;">
|
|
|
|
+ <a-date-picker
|
|
|
|
+ v-model="agentForm.endTime"
|
|
|
|
+ :disabled-date="disabledEndDate"
|
|
|
|
+ show-time
|
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
+ placeholder="请选择结束时间"
|
|
|
|
+ valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
+ />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </div>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ <a-row class="col-style" style="border-top: none;">
|
|
|
|
+ <div>描  述</div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-form-model-item prop="describe" style="width:95.8%;margin-top:3px;">
|
|
|
|
+ <a-input v-model="agentForm.describe" type="textarea" :autosize="{minRows: 3, maxRows: 6}" placeholder="请输入描述" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </div>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form-model>
|
|
|
|
+ <a-modal
|
|
|
|
+ v-model="showAuditFlag"
|
|
|
|
+ :zIndex="20000"
|
|
|
|
+ width="800"
|
|
|
|
+ title="选择组织架构"
|
|
|
|
+ centered
|
|
|
|
+ okText="保存"
|
|
|
|
+ @ok="handleSaveOk">
|
|
|
|
+ <org-people style="width: 1100px; height: 60vh;"
|
|
|
|
+ ref="orgModalRef"
|
|
|
|
+ isOnlyOrg
|
|
|
|
+ isUseUserNo></org-people>
|
|
|
|
+ </a-modal>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- import OsUserApi from '@/api/user/org/osUser'
|
|
|
|
- import OsusertypeApi from '@/api/user/org/osUserType'
|
|
|
|
import { BaseForm,RxDialog,Dialog,RxLayout,Util ,RxTextBoxList} from "jpaas-common-lib"
|
|
import { BaseForm,RxDialog,Dialog,RxLayout,Util ,RxTextBoxList} from "jpaas-common-lib"
|
|
import {ACCESS_TOKEN} from "@/store/mutation-types";
|
|
import {ACCESS_TOKEN} from "@/store/mutation-types";
|
|
- import moment from 'moment';
|
|
|
|
- import osPropertiesGroupApi from '@/api/user/org/osPropertiesGroup'
|
|
|
|
-
|
|
|
|
|
|
+ import orgPeople from './components/orgPeople'
|
|
export default {
|
|
export default {
|
|
name: 'agentPage',
|
|
name: 'agentPage',
|
|
components: {
|
|
components: {
|
|
RxDialog,
|
|
RxDialog,
|
|
RxTextBoxList,
|
|
RxTextBoxList,
|
|
RxLayout,
|
|
RxLayout,
|
|
|
|
+ orgPeople
|
|
},
|
|
},
|
|
mixins:[BaseForm],
|
|
mixins:[BaseForm],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ showAuditFlag: false,
|
|
agentForm: {
|
|
agentForm: {
|
|
- agentDesc: '',
|
|
|
|
|
|
+ sketch: '',
|
|
agentType: 1,
|
|
agentType: 1,
|
|
- forUser: '',
|
|
|
|
- status: 1,
|
|
|
|
|
|
+ tagerNo: '',
|
|
|
|
+ tagerName: undefined,
|
|
|
|
+ state: 1,
|
|
startTime: '',
|
|
startTime: '',
|
|
endTime: '',
|
|
endTime: '',
|
|
- desc: ''
|
|
|
|
|
|
+ describe: ''
|
|
},
|
|
},
|
|
- osUserTypes:[],
|
|
|
|
- userTypeName:'无',
|
|
|
|
- mainDepId:'',
|
|
|
|
- dateFormat:'YYYY-MM-DD HH:mm:ss',
|
|
|
|
- jsonArray:[],
|
|
|
|
- cpsArray:[],
|
|
|
|
- imageUrl:"",
|
|
|
|
- loading:false,
|
|
|
|
- headers:{},
|
|
|
|
- disabled:true,
|
|
|
|
- mdl: {},
|
|
|
|
- propertiesGroups:[]
|
|
|
|
|
|
+ // agentRules: {
|
|
|
|
+ // sketch: [
|
|
|
|
+ // { required: true, message: '请输入代理描述', trigger: 'blur' }
|
|
|
|
+ // ],
|
|
|
|
+ // tagerName: [
|
|
|
|
+ // { required: true, message: '请选择代理人', trigger: 'blur' }
|
|
|
|
+ // ],
|
|
|
|
+ // startTime: [
|
|
|
|
+ // { required: true, message: '请选择开始时间', trigger: 'change' }
|
|
|
|
+ // ],
|
|
|
|
+ // endTime: [
|
|
|
|
+ // { required: true, message: '请选择结束时间', trigger: 'change' }
|
|
|
|
+ // ]
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
- var token =Vue.ls.get(ACCESS_TOKEN) ;
|
|
|
|
- if (token) {
|
|
|
|
- this.headers['Authorization'] = 'Bearer ' + token // 让每个请求携带token--['Authorization']为自定义key 请根据实际情况自行修改
|
|
|
|
- }
|
|
|
|
- // OsusertypeApi.getAllUserTypeList().then(data=>{
|
|
|
|
- // this.osUserTypes=data;
|
|
|
|
- // });
|
|
|
|
- // var self=this;
|
|
|
|
- // this.pkId=this.userId;
|
|
|
|
- // OsUserApi.edit(this.userId).then(data=>{
|
|
|
|
- // this.jsonArray=data.dimArray;
|
|
|
|
- // var userData=data.user;
|
|
|
|
- // userData.mainDepId=data.mainDepId;
|
|
|
|
- // userData.mainDepName=data.mainDepName;
|
|
|
|
- // this.mdl = Object.assign(userData);
|
|
|
|
- // //设置用户数据
|
|
|
|
- // this.form.setFieldsValue(this.mdl);
|
|
|
|
- // //获取用户类型名称
|
|
|
|
- // for (var i=0;i<this.osUserTypes.length;i++){
|
|
|
|
- // if(this.osUserTypes[i].code==self.mdl.userType){
|
|
|
|
- // this.userTypeName=this.osUserTypes[i].name;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // //初始化数据
|
|
|
|
- // this.onload_(this.mdl);
|
|
|
|
- // });
|
|
|
|
- // this.getPropertiesGroups();
|
|
|
|
- // //获取用户的分公司/职位/职等
|
|
|
|
- // OsUserApi.getUserCPS().then((res)=>{
|
|
|
|
- // this.cpsArray = res.data;
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- validForm(values){
|
|
|
|
- if(values.pwd!=values.repwd){
|
|
|
|
- this.$message.error("两次输入的密码不一致!")
|
|
|
|
|
|
+ timeToTimestamp(time){
|
|
|
|
+ let timestamp = Date.parse(new Date(time).toString());
|
|
|
|
+ //timestamp = timestamp / 1000; //时间戳为13位需除1000,时间戳为13位的话不需除1000
|
|
|
|
+ console.log(time + "的时间戳为:" + timestamp);
|
|
|
|
+ return timestamp;
|
|
|
|
+ //2021-11-18 22:14:24的时间戳为:1637244864707
|
|
|
|
+ },
|
|
|
|
+ disabledStartDate(startValue) {
|
|
|
|
+ const endValue = this.agentForm.endTime;
|
|
|
|
+ if (!startValue || !endValue) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- return true;
|
|
|
|
- },
|
|
|
|
- save(values){
|
|
|
|
- console.log(values)
|
|
|
|
|
|
+ // return startValue.valueOf() > endValue.valueOf();
|
|
|
|
+ return this.timeToTimestamp(startValue) > this.timeToTimestamp(endValue)
|
|
},
|
|
},
|
|
- onload_(values){
|
|
|
|
- if(values){
|
|
|
|
- if(values.birthday){
|
|
|
|
- values.birthday=moment(values.birthday, this.dateFormat);
|
|
|
|
- }
|
|
|
|
- if(values.photo) {
|
|
|
|
- this.imageUrl = this.getFilePath(values.photo);
|
|
|
|
- }
|
|
|
|
|
|
+ disabledEndDate(endValue) {
|
|
|
|
+ const startValue = this.agentForm.startTime;
|
|
|
|
+ if (!endValue || !startValue) {
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
+ // return startValue.valueOf() >= endValue.valueOf();
|
|
|
|
+ return this.timeToTimestamp(startValue) >= this.timeToTimestamp(endValue)
|
|
},
|
|
},
|
|
- getFilePath(fileId){
|
|
|
|
- return "/api/api-system/system/core/sysFile/previewFile?fileId=" + fileId;
|
|
|
|
- },
|
|
|
|
- handleChange(info) {
|
|
|
|
- if (info.file.status === 'uploading') {
|
|
|
|
- this.loading = true;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (info.file.status === 'done') {
|
|
|
|
- var res=info.fileList[info.fileList.length-1].response;
|
|
|
|
- if(res.success){
|
|
|
|
- this.photo=res.data[0].fileId;
|
|
|
|
- this.imageUrl=this.getFilePath(res.data[0].fileId);
|
|
|
|
- this.loading=false;
|
|
|
|
- }
|
|
|
|
|
|
+ handleSaveOk() {
|
|
|
|
+ let choosePeople = this.$refs.orgModalRef.checkedTarget
|
|
|
|
+ if(Object.keys(choosePeople).length) {
|
|
|
|
+ this.agentForm.tagerNo = choosePeople.approverId
|
|
|
|
+ this.agentForm.tagerName = choosePeople.approverName
|
|
}
|
|
}
|
|
|
|
+ this.showAuditFlag = false
|
|
},
|
|
},
|
|
- beforeUpload(file) {
|
|
|
|
- const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
|
|
- if (!isJpgOrPng) {
|
|
|
|
- this.$message.error('只能上传图片!');
|
|
|
|
- }
|
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
|
- if (!isLt2M) {
|
|
|
|
- this.$message.error('图片必须小于2MB!');
|
|
|
|
|
|
+ handleSubmit() {
|
|
|
|
+ console.log(this.agentForm)
|
|
|
|
+ let flag = true
|
|
|
|
+ if(!this.agentForm.sketch) {
|
|
|
|
+ this.$message.error('请输入代理描述')
|
|
|
|
+ flag = false
|
|
|
|
+ } else if(!this.agentForm.tagerName) {
|
|
|
|
+ this.$message.error('请选择代理人')
|
|
|
|
+ flag = false
|
|
|
|
+ } else if(!this.agentForm.startTime) {
|
|
|
|
+ this.$message.error('请选择开始时间')
|
|
|
|
+ flag = false
|
|
|
|
+ }else if(!this.agentForm.endTime) {
|
|
|
|
+ this.$message.error('请选择结束时间')
|
|
|
|
+ flag = false
|
|
|
|
+ } else {
|
|
|
|
+ return flag
|
|
}
|
|
}
|
|
- return isJpgOrPng && isLt2M;
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
- //获取用户扩展属性组
|
|
|
|
- getPropertiesGroups(){
|
|
|
|
- var ownerId="";
|
|
|
|
- if(this.userId){
|
|
|
|
- ownerId=this.userId;
|
|
|
|
- }
|
|
|
|
- osPropertiesGroupApi.getAllProperties({dimId:"-1",ownerId:ownerId}).then(res=>{
|
|
|
|
- this.propertiesGroups=res;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ // save(values){
|
|
|
|
+ // this.$refs.agentRef.validate(valid => {
|
|
|
|
+ // console.log(values)
|
|
|
|
+ // console.log(this.agentForm)
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
-<style scoped>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
.agent-title {
|
|
.agent-title {
|
|
|
|
+ font-size: 18px;
|
|
width:100%;
|
|
width:100%;
|
|
padding:20px;
|
|
padding:20px;
|
|
text-align:center;
|
|
text-align:center;
|
|
}
|
|
}
|
|
- .selectitem >>> .ant-form-item-control{
|
|
|
|
- margin-top: 7px;
|
|
|
|
|
|
+ .col-style {
|
|
|
|
+ display:flex;
|
|
|
|
+ align-items:center;
|
|
|
|
+ border:1px solid #e8e8e8;
|
|
|
|
+ color: #000;
|
|
|
|
+
|
|
|
|
+ >div:first-child {
|
|
|
|
+ width: 120px;
|
|
|
|
+ text-align:center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ >div:last-child {
|
|
|
|
+ flex:1;
|
|
|
|
+ border-left:1px solid #e8e8e8;
|
|
|
|
+ display:flex;
|
|
|
|
+ justify-content:center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ // .selectitem >>> .ant-form-item-control{
|
|
|
|
+ // margin-top: 7px;
|
|
|
|
+ // }
|
|
</style>
|
|
</style>
|