|
@@ -0,0 +1,421 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="borderless">
|
|
|
+ <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>
|
|
|
+ <el-button
|
|
|
+ class="el-button--small-yh add-customer-btn"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="editCustomer"
|
|
|
+ >保存数据
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <containerTitle
|
|
|
+ title="基础资料"
|
|
|
+ style="margin-top: 60px"
|
|
|
+ ></containerTitle>
|
|
|
+ <basic-container>
|
|
|
+ <avue-form
|
|
|
+ ref="form"
|
|
|
+ class="trading-form"
|
|
|
+ v-model="form"
|
|
|
+ :option="option"
|
|
|
+ >
|
|
|
+ <template slot="resultType">
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ v-model="form.resultType"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in resultList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictValue"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ </basic-container>
|
|
|
+ <containerTitle title="基础明细"></containerTitle>
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud
|
|
|
+ ref="crud"
|
|
|
+ :option="tableOption"
|
|
|
+ :data="dataList"
|
|
|
+ :table-loading="loading"
|
|
|
+ @saveColumn="saveColumn"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ >
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="addRow"
|
|
|
+ size="small"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="menu" slot-scope="{ row, index }">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="text"
|
|
|
+ @click="rowCell(row, index)"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="text"
|
|
|
+ @click="rowDel(row, index)"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template slot="parameter" slot-scope="{ row, index }">
|
|
|
+ <span v-if="row.$cellEdit">
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ v-model="row.parameter"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="parameterChange(row, index)"
|
|
|
+ clearable
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ v-if="form.resultType == '职称'"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in jobTitleList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictValue"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ v-model="row.parameter"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="parameterChange(row, index)"
|
|
|
+ clearable
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ v-else-if="form.resultType == '级别'"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in jobLevelList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictValue"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ v-else-if="form.resultType == '校龄'"
|
|
|
+ v-model="row.parameter"
|
|
|
+ :min="0"
|
|
|
+ :controls="false"
|
|
|
+ placeholder="请输入 数字"
|
|
|
+ style="width:100%"
|
|
|
+ @change="parameterChange(row, index)"
|
|
|
+ ></el-input-number>
|
|
|
+ <el-input
|
|
|
+ v-else
|
|
|
+ size="small"
|
|
|
+ v-model="row.parameter"
|
|
|
+ placeholder="请输入 类别"
|
|
|
+ @change="parameterChange(row, index)"
|
|
|
+ ></el-input>
|
|
|
+ </span>
|
|
|
+ <span v-else>{{ row.parameter }}</span>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { detail, submit, delItem } from "@/api/basicData/salaryConfiguration";
|
|
|
+export default {
|
|
|
+ name: "index",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ dataList: [],
|
|
|
+ option: {
|
|
|
+ menuBtn: false,
|
|
|
+ labelWidth: 130,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "部门",
|
|
|
+ prop: "inSection",
|
|
|
+ type: "select",
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=in_section",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "教师类别",
|
|
|
+ prop: "salaryWithdrawalStandardName",
|
|
|
+ type: "select",
|
|
|
+ dicUrl:
|
|
|
+ "/api/blade-system/dict-biz/dictionary?code=Salary_allocation_standard",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "标准类别",
|
|
|
+ prop: "normType",
|
|
|
+ type: "select",
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=norm_type",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "计算类别",
|
|
|
+ prop: "resultType",
|
|
|
+ // type: "select",
|
|
|
+ // dicUrl: "/api/blade-system/dict-biz/dictionary?code=result_type",
|
|
|
+ // props: {
|
|
|
+ // label: "dictValue",
|
|
|
+ // value: "dictValue"
|
|
|
+ // },
|
|
|
+ // rules: [
|
|
|
+ // {
|
|
|
+ // required: true,
|
|
|
+ // message: "",
|
|
|
+ // trigger: "blur"
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "创建时间",
|
|
|
+ prop: "createTime",
|
|
|
+ disabled: true,
|
|
|
+ span: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
+ type: "textarea",
|
|
|
+ minRows: 2,
|
|
|
+ span: 18
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ tableOption: {
|
|
|
+ align: "center",
|
|
|
+ addBtn: false,
|
|
|
+ refreshBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ border: true,
|
|
|
+ menuWidth: 120,
|
|
|
+ stripe: true,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "类别",
|
|
|
+ prop: "parameter",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "工资标准",
|
|
|
+ prop: "salary",
|
|
|
+ precision: 2,
|
|
|
+ type: "number",
|
|
|
+ controls: false,
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ resultList: [],
|
|
|
+ jobTitleList: [],
|
|
|
+ jobLevelList: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ if (this.detailData.id) {
|
|
|
+ this.getDetail(this.detailData.id);
|
|
|
+ }
|
|
|
+ if (this.detailData.status == 1) {
|
|
|
+ this.option.disabled = true;
|
|
|
+ }
|
|
|
+ this.getWorkDicts("result_type").then(res => {
|
|
|
+ this.resultList = res.data.data;
|
|
|
+ });
|
|
|
+ this.getWorkDicts("job_title").then(res => {
|
|
|
+ this.jobTitleList = res.data.data;
|
|
|
+ });
|
|
|
+ this.getWorkDicts("job_level").then(res => {
|
|
|
+ this.jobLevelList = res.data.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ cellStyle() {
|
|
|
+ return "padding:0;height:40px;";
|
|
|
+ },
|
|
|
+ getDetail(id) {
|
|
|
+ detail(id)
|
|
|
+ .then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.dataList = res.data.data.schoolConfigItems;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // this.loading = false;
|
|
|
+ // this.showBut = true;
|
|
|
+ // this.pageLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addRow() {
|
|
|
+ // if (!this.form.resultType) {
|
|
|
+ // return this.$message.error("请选择计算类别");
|
|
|
+ // }
|
|
|
+ this.dataList.push({ $cellEdit: true });
|
|
|
+ },
|
|
|
+ rowCell(row, index) {
|
|
|
+ if (row.$cellEdit == true) {
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
+ } else {
|
|
|
+ this.$set(row, "$cellEdit", true);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowDel(row, index) {
|
|
|
+ this.$confirm("确定删除数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ if (row.id) {
|
|
|
+ delItem(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.dataList.splice(index, 1);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.dataList.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ parameterChange(row, index) {
|
|
|
+ if (
|
|
|
+ this.dataList.filter(value => value.parameter == row.parameter).length >
|
|
|
+ 1
|
|
|
+ ) {
|
|
|
+ row.parameter = "";
|
|
|
+ return this.$message.error("明细类别不能重复");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //修改提交触发
|
|
|
+ editCustomer() {
|
|
|
+ this.$refs["form"].validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ for (let i = 0; i < this.dataList.length; i++) {
|
|
|
+ if (
|
|
|
+ this.dataList[i].salary == null ||
|
|
|
+ this.dataList[i].salary == undefined ||
|
|
|
+ this.dataList[i].salary == ""
|
|
|
+ ) {
|
|
|
+ return this.$message.error(`请输入第${i + 1}行的工资标准`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ submit({ ...this.form, schoolConfigItems: this.dataList })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.dataList = res.data.data.schoolConfigItems;
|
|
|
+ })
|
|
|
+ .finally(() => {});
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //返回列表
|
|
|
+ backToList() {
|
|
|
+ this.$emit("goBack");
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.trading-form ::v-deep .el-form-item {
|
|
|
+ margin-bottom: 8px !important;
|
|
|
+}
|
|
|
+::v-deep .el-form-item__error {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+.img-form ::v-deep .el-form-item {
|
|
|
+ height: 150px;
|
|
|
+ line-height: 150px;
|
|
|
+ margin-bottom: 8px !important;
|
|
|
+}
|
|
|
+.img-form ::v-deep .avue-upload__icon {
|
|
|
+ font-size: 20px;
|
|
|
+ width: 150px;
|
|
|
+ height: 150px;
|
|
|
+ line-height: 150px;
|
|
|
+}
|
|
|
+</style>
|