|
@@ -1,466 +0,0 @@
|
|
-<template>
|
|
|
|
- <div class="inputFormDiv">
|
|
|
|
- <div class="inputInfo">
|
|
|
|
- <keep-alive>
|
|
|
|
- <inputLegend :label="'任务分配'" v-if="inputFormShow" isopen="true">
|
|
|
|
- <inputForm ref="inputForm" :config="inputConfig" v-model="ruleFormList.form1"></inputForm>
|
|
|
|
- </inputLegend>
|
|
|
|
- </keep-alive>
|
|
|
|
- </div>
|
|
|
|
- <div class="optionButton">
|
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
|
- <el-button class="save" @click="saveData" :loading="btnLoad">保存</el-button>
|
|
|
|
- <el-button class="submit" type="primary" @click="sureData" :loading="btnLoad">提交</el-button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
-import inputForm from "@/components/projectCom/inputForm/index.vue";
|
|
|
|
-import inputLegend from "@/components/projectCom/legend/index.vue";
|
|
|
|
-import commonMe from "@/utils/common.js";
|
|
|
|
-import { getAllPost, getAllUser } from "@/api/base";
|
|
|
|
-// import { getTallyDate } from '@/api/sys/pzSys.ts'
|
|
|
|
-// import { getCodeInfo, getProcesssById, addNodeFlow } from '@/api/flowInfo.js'
|
|
|
|
-export default {
|
|
|
|
- components: { inputForm, inputLegend },
|
|
|
|
- props: {
|
|
|
|
- inputData: {} //当前数据的信息
|
|
|
|
- },
|
|
|
|
- created() { },
|
|
|
|
- mounted() {
|
|
|
|
- if (this.inputData.data) {
|
|
|
|
- this.inputFormShow = false;
|
|
|
|
- this.nodeFormShow = false;
|
|
|
|
- // this.getUpdateInfo()
|
|
|
|
- } else {
|
|
|
|
- this.inputFormShow = true;
|
|
|
|
- this.nodeFormShow = true;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- data() {
|
|
|
|
- const postList = this.inputData.handleInfo[0].handleInfo.handleSelect[0]
|
|
|
|
- .postList;
|
|
|
|
- return {
|
|
|
|
- btnLoad: false, // 遮罩层
|
|
|
|
- isWork: "1",
|
|
|
|
- numberDate: 0,
|
|
|
|
- endTime1: "",
|
|
|
|
- fristAction: true,
|
|
|
|
- inputFormShow: false,
|
|
|
|
- nodeFormShow: false,
|
|
|
|
- ruleFormList: {
|
|
|
|
- //使用的inputForm的列表
|
|
|
|
- form1: null, //表单不单独取名,直接用form加数字组成
|
|
|
|
- form2: null
|
|
|
|
- // form3:null,
|
|
|
|
- },
|
|
|
|
- setShow: {
|
|
|
|
- //隐藏下一环节选择
|
|
|
|
- showHandleInfo: true //设置为空可以是填报页面驳回和转派的示例
|
|
|
|
- },
|
|
|
|
- userList: [],
|
|
|
|
- opinion: "", //岗位名称
|
|
|
|
- condition: "", //用户姓名
|
|
|
|
- nextNodeInfo: {}, //下一环节信息
|
|
|
|
- // inputForm: {}, //输入表单信息
|
|
|
|
- inputConfig: {
|
|
|
|
- //输入的相关配置
|
|
|
|
- data: [
|
|
|
|
- {
|
|
|
|
- group: [
|
|
|
|
- {
|
|
|
|
- field: "outcome", //存储字段
|
|
|
|
- type: "select", //类型,不写入此参数则默认是text
|
|
|
|
- label: "项目小组", //显示标签
|
|
|
|
- required: true, //是否必填,
|
|
|
|
- config: {
|
|
|
|
- //select 下拉框的一些设置这里会使用projectCom的select组件,自动补足config里面的label
|
|
|
|
- multiple: false, //是否多选
|
|
|
|
- startChange: true,
|
|
|
|
- data: postList,
|
|
|
|
- change: (value, selectConfig) => {
|
|
|
|
- if (
|
|
|
|
- selectConfig.valueAndLabel &&
|
|
|
|
- selectConfig.valueAndLabel[0]
|
|
|
|
- ) {
|
|
|
|
- this.opinion = selectConfig.valueAndLabel[0].label;
|
|
|
|
- } else {
|
|
|
|
- this.opinion = "";
|
|
|
|
- }
|
|
|
|
- const userList = selectConfig.data.find(e => {
|
|
|
|
- return e.postId == value;
|
|
|
|
- });
|
|
|
|
- if (userList.userList) {
|
|
|
|
- commonFlow.changeGroupData(
|
|
|
|
- this.inputConfig,
|
|
|
|
- "staffId",
|
|
|
|
- userList.userList
|
|
|
|
- );
|
|
|
|
- } else {
|
|
|
|
- commonFlow.changeGroupData(
|
|
|
|
- this.inputConfig,
|
|
|
|
- "staffId",
|
|
|
|
- []
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- if (this.fristAction) {
|
|
|
|
- //第一次触发的时候不清空默认值
|
|
|
|
- this.fristAction = false;
|
|
|
|
- } else {
|
|
|
|
- this.$refs.inputForm.setValue({ staffId: "" }, false);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- searchData: {}, //查询条件
|
|
|
|
- field: {
|
|
|
|
- id: "postId", //id代表的字段
|
|
|
|
- label: "postName" //label的字段
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- field: "staffId", //存储字段
|
|
|
|
- type: "select", //类型,不写入此参数则默认是text
|
|
|
|
- label: "项目组长", //显示标签
|
|
|
|
- required: true, //是否必填,
|
|
|
|
- config: {
|
|
|
|
- //select 下拉框的一些设置这里会使用projectCom的select组件,自动补足config里面的label
|
|
|
|
- multiple: false, //是否多选
|
|
|
|
- startChange: true,
|
|
|
|
- data: [], //下拉数据
|
|
|
|
- change: (value, selectConfig) => {
|
|
|
|
- if (
|
|
|
|
- selectConfig.valueAndLabel &&
|
|
|
|
- selectConfig.valueAndLabel[0]
|
|
|
|
- ) {
|
|
|
|
- this.condition = selectConfig.valueAndLabel[0].label;
|
|
|
|
- } else {
|
|
|
|
- this.condition = "";
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- field: {
|
|
|
|
- id: "userId", //id代表的字段
|
|
|
|
- label: "userName" //label的字段
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- field: "startTime", //存储字段
|
|
|
|
- type: "date", //类型,不写入此参数则默认是text
|
|
|
|
- label: "分配日期", //显示标签
|
|
|
|
- required: true, //是否必填,
|
|
|
|
- disabled: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- field: "oneId", //存储字段
|
|
|
|
- type: "number",
|
|
|
|
- label: "勘察期限", //显示标签
|
|
|
|
- change: (value, selectConfig) => {
|
|
|
|
- this.getByDate(value, selectConfig);
|
|
|
|
- },
|
|
|
|
- required: true //是否必填,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- field: "endTime", //存储字段
|
|
|
|
- type: "date", //类型,不写入此参数则默认是text
|
|
|
|
- label: "最迟勘察日期", //显示标签
|
|
|
|
- isDefault: false,
|
|
|
|
- disabled: true,
|
|
|
|
- required: true //是否必填,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- field: "handleResults", // 存储字段
|
|
|
|
- type: "checkBox", // 类型,不写入此参数则默认是text
|
|
|
|
- required: false, // 是否必填,
|
|
|
|
- config: {
|
|
|
|
- value: "1",
|
|
|
|
- multiple: false,
|
|
|
|
- change: (value, selectConfig) => {
|
|
|
|
- this.getByDate1(value, selectConfig);
|
|
|
|
- },
|
|
|
|
- data: [
|
|
|
|
- {
|
|
|
|
- id: "1", // id代表的字段
|
|
|
|
- label: "工作日" // label的字段
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "0", // id代表的字段
|
|
|
|
- label: "自然日" // label的字段
|
|
|
|
- }
|
|
|
|
- ], // 下拉数据
|
|
|
|
- field: {
|
|
|
|
- id: "id", // id代表的字段
|
|
|
|
- label: "label" // label的字段
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- field: "remark", //存储字段
|
|
|
|
- label: "备注", //显示标签
|
|
|
|
- type: "area"
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- currentUserList() {
|
|
|
|
- return this.userList;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- /*
|
|
|
|
- 截止日期输入
|
|
|
|
- */
|
|
|
|
- getByDate(e, val) {
|
|
|
|
- let time = null;
|
|
|
|
- this.numberDate = e;
|
|
|
|
- let isWork = this.ruleFormList.form1.ruleForm.handleResults;
|
|
|
|
- getTallyDate({ number: e, isWork: isWork }).then(res => {
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.$refs.inputForm.setValue(
|
|
|
|
- { endTime: res.data.split(" ")[0] + " 00:00:00" || "" },
|
|
|
|
- false
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- /*
|
|
|
|
- 工作日输入
|
|
|
|
- */
|
|
|
|
- getByDate1(e, val) {
|
|
|
|
- this.isWork = e;
|
|
|
|
- // let oneId = this.ruleFormList.form1.ruleForm.oneId || 0
|
|
|
|
- let oneId = this.ruleFormList.form1
|
|
|
|
- ? this.ruleFormList.form1.ruleForm.oneId || 0
|
|
|
|
- : 0;
|
|
|
|
- getTallyDate({ number: oneId, isWork: e }).then(res => {
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.$refs.inputForm.setValue(
|
|
|
|
- { endTime: res.data.split(" ")[0] + " 00:00:00" || "" },
|
|
|
|
- false
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取岗位
|
|
|
|
- */
|
|
|
|
- // getAllPostList(tenantId) {
|
|
|
|
- // return new Promise((res, rej) => {
|
|
|
|
- // const params = {
|
|
|
|
- // deleted: 0, //获取未删除的岗位
|
|
|
|
- // tenantId: tenantId //获取制定公司的部门
|
|
|
|
- // }
|
|
|
|
- // getAllPost(params).then((result) => {
|
|
|
|
- // if (result.data) {
|
|
|
|
- // res(result.data)
|
|
|
|
- // } else {
|
|
|
|
- // rej(result)
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取人员
|
|
|
|
- */
|
|
|
|
- // getAllUserList(value, clear) {
|
|
|
|
- // if (clear) {
|
|
|
|
- // this.$refs.inputForm.setValue({ dutyUser: '' }, false)
|
|
|
|
- // }
|
|
|
|
- // commonSend.getAllUserList(this.$store.state.user.tenantId, [value]).then((res) => {
|
|
|
|
- // commonFlow.changeGroupData(this.inputConfig, 'staffId', res)
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 取消
|
|
|
|
- */
|
|
|
|
- cancel() {
|
|
|
|
- this.$emit("input", false);
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- showInput(data) {
|
|
|
|
- this.inputFormShow = data;
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 保存
|
|
|
|
- */
|
|
|
|
- saveData() {
|
|
|
|
- const data = this.getFormData(0);
|
|
|
|
- this.btnLoad = true;
|
|
|
|
- addNodeFlow(data)
|
|
|
|
- .then(res => {
|
|
|
|
- if (res.code == "200") {
|
|
|
|
- this.$message.success("保存成功");
|
|
|
|
- this.$emit("input", false);
|
|
|
|
- }
|
|
|
|
- this.btnLoad = false;
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- this.btnLoad = false;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 验证数据,提交的时候才进行验证,并将form组数据进行整合
|
|
|
|
- */
|
|
|
|
- validateData() {
|
|
|
|
- //规则验证
|
|
|
|
- let validateResult = true;
|
|
|
|
- for (let item in this.ruleFormList) {
|
|
|
|
- if (this.ruleFormList[item] && this.ruleFormList[item].validate) {
|
|
|
|
- this.ruleFormList[item].validate(e => {
|
|
|
|
- if (!e) {
|
|
|
|
- validateResult = e;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!validateResult) {
|
|
|
|
- this.$message.info("请将红色框中的数据补充完整");
|
|
|
|
- }
|
|
|
|
- return validateResult;
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取流程详细信息
|
|
|
|
- */
|
|
|
|
- getUpdateInfo() {
|
|
|
|
- if (this.inputData.data) {
|
|
|
|
- getProcesssById({ id: this.inputData.data.processId }).then(res => {
|
|
|
|
- if (res.data && res.data.nodes) {
|
|
|
|
- res.data.nodes.forEach(val => {
|
|
|
|
- if (
|
|
|
|
- val.processStep == this.inputData.data.processStep &&
|
|
|
|
- val.stepNode == this.inputData.data.stepNode &&
|
|
|
|
- val.isValid
|
|
|
|
- ) {
|
|
|
|
- this.inputConfig.data.forEach(item => {
|
|
|
|
- item.group.forEach((item2, index) => {
|
|
|
|
- item2.value = val[item2.field];
|
|
|
|
- if (item2.field == "endTime") {
|
|
|
|
- this.endTime1 = val[item2.field];
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- item2.field == "handleResults" &&
|
|
|
|
- val.handleResults != null
|
|
|
|
- ) {
|
|
|
|
- item2.config.value = val[item2.field] + "";
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- this.opinion = val["opinion"];
|
|
|
|
- this.condition = val["condition"];
|
|
|
|
- this.inputData.annex = val["annex"];
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- this.inputFormShow = true;
|
|
|
|
- this.nodeFormShow = true;
|
|
|
|
- // this.$nextTick((e) => {
|
|
|
|
- // this.getAllUserList(this.ruleFormList.form1.ruleForm.outcome, false)
|
|
|
|
- // })
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 处理成后端需要的数据
|
|
|
|
- */
|
|
|
|
- getFormData(value) {
|
|
|
|
- const formData = {};
|
|
|
|
- //数据处理
|
|
|
|
- for (let itemOne in this.ruleFormList) {
|
|
|
|
- if (this.ruleFormList[itemOne]) {
|
|
|
|
- let tempData = this.ruleFormList[itemOne].ruleForm || [];
|
|
|
|
- if (tempData) {
|
|
|
|
- for (let item in tempData) {
|
|
|
|
- formData[item] = tempData[item];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- formData.condition = this.condition;
|
|
|
|
- formData.opinion = this.opinion;
|
|
|
|
- formData.startTime =
|
|
|
|
- formData.startTime && formData.startTime + " 00:00:00";
|
|
|
|
- formData.saveState = value;
|
|
|
|
- return commonFlow.getNodeSendData(formData, "", {
|
|
|
|
- outcome: "",
|
|
|
|
- staffId: "",
|
|
|
|
- remark: "",
|
|
|
|
- condition: "",
|
|
|
|
- startTime: "",
|
|
|
|
- oneId: "",
|
|
|
|
- endTime: "",
|
|
|
|
- handleResults: "",
|
|
|
|
- opinion: ""
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 提交数据
|
|
|
|
- */
|
|
|
|
- sureData() {
|
|
|
|
- if (!this.validateData()) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- const data = this.getFormData(1);
|
|
|
|
- this.btnLoad = true;
|
|
|
|
- addNodeFlow(data)
|
|
|
|
- .then(res => {
|
|
|
|
- if (res.code == "200") {
|
|
|
|
- this.$message.success("提交成功");
|
|
|
|
- this.$emit("input", false);
|
|
|
|
- }
|
|
|
|
- this.btnLoad = false;
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- this.btnLoad = false;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 关闭页面
|
|
|
|
- */
|
|
|
|
- closePage() {
|
|
|
|
- this.$emit("input", false);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
-// @import './src/styles/diaLogStyle/style.scss';
|
|
|
|
-// /deep/ .el-dialog {
|
|
|
|
-// @include diaLogStyle;
|
|
|
|
-// }
|
|
|
|
-// @import './src/styles/elTabsHeader/style.scss';
|
|
|
|
-// /deep/ .el-tabs__header.is-top {
|
|
|
|
-// @include elTabsHeaderStyle;
|
|
|
|
-// }
|
|
|
|
-.optionButton {
|
|
|
|
- position: relative;
|
|
|
|
- float: right;
|
|
|
|
- margin-top: 20px;
|
|
|
|
-}
|
|
|
|
-.submit {
|
|
|
|
- background: #2d74e7;
|
|
|
|
- &:hover {
|
|
|
|
- opacity: 0.6;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-.save {
|
|
|
|
- background: #e6a23c;
|
|
|
|
- color: white;
|
|
|
|
- &:hover {
|
|
|
|
- opacity: 0.6;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</style>
|
|
|