|
@@ -0,0 +1,283 @@
|
|
|
+<template>
|
|
|
+ <div class="borderless" v-loading="allloading">
|
|
|
+ <div class="customer-head">
|
|
|
+ <div class="customer-back">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ style="border: none;background: none;color: red"
|
|
|
+ icon="el-icon-arrow-left"
|
|
|
+ @click="backToList"
|
|
|
+ >返回列表
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="add-customer-btn">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ v-if="detailData.status == 1"
|
|
|
+ class="el-button--small-yh "
|
|
|
+ :disabled="form.status > 0"
|
|
|
+ @click.stop="openEdit"
|
|
|
+ >编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ class="el-button--small-yh"
|
|
|
+ type="primary"
|
|
|
+ :disabled="loadingBtn || detailData.status == 1"
|
|
|
+ size="small"
|
|
|
+ @click="editCustomer"
|
|
|
+ >保存数据
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="customer-main">
|
|
|
+ <containerTitle title="基础资料"></containerTitle>
|
|
|
+ <basic-container>
|
|
|
+ <avue-form
|
|
|
+ class="trading-form"
|
|
|
+ ref="form"
|
|
|
+ v-model="form"
|
|
|
+ :option="option"
|
|
|
+ />
|
|
|
+ </basic-container>
|
|
|
+ <containerTitle title="基础明细"></containerTitle>
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud
|
|
|
+ ref="crud"
|
|
|
+ v-model="crudForm"
|
|
|
+ :option="optionList"
|
|
|
+ :data="dataList"
|
|
|
+ :table-loading="loading"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ >
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+import { dateFormat } from "@/util/date";
|
|
|
+import { detail, submit, delItem } from "@/api/salaryManagement/primarySchool";
|
|
|
+import { optionList } from "./js/optionList";
|
|
|
+import reportDialog from "@/components/report-dialog/main";
|
|
|
+export default {
|
|
|
+ name: "detailsPage",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ time: "",
|
|
|
+ crudForm: {},
|
|
|
+ loading: false,
|
|
|
+ allloading: false,
|
|
|
+ loadingBtn: false,
|
|
|
+ form: {},
|
|
|
+ dataList: [],
|
|
|
+ drawer: false,
|
|
|
+ tableHeight: 0,
|
|
|
+ option: {
|
|
|
+ menuBtn: false,
|
|
|
+ labelWidth: 100,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "货币名称",
|
|
|
+ prop: "a",
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "汇率类型",
|
|
|
+ prop: "b",
|
|
|
+ type: "select",
|
|
|
+ filterable: true,
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
+ dicData: [
|
|
|
+ {
|
|
|
+ dictValue: "年汇率",
|
|
|
+ dictKey: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictValue: "月汇率",
|
|
|
+ dictKey: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictValue: "日汇率",
|
|
|
+ dictKey: 2
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "汇率年度",
|
|
|
+ prop: "c",
|
|
|
+ type: "year",
|
|
|
+ valueFormat: "yyyy",
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "月份",
|
|
|
+ prop: "d",
|
|
|
+ type: "select",
|
|
|
+ filterable: true,
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=month",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictKey"
|
|
|
+ },
|
|
|
+ span: 6,
|
|
|
+ display: false
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ optionList: optionList
|
|
|
+ };
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ reportDialog
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ if (this.detailData.id) {
|
|
|
+ this.getDetail(this.detailData.id);
|
|
|
+ }
|
|
|
+ if (this.detailData.status == 1) {
|
|
|
+ this.option.disabled = true;
|
|
|
+ }
|
|
|
+ this.optionList.height = 450;
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ cellStyle() {
|
|
|
+ return "padding:0;height:40px;";
|
|
|
+ },
|
|
|
+ getDetail(id) {
|
|
|
+ // detail(id)
|
|
|
+ // .then(res => {
|
|
|
+ // this.form = res.data.data;
|
|
|
+ // this.getItemDetail();
|
|
|
+ // this.getitemAnnex();
|
|
|
+ // })
|
|
|
+ // .finally(() => {
|
|
|
+ // this.allloading = false;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ rowDel(row) {
|
|
|
+ this.$confirm("确定删除数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ if (row.id) {
|
|
|
+ delItem(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.getItemDetail();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.dataList.splice(row.$index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //修改提交触发
|
|
|
+ editCustomer() {
|
|
|
+ this.$refs["form"].validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ this.loadingBtn = true;
|
|
|
+ submit({
|
|
|
+ ...this.form,
|
|
|
+ salaryType: "小学部",
|
|
|
+ salaryItemList: this.dataList
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.getItemDetail();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loadingBtn = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ openEdit() {
|
|
|
+ const data = {
|
|
|
+ moduleName: "xxb",
|
|
|
+ tableName: "primary_school",
|
|
|
+ billId: this.form.id,
|
|
|
+ no: localStorage.getItem("browserID"),
|
|
|
+ billNo: this.form.annual + "-" + this.form.moon
|
|
|
+ };
|
|
|
+ this.checkLock(data).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.onLock(data).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.detailData.status = 2;
|
|
|
+ this.option = this.$options.data().option;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //返回列表
|
|
|
+ backToList() {
|
|
|
+ if (this.form.id) {
|
|
|
+ this.unLock({
|
|
|
+ moduleName: "xxb",
|
|
|
+ tableName: "primary_school",
|
|
|
+ billId: this.form.id,
|
|
|
+ billNo: this.form.annual + "-" + this.form.moon
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.$emit("goBack");
|
|
|
+ this.leaveDetailsKey(this.$route.name);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ "form.b": function(row) {
|
|
|
+ console.log(row);
|
|
|
+ if (row == "日汇率") {
|
|
|
+ this.findObject(this.option.column, "d").display = true;
|
|
|
+ this.findObject(this.optionList.column, "DAY").hide = false;
|
|
|
+ } else {
|
|
|
+ this.findObject(this.option.column, "d").display = false;
|
|
|
+ this.findObject(this.optionList.column, "DAY").hide = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+.headerCellClass {
|
|
|
+ color: #fff !important;
|
|
|
+ background: #a4cf57 !important;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.trading-form ::v-deep .el-form-item {
|
|
|
+ margin-bottom: 4px !important;
|
|
|
+}
|
|
|
+::v-deep .el-form-item__error {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+.schoolupload ::v-deep .el-upload-list {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+.abnormal ::v-deep .el-dialog__body {
|
|
|
+ padding: 10px 20px;
|
|
|
+}
|
|
|
+</style>
|