|
@@ -0,0 +1,487 @@
|
|
|
+<template>
|
|
|
+ <div class="pageIndexClass">
|
|
|
+ <div class="content">
|
|
|
+ <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" :loading="loading"
|
|
|
+ highlight-current-row :action-list="[
|
|
|
+ {
|
|
|
+ text: '添加',
|
|
|
+ action: () => openModal('add'),
|
|
|
+ },
|
|
|
+ ]" @get-list="getList">
|
|
|
+
|
|
|
+ <template #code="{item}">
|
|
|
+ <div style="width:100%">
|
|
|
+ <span class="el-click" @click="getDtl(item)">{{item.code}}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byTable>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="60%">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
|
|
|
+
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="dialogVisible = false" size="default">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { computed, ref } from "vue";
|
|
|
+import byTable from "@/components/byTable/index";
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
|
|
|
+const userList = ref([]);
|
|
|
+const deptData = ref([]);
|
|
|
+const typeData = ref([
|
|
|
+ {
|
|
|
+ label: "收入",
|
|
|
+ value: "10",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "支出",
|
|
|
+ value: "20",
|
|
|
+ },
|
|
|
+]);
|
|
|
+const sourceList = ref({
|
|
|
+ data: [],
|
|
|
+ pagination: {
|
|
|
+ total: 0,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ keyword: "",
|
|
|
+ },
|
|
|
+});
|
|
|
+const loading = ref(false);
|
|
|
+const statusData = ref([
|
|
|
+ {
|
|
|
+ label: "草稿",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审批中",
|
|
|
+ value: 10,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审批驳回",
|
|
|
+ value: 20,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审批通过",
|
|
|
+ value: 30,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "作废",
|
|
|
+ value: 88,
|
|
|
+ },
|
|
|
+]);
|
|
|
+const selectConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: "审批状态",
|
|
|
+ prop: "status",
|
|
|
+ data: statusData.value,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "流水号",
|
|
|
+ slot: "code",
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // label: "印章类型",
|
|
|
+ // prop: "type",
|
|
|
+ // },
|
|
|
+ // render(val) {
|
|
|
+ // return proxy.dictKeyValue(val, sealType.value);
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "申请人",
|
|
|
+ prop: "createUserName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "申请日期",
|
|
|
+ prop: "applyTime",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "所属中心",
|
|
|
+ prop: "companyName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "所属部门",
|
|
|
+ prop: "deptName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "学历",
|
|
|
+ prop: "educationName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "学历补贴金额",
|
|
|
+ prop: "amount",
|
|
|
+ },
|
|
|
+ render(val) {
|
|
|
+ return proxy.moneyFormat(val, 2);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "审批状态",
|
|
|
+ prop: "status",
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ render(type) {
|
|
|
+ return proxy.dictValueLabel(type, statusData.value);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "操作",
|
|
|
+ width: "120",
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ renderHTML(row) {
|
|
|
+ return [
|
|
|
+ row.status == 0
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "修改",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ clickUpdate(row);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
+ row.status == 0
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "删除",
|
|
|
+ type: "danger",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ proxy
|
|
|
+ .msgConfirm()
|
|
|
+ .then((res) => {
|
|
|
+ proxy
|
|
|
+ .post("/educationSubsidy/delete", {
|
|
|
+ id: row.id,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ proxy.msgTip("操作成功", 1);
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
+ row.status == 10 || row.status == 30
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "作废",
|
|
|
+ type: "danger",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ proxy
|
|
|
+ .msgConfirm()
|
|
|
+ .then((res) => {
|
|
|
+ proxy
|
|
|
+ .post("/educationSubsidy/cancellation", {
|
|
|
+ id: row.id,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ proxy.msgTip("操作成功", 1);
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const corporationList = ref([]);
|
|
|
+const getList = async (req) => {
|
|
|
+ sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
+ loading.value = true;
|
|
|
+ proxy
|
|
|
+ .post("/educationSubsidy/page", sourceList.value.pagination)
|
|
|
+ .then((res) => {
|
|
|
+ sourceList.value.data = res.rows;
|
|
|
+ sourceList.value.pagination.total = res.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
+};
|
|
|
+getList();
|
|
|
+const getDeptData = (val) => {
|
|
|
+ proxy
|
|
|
+ .get("/tenantUser/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10000,
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ companyId: proxy.useUserStore().user.companyId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ userList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .get("/tenantDept/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ keyword: "",
|
|
|
+ ancestors: proxy.useUserStore().user.companyId,
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ // type: 2,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ deptData.value = proxy.handleTree(res.data, "deptId");
|
|
|
+ });
|
|
|
+};
|
|
|
+getDeptData();
|
|
|
+const modalType = ref("add");
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const loadingDialog = ref(false);
|
|
|
+const submit = ref(null);
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ rules: [],
|
|
|
+});
|
|
|
+const formConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "基本信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "name",
|
|
|
+ label: "印章名称",
|
|
|
+ required: true,
|
|
|
+ itemWidth: 50,
|
|
|
+ itemType: "text",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "sealType",
|
|
|
+ label: "印章类型",
|
|
|
+ data: sealType.value,
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "applyUserId",
|
|
|
+ label: "存管人员",
|
|
|
+ required: true,
|
|
|
+ filterable: true,
|
|
|
+ data: userList.value,
|
|
|
+ itemWidth: 50,
|
|
|
+ fn: (val) => {
|
|
|
+ let current = userList.value.find((x) => x.value == val);
|
|
|
+ console.log(current, "ada");
|
|
|
+ if (current) {
|
|
|
+ formData.data.deptId = current.deptId;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "treeSelect",
|
|
|
+ prop: "deptId",
|
|
|
+ label: "存管部门",
|
|
|
+ data: deptData.value,
|
|
|
+ propsTreeLabel: "deptName",
|
|
|
+ propsTreeValue: "deptId",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "accountNumber",
|
|
|
+ label: "印章用途",
|
|
|
+ itemWidth: 100,
|
|
|
+ itemType: "textarea",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const rules = ref({
|
|
|
+ name: [{ required: true, message: "请输入承包商", trigger: "blur" }],
|
|
|
+ taxPoints: [{ required: true, message: "请输入税点", trigger: "blur" }],
|
|
|
+ accountBank: [{ required: true, message: "请输入开户行", trigger: "blur" }],
|
|
|
+ accountName: [{ required: true, message: "请输入开户名", trigger: "blur" }],
|
|
|
+ accountNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
|
|
|
+});
|
|
|
+const formData = reactive({
|
|
|
+ data: {
|
|
|
+ accountRemainderList: [{ currency: "", remainder: undefined }],
|
|
|
+ },
|
|
|
+});
|
|
|
+const openModal = (val) => {
|
|
|
+ // modalType.value = val;
|
|
|
+ // formData.data = {
|
|
|
+ // accountRemainderList: [{ currency: "", remainder: undefined }],
|
|
|
+ // };
|
|
|
+ // loadingDialog.value = false;
|
|
|
+ // dialogVisible.value = true;
|
|
|
+ proxy.$router.replace({
|
|
|
+ path: "/platform_manage/process/processApproval",
|
|
|
+ query: {
|
|
|
+ flowKey: "education_subsidy_flow",
|
|
|
+ flowName: "学历补贴发起流程",
|
|
|
+ random: proxy.random(),
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+const clickBalance = () => {
|
|
|
+ if (
|
|
|
+ formData.data.accountRemainderList &&
|
|
|
+ formData.data.accountRemainderList.length > 0
|
|
|
+ ) {
|
|
|
+ formData.data.accountRemainderList.push({
|
|
|
+ currency: "",
|
|
|
+ remainder: undefined,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.accountRemainderList = [
|
|
|
+ { currency: "", remainder: undefined },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+};
|
|
|
+const handleRemove = (index) => {
|
|
|
+ formData.data.accountRemainderList.splice(index, 1);
|
|
|
+};
|
|
|
+const isRepeat = (arr) => {
|
|
|
+ var hash = {};
|
|
|
+ for (var i in arr) {
|
|
|
+ if (hash[arr[i].currency]) return true;
|
|
|
+ hash[arr[i].currency] = true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+};
|
|
|
+const submitForm = () => {
|
|
|
+ submit.value.handleSubmit(() => {
|
|
|
+ loadingDialog.value = true;
|
|
|
+ proxy.post("/contractor/" + modalType.value, formData.data).then(
|
|
|
+ () => {
|
|
|
+ proxy.msgTip("操作成功", 1);
|
|
|
+ dialogVisible.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err);
|
|
|
+ loadingDialog.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ // if (
|
|
|
+ // formData.data.accountRemainderList &&
|
|
|
+ // formData.data.accountRemainderList.length > 0
|
|
|
+ // ) {
|
|
|
+ // if (isRepeat(formData.data.accountRemainderList)) {
|
|
|
+ // return ElMessage("请勿重复添加货币余额");
|
|
|
+ // } else {
|
|
|
+ // loadingDialog.value = true;
|
|
|
+ // proxy.post("/accountManagement/" + modalType.value, formData.data).then(
|
|
|
+ // () => {
|
|
|
+ // ElMessage({
|
|
|
+ // message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // dialogVisible.value = false;
|
|
|
+ // getList();
|
|
|
+ // },
|
|
|
+ // (err) => {
|
|
|
+ // console.log(err);
|
|
|
+ // loadingDialog.value = false;
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // return ElMessage("请添加至少一条类型余额");
|
|
|
+ // }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const update = (row) => {
|
|
|
+ loadingDialog.value = false;
|
|
|
+ modalType.value = "edit";
|
|
|
+ formData.data = proxy.deepClone(row);
|
|
|
+ dialogVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const clickUpdate = (row) => {
|
|
|
+ proxy.$router.push({
|
|
|
+ path: "/platform_manage/process/processApproval",
|
|
|
+ query: {
|
|
|
+ flowKey: "education_subsidy_flow",
|
|
|
+ flowName: "学历补贴发起流程",
|
|
|
+ random: proxy.random(),
|
|
|
+ businessId: row.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const getDtl = (row) => {
|
|
|
+ proxy.$router.push({
|
|
|
+ path: "/platform_manage/process/processApproval",
|
|
|
+ query: {
|
|
|
+ flowKey: "education_subsidy_flow",
|
|
|
+ flowName: "学历补贴流程查看",
|
|
|
+ random: proxy.random(),
|
|
|
+ businessId: row.id,
|
|
|
+ processType: 20,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.tenant {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+::v-deep(.el-input-number .el-input__inner) {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+</style>
|